Newtype wrappers
Stephen Paul Weber
singpolyma at singpolyma.net
Mon Jan 14 19:30:09 CET 2013
Somebody claiming to be Simon Peyton-Jones wrote:
>I'd like to propose a way to "promote" newtypes over their enclosing type.
>Here's the writeup
> http://hackage.haskell.org/trac/ghc/wiki/NewtypeWrappers
The high-level idea, I love. I always wondered about `map MkAge blah`.
>Any comments? Below is the problem statement, taken from the above page.
-1 to the unsoundness, but as you say, this is an existing problem.
Also, instead of:
newtype wrap somefun :: [Int] -> [Age]
foo = somefun [12,14]
Maybe:
foo = ([12, 14] :: newtype wrap [Age])
I don't know how feasible this syntax is, but I like it a lot better, and it
makes it more clear (to me) that this is purely type-level syntax.
--
Stephen Paul Weber, @singpolyma
See <http://singpolyma.net> for how I prefer to be contacted
edition right joseph
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20130114/6f5883a0/attachment.pgp>
More information about the Glasgow-haskell-users
mailing list