Newtype wrappers

Roman Cheplyaka roma at ro-che.info
Mon Jan 14 23:33:18 CET 2013


* Johan Tibell <johan.tibell at gmail.com> [2013-01-14 14:29:57-0800]
> Let me rephrase: how will Simon's proposed "data constructors are in
> scope" mechanism work? For example, will
> 
>     let xs :: Map = ...
>     in map MyNewtype xs
> 
> behave differently if the constructors of Map are in scope or not?

Coercion is never implicit. In Simon's original proposal, for example,
you need to define coercion functions using a special syntax.

So this code will always work in the same, traditional way.

Roman



More information about the Glasgow-haskell-users mailing list