
11 Oct
2006
11 Oct
'06
6:40 a.m.
ihope
It's possible to make both "infinite list" and "finite list" datatypes:
data Inf a = InfCons a (Inf a) data Fin a = FinCons a !(Fin a) | FinNil
At least, I think the Fin type there has to be finite...
No, your Fin type can also hold infinite values. The strictness annotation on the (Fin a) component merely ensures that the tail exists to one constructor's depth (Head Normal Form). It does not force strictness all the way down (full Normal Form). Regards, Malcolm