Zulip Chat Archive

Stream: Is there code for X?

Topic: lazy sequences


Sacha Ayoun (Aug 22 2025 at 22:04):

Hello, is there an equivalent of OCaml’s Seq.t?
I could easily just re-implement it but I’m surprised not to find an equivalent, I’m new to Lean, I expect I don’t understand some documentation somewhere
At first I thought lists could be lazy already, a la Haskell, but then I learned that Lean is strict

Aaron Liu (Aug 22 2025 at 22:12):

Try docs#MLList

Sacha Ayoun (Aug 22 2025 at 22:19):

That feels somewhat much heavier than what I need, I’d like to see how performant I can get this code (and if I can get it on par with the OCaml impl).
Though I guess some of the variants will just be unused and that’s fine

Sacha Ayoun (Aug 22 2025 at 22:21):

I’ll try it, thank you @Aaron Liu

Kim Morrison (Aug 22 2025 at 23:02):

Yes, MLList is not very performant. :-(


Last updated: Dec 20 2025 at 21:32 UTC