Subscribed unsubscribe Subscribe Subscribe

-XOverloadedStrings

Haskell
  • support for bytestring literals (use -XOverloadedStrings)
bytestring 0.9.0.4 - fa.haskell | Google グループ

main = print ("abcdef" :: ByteString)

bytestring 0.9.0.4 - fa.haskell | Google グループ

いいじゃない。でも、リテラルだけらしい。

Prelude Data.ByteString.Lazy.Char8> "maoe" :: ByteString 
Chunk "maoe" Empty
Prelude Data.ByteString.Lazy.Char8> "" :: ByteString 
Empty
Prelude Data.ByteString.Lazy.Char8> [] :: ByteString 

<interactive>:1:0:
    Couldn't match expected type `ByteString'
           against inferred type `[a]'
    In the expression: [] :: ByteString
    In the definition of `it': it = [] :: ByteString
Prelude Data.ByteString.Lazy.Char8> 'm':'a':'o':'e':[] :: ByteString 

<interactive>:1:0:
    Couldn't match expected type `ByteString'
           against inferred type `[Char]'
    In the expression: 'm' : 'a' : 'o' : 'e' : [] :: ByteString
    In the definition of `it':
        it = 'm' : 'a' : 'o' : 'e' : [] :: ByteString