[Haskell-cafe] TT check

Isaac Dupree isaacdupree at charter.net
Sun Jul 1 14:16:33 EDT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Andrew Coppin wrote:
>  decode (c:cs) = case c of
>    'X' -> X
>    '*' -> let (e0,cs0) = decode cs; (e1,cs1) = decode cs0 in (e0 `apply`
> e1, cs1)
> 
> The letter X stands for the following combinator:
> 
>  X = \x -> xSK
>  K = \xy -> x
>  S = \fgx -> fx(gx)
> 
> Assuming my Haskell code is correct, ...  Does anybody have a way
> to check?

Whether X is a data constructor or a function \x -> x S K, it isn't the
same type as the tuple that the other case alternative returns, so you
have a type error.  If you had working haskell code, you could check if
it worked by trying running the haskell code! (ghci/hugs can be
convenient, if nothing else)


Isaac
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGh++BHgcxvIWYTTURAg+QAKCYOZuV3/TwC4Ye8kMbSVy7D+UOJwCfadGG
IJmQx8GfrXOiIADwO8np8og=
=hfNa
-----END PGP SIGNATURE-----


More information about the Haskell-Cafe mailing list