On 12/30/07, Cristian Baboi <[EMAIL PROTECTED]> wrote:
>
> Thank you.
>
> data Something = This | S Something
>
> ppp :: Something -> String
>
> ppp This = ""
> ppp (S x) = 'S':(ppp x)
>
>
> How can I prevent one to pass 'let x = S x in x' to ppp ?
{-# LANGUAGE GADTs, EmptyDataDecls #-}
data Z
data S a
data Something a where
This :: Something Z
S :: Something a -> Something (S a)
ppp :: Something a -> String
ppp This = ""
ppp (S x) = 'S' : ppp x
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe