[Haskell-cafe] ANN: To Kata Haskellen Evangelion
jo at durchholz.org
Thu Aug 1 05:50:17 UTC 2019
Am 31.07.19 um 22:33 schrieb Vanessa McHale:
> I'm not convinced that nontermination would be worth redesigning the
> language - the research implementations seem rough.
That all implementations are rough does not imply whether it's possible
to do a smooth one or not, just that nobody has a working idea yet.
E.g. it is possible that people try to leverage existing work (90% may
try to use type system extensions, for example) and find that it is too
unwieldy because the existing mechanisms aren't really suitable (e.g. it
may be that type systems in general are not very well-suited to
expressing termination properties, leading us to the observation that
"research implementations seem rough").
> (Moreover, one of the advantages of laziness is precisely that one can
> write a function like take that works on both streams and lists).
That's exactly the relevant scenario.
Strictly speaking, all functions that iterate over all elements of the
list (say, takes its length) are buggy: They will not terminate if given
an infinite list.
The bad thing here is that in Haskell, generators and lists are exactly
the same, so there is no way to make a non-buggy version of such a function.
(AFAIK, which doesn't say much because I haven't looked deeply enough
into Haskell in the last decade to be sure about this anymore. The
language did evolve after all.)
More information about the Haskell-Cafe