Newtype wrappers
Roman Cheplyaka
roma at ro-che.info
Mon Jan 14 23:57:34 CET 2013
* Johan Tibell <johan.tibell at gmail.com> [2013-01-14 14:55:31-0800]
> On Mon, Jan 14, 2013 at 2:33 PM, Roman Cheplyaka <roma at ro-che.info> wrote:
> > * 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.
>
> I'm completely lost. What is Simon's proposal?
It's described here:
http://hackage.haskell.org/trac/ghc/wiki/NewtypeWrappers
Roman
More information about the Glasgow-haskell-users
mailing list