Problem with derived instances.
Leon Smith
lps at po.cwru.edu
Fri Jan 10 01:24:55 EST 2003
This code produces "True" with ghc-5.04.2 and ghc-5.02.3. It works as I
would expect it to with ghc-4.08.1. Similarly, the derived instances of Ord
also don't work.
The only time that I've found in my limited expermentation that equality
returns false is:
Str "a" == Str "ab"
best,
leon
> infixr 3 :*
> infixr 2 :+
>
> data RE a = RE a :+ RE a
> | RE a :* RE a
> | Cat [RE a]
> | Star (RE a)
> | Plus (RE a)
> | Opt (RE a)
> | Comp (RE a)
> | Empty
> | Str [a]
> deriving (Show, Eq, Ord)
>
> main = print (Str "ab" == (Str "a" :+ Str "b"))
More information about the Glasgow-haskell-bugs
mailing list