[Haskell-cafe] Implicit newtype unwrapping

Matthew Pocock matthew.pocock at ncl.ac.uk
Thu Dec 3 06:13:09 EST 2009

Perhaps what you are looking for is a more powerful "defining" semantics?

newtype MyFoo = Foo defining (Foo(..)) -- all class instances that Foo has
are delegated through from MyFoo


> not sure if this is what you are thinking at, but everytime I wrap a
> type Foo in a newtype MyFoo to define my own instances (or just for more
> expressiveness code), I wish I had a way to tell the compiler:
> „Please define function myfoo to be the same as foo, with all occurences
> of Foo in its type signature replaced by MyFoo.“
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20091203/45136fc6/attachment.html

More information about the Haskell-Cafe mailing list