
On Dec 17, 2007 8:04 AM, Nicholls, Mark
No that's fine....its all as clear as mud!......but that's not your fault.
To recap...
"type" introduces a synonym for another type, no new type is created....it's for readabilities sake.
"Newtype" introduces an isomorphic copy of an existing type...but doesn't copy it's type class membership...the types are disjoint/distinct but isomorphic (thus only 1 constructor param).
"data" introduces a new type, and defines a composition of existing types to create a new one based on "->" and "(".
"class" introduces a constraint that any types declaring themselves to be a member of this class...that functions must exist to satisfy the constraint.
I'm sure that's wrong, but it's a good as I've got at the moment.
And to a degree it's all upside down....what Haskell thinks are types...I think are "singnatures" and what Haskell thinks is a type "class" I think of as a type.....it's not going to be easy.
I think you've got it pretty well! The one quibble I would have with your recap is that I'm not sure what you mean by saying that "data" creates a new type 'based on "->" and "("'. Other than that it seems pretty spot-on. =) -Brent