proposal: add 'unsafeCoerce'

Taral taralx at gmail.com
Mon Nov 20 18:46:50 EST 2006


On 11/20/06, Malcolm Wallace <Malcolm.Wallace at cs.york.ac.uk> wrote:
>     newtype Wrapper a = Wrap a
>     convert :: [a] -> [Wrapper a]
>     convert xs = map Wrap xs

Interesting! Looks like the compiler lacks rules for optimizing "map id" &c.\

Your coercion does assume that the underlying runtime doesn't have
some kind of type-tag implementation of type classes.

-- 
Taral <taralx at gmail.com>
"You can't prove anything."
    -- Gödel's Incompetence Theorem


More information about the Libraries mailing list