All pastes #336317 Raw Edit

Mine

public text v1 · immutable
·published 2007-02-01 23:22 UTC
rendered paste body
data List a = Nil
            | Cons a (List a)

listLength Nil = 0
listLength (Cons x xs) = 1 + (listLength xs)

-------------------------------------------------------------------------------------

*Blah> listLength(Cons 1)

<interactive>:1:11:
    Couldn't match `List a' against `t -> t1'
      Expected type: List a
      Inferred type: t -> t1
      Expected type: List a
      Inferred type: List a1 -> List a1
    Probable cause: `Cons' is applied to too few arguments in the call (Cons 1)