[Haskell-cafe] ByteString in patterns

Daniel Fischer daniel.is.fischer at web.de
Wed Mar 11 12:29:22 EDT 2009


Am Mittwoch, 11. März 2009 17:09 schrieb 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.

A recent enough bytestring package.
Compiles and works with 0.9.1.4

> Your code does not compile.
>
>
>
> Thanks  Manlio Perillo
>

Cheers,
Daniel


More information about the Haskell-Cafe mailing list