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 =
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
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
Don Stewart ha scritto:
[...]
Then there is something I'm missing.
Your code does not compile.
Sure it does:
As Daniel suggested, I'm using an old bytestring version that came with
Debian Etch (GHC 6.8.2).
Thanks Manlio
___
Haskell-Cafe
On Tue, Mar 10, 2009 at 3:28 PM, Manlio Perillo manlio_peri...@libero.itwrote:
This seems impossible, since ByteString data constructor is not available.
You can use view patterns, per
http://www.serpentine.com/blog/2009/01/11/fun-with-haskell-view-patterns/
Hello Manlio,
Wednesday, March 11, 2009, 1:28:13 AM, you wrote:
Using normal String type I can define a pattern like:
But if I want to use ByteString, what should I do?
This seems impossible, since ByteString data constructor is not available.
for numeric types, it works via Num instances.
manlio_perillo:
Hi.
Using normal String type I can define a pattern like:
let foo baz = 777
foo baz
777
But if I want to use ByteString, what should I do?
This seems impossible, since ByteString data constructor is not available.
-XOverloadedStrings
e.g.
{-# LANGUAGE
Don Stewart ha scritto:
manlio_perillo:
Hi.
Using normal String type I can define a pattern like:
let foo baz = 777
foo baz
777
But if I want to use ByteString, what should I do?
This seems impossible, since ByteString data constructor is not available.
-XOverloadedStrings
Perfect,
manlio_perillo:
Don Stewart ha scritto:
manlio_perillo:
Hi.
Using normal String type I can define a pattern like:
let foo baz = 777
foo baz
777
But if I want to use ByteString, what should I do?
This seems impossible, since ByteString data constructor is not available.
Don Stewart ha scritto:
[...]
-XOverloadedStrings
Perfect, thanks.
Is this supported by other Haskell implementations, or planned for Haskell'?
Not as far as I know. It was added to GHC just over 2 years ago,
http://article.gmane.org/gmane.comp.lang.haskell.cvs.all/31022
and isn't
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
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
12 matches
Mail list logo