[Hat] Qualified variable in pattern: T.mkRoot

Thomas Davie tatd2 at kent.ac.uk
Wed Jun 29 09:40:30 EDT 2005


>
> The 0 is the tightness of binding, not the arity.
>
> pat^0 -> pat^1 -> ... -> pat^10 -> gcon apat_1
>
> Such contructs look a bit odd at the top level, but I think
>
>     foo x = f y
>         where Just y = x
>
> is more common. Even more so is
>
>     [ x | Just x <- xs]

Okay, I see that, now I'm slightly intrigued -- if, as before, we have

Just foo = undefined

Doesn't that have 2 effects:
foo = undefined
undefined :: Maybe a

and thus cause a type error (i.e. undefined has become too specific)?

Bob


More information about the Hat mailing list