Pete Kazmier - 2007-04-16

I'm trying to test out the new tdfa backend.  I've installed the latest base and tfda packages from darcs.  Here is my sample program:

------------------------------------------------------------
module Main where

import Text.Regex.TDFA

main =  print $ tokens "this is a test"

tokens :: String -> [String]
tokens text = text =~ "[a-z]+"

------------------------------------------------------------
Here is the compilation error:

kaz@coco:~/work/src/haskell$ ghc --make -O2 regex.hs
[1 of 1] Compiling Main             ( regex.hs, regex.o )

regex.hs:8:14:
    No instance for (RegexContext Regex String [String])
      arising from use of `=~' at regex.hs:8:14-29
    Possible fix:
      add an instance declaration for
      (RegexContext Regex String [String])
    In the expression: text =~ "[a-z]+"
    In the definition of `tokens': tokens text = text =~ "[a-z]+"

------------------------------------------------------------
Here is my current GHC package list:

kaz@coco:~/work/src/haskell$ ghc-pkg list
/usr/lib/ghc-6.6/package.conf:
    Cabal-1.1.6, QuickCheck-1.0, base-2.0, (ghc-6.6),
    haskell-src-exts-0.2, haskell98-1.0, mtl-1.0, parsec-2.0,
    readline-1.0, regex-base-0.71, regex-base-0.91, regex-compat-0.71,
    regex-posix-0.71, regex-tdfa-0.92, rts-1.0, stm-2.0,
    template-haskell-2.0, unix-1.0