
28 Nov
2010
28 Nov
'10
7:57 p.m.
On 11/28/10 9:59 AM, Jafet wrote:
But GHC does not accept type synonym instances unless they are fully applied.
That's precisely the problem, and why a newtype is used. More than GHC implementation details, there's the deeper problem that allowing general type-level functions causes decidability problems in type checking/inference. Using a newtype with its explicit wrapping and unwrapping solves the problem of inference by, essentially, adding type annotations. Similar tricks are involved in making recursive types work. -- Live well, ~wren