On Thu, 29 Jul 2004, Bjorn Bringert wrote:
(snip)
> You could use asTypeOf from the Prelude:
>
>   let foo = maxBound `asTypeOf` x

Ah. I should re-read the Prelude every couple of months. (-: Thanks!

> Also, Hugs and GHC both support an extension which lets you put type
> annotations in patterns:
>
> showThings (x::c) =
>           let foo = maxBound :: c
>            in (show x, show foo)

That's cool. Is it something that's likely to be in the next standard,
then? Or does it make more sense to have the type variables in the
function's type signature be in scope in the function definition itself?

-- Mark
_______________________________________________
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to