Some comments:

- You can run your code thru HLint, here it gives me 27 suggestions.

- Why don't you derive the Show instance for RE instead of writing it
by yourself?

- Note that

  do x
     do y
        ...

is the same as

  do x
     y
     ...

- You can parametrize RE as

  data RE s p = Epsilon
              | Leaf Char s p
              | Selection (RE s p) (RE s p)
              | Sequence  (RE s p) (RE s p)
              | Kleene    (RE s p)
              | Optional  (RE s p)
              | End s
              deriving (Show)

  type RE1 = RE () ()
  type RE2 = RE State ()
  type RE3 = RE State Pos


Cheers! =)

-- 
Felipe.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to