[Haskell-beginners] Typeclasses vs. Data

David Place d at vidplace.com
Thu Jul 21 02:49:46 CEST 2011


On Jul 20, 2011, at 7:41 PM, Thomas wrote:

> It's pretty clear that in the mutual recursion between "eval" and "eval_begin" the parameter "k" is "growing" from "a" to "BeginCont a" and so on. But how to resolve that?

Progress, though?  You're getting a different error message.

>     Couldn't match type `a' with `BeginCont a'
>       `a' is a rigid type variable bound by
>           the type signature for
>             eval_begin :: Continuation a => Int -> a -> Int
>           at ../Desktop/devl/hs/TryPQ.hs:16:1
>     In the return type of a call of `BeginCont'
>     In the expression: (BeginCont k (n - 1))
>     In the second argument of `eval', namely
>       `(if (n < 0) then k else (BeginCont k (n - 1)))'






More information about the Beginners mailing list