Lennart makes the point that a different generalisation of Simon's
suggestion, namely strict constructors, would be more useful. Perhaps.
A point in favour of my suggestion is that unlifted products have
an easy semantic definition. What, precisely, is the definition of
a constructor strict
What, precisely, is the definition of
a constructor strict in a specified field? In particular, how do
you define it, and implement it, if that field has a functional
type? Remember, in Haskell function types are unlifted, so we
should have (\_ - bottom) = bottom.
Well, if you go for
Phil suggests that we add
newtype T a_1 ... a_k = C t_1 ... t_n
and use that to construct non-lifted ADTs. While this works
well, I'd prefer to have strictness annotations on construtors
instead. Haskell has very few means for making programs
more efficient when you really need
The idea that all ADT's must be `lifted' appears clunkier and clunkier
over time, so I support Simon's suggestion.
Note that Simon's suggestion can be easily generalised. Our current
declaration form is
datatype T a_1 ... a_k = C t_1 ... t_n | ...
Simon suggests we add
Gentle Haskell-1.3 people,
This message argues for a particular approach to abstract data types in Haskell.
The problem
~~~
We have long been a bit unhappy with Haskell's treatment of abstract data types.
It's easy to make a new algebraic data type abstract, just by not exporting its