2008/4/23 Martijn Schrage <[EMAIL PROTECTED]>:
>  It depends a bit on what you want to use these lists for, but the following
> encoding works for your examples and doesn't need the type class.
>
> data E
>  data O
>
>  type Even = (E,O)
>  type Odd  = (O,E)

That's a nice little trick!  I like how you achieve type signatures
relating two distinct types just by sticking them in a tuple.  :)

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

Reply via email to