Re: ADTs in Haskell

1993-10-04 Thread Lennart Augustsson
> 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 f

Re: ADTs in Haskell

1993-10-04 Thread wadler
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 in

Re: ADTs in Haskell

1993-10-04 Thread Lennart Augustsson
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 it,