Newtype wrappers

Stephen Paul Weber singpolyma at
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

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]


	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 <> 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: <>

More information about the Glasgow-haskell-users mailing list