Closed
Description
Steps to reproduce
Tell us how to reproduce this issue.
Create a stack project and update Main.hs to:
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Data.ByteString.Lazy.Char8
myByteString :: ByteString
myByteString = "my "
-- >>> myByteString <> "stuff"
main :: IO ()
main = pure ()
Expected behaviour
OverloadedStrings should take effect in the inline code evaluation context resulting in:
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Data.ByteString.Lazy.Char8
myByteString :: ByteString
myByteString = "my "
-- >>> myByteString <> "stuff"
-- "my stuff"
main :: IO ()
main = pure ()
Actual behaviour
An error indicating the inline evaluation context doesn't respect OverloadedStrings
. I've also verified it doesn't work with others like DeriveGeneric
and TypeApplications
.
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Data.ByteString.Lazy.Char8
myByteString :: ByteString
myByteString = "my "
-- >>> myByteString <> "stuff"
-- Couldn't match expected type ‘ByteString’ with actual type ‘[Char]’
main :: IO ()
main = pure ()