[Haskell-cafe] Lazy series [was : Preventing sharing]

Tom Ellis tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk
Sat Jan 9 18:02:14 UTC 2016


On Sat, Jan 09, 2016 at 06:29:05PM +0100, Jerzy Karczmarczuk wrote:
> Tom Ellis wrote :
> >consider a lazy language, Haskell--,/which doesn't allow recursive bindings of non-function types./   In Haskell-- you
> >*cannot*  write
> >
> >     exps = 1 + integral exps
> >
> >but you have to write
> >
> >     exps = I.fix (\e -> 1 + integral e)
> >
> >So we see that the nice syntax "exps = 1 + integral exps" is not due to
> >laziness (since Haskell-- is lazy, but you cannot write that).
> 
> Tom, construct such a language, and I might believe you.

By the way, for explicitness, here is my construction of such a language. 
Take any strict language and extend the rules for let rec such that

    let rec v = ... v ...

means

    let v = fix (\v' -> ... v' ...)

for any v that has lazy type (function types, explicit thunks etc.), where
fix is its associated fixpoint operator.

Then one can happily write

    let rec exps = 1 + integral exps

because it means exactly Oleg's

    let exps = fix (\e -> 1 + integral e)

Do you say (a) this language can't exist for some reason or (b) it is
somehow "not strict"?

Tom



More information about the Haskell-Cafe mailing list