
manlio_perillo:
Don Stewart ha scritto:
manlio_perillo:
Don Stewart ha scritto:
[...] {-# LANGUAGE OverloadedStrings #-}
import qualified Data.ByteString.Char8 as C
isMatch :: C.ByteString -> Bool isMatch "match" = True isMatch _ = False
main = print . map isMatch . C.lines =<< C.getContents
What is the reason why instance declarations for IsString class are not defined for available ByteStrings?
I need to define it by myself.
They're exported from Data.ByteString.Char8
Then there is something I'm missing. Your code does not compile.
Sure it does: $ ghci A.hs GHCi, version 6.10.1: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer ... linking ... done. Loading package base ... linking ... done. [1 of 1] Compiling Main ( A.hs, interpreted ) Ok, modules loaded: Main. *Main> :t main main :: IO () You should give any error message, and the steps you took that lead to the error when making a bug report. -- Don