Według liczby ćwiczeń (w tym Real World Haskell) można, za pomocą ghci wykonaj następujące czynnościWszystkie mecze regex w Haskell
ghci > :m Text.Regex.Posix
ghci > "foo foo foo" =~ "foo" :: [String]
["foo","foo","foo"]
Jednak gdy próbuję to, że daje
No instance for (RegexContext Regex [Char] [String])
arising from a use of `=~'
Possible fix:
add an instance declaration for
(RegexContext Regex [Char] [String])
In the expression: "abc" =~ "ab" :: [String]
In an equation for `it': it = "abc" =~ "ab" :: [String]
Jaki jest prawidłowy sposób uzyskania listy wszystkich meczów w haskell?
możliwym duplikatu [ "= ~ "raise" Brak wystąpienia dla (RegexContext Regex \ [Char \] \ [String \]) "] (http://stackoverflow.com/questions/7636447/raise-no-instance-for-regexcontext-regex-char- string) – ehird