News for hackers. Stuff that matters.
Re:Total Functional Programming [pdf] by wyager on Wednesday October 05, 2016 @04:05PM (#12647311)
> You would of course need to factor out the outer-loop to do this

What are you referring to? Data/codata checking works with local type inference.

Re:Total Functional Programming [pdf] by mkehrt on Wednesday October 05, 2016 @08:21PM (#12649143)
Essentially, to get a nonterminating, program, your top level function needs to take a piece of codata to corecurse over to run indefinitely. Since you can't actually write a program that takes no arguments that produces an infinite piece of data, all programs must terminate.
Re:Total Functional Programming [pdf] by wyager on Thursday October 06, 2016 @02:43PM (#12654945)
>Since you can't actually write a program that takes no arguments that produces an infinite piece of data

Huh?

    inf = Cons 1 inf
Re:Total Functional Programming [pdf] by mkehrt on Thursday October 06, 2016 @06:00PM (#12656491)
Hm, you may be right. I though that was going to violate:

> Each recursive function call must be on a syntactic subcomponent of its formal parameter.

But it doesn't. But you can't actually use that to get a nonterminating program, because you can't recurse over it:

> Ordinary recursion is not legal over codata, because it might not terminate.