docs icon indicating copy to clipboard operation
docs copied to clipboard

Infinite list gives syntax error

Open tejasbubane opened this issue 4 years ago • 2 comments

PSCi, version 0.13.6
Type :? for help

> double = [x*2 | x <- [1,2,3]]
> squares = [x * x | x <- [1..]]
Unexpected token '=' at line 1, column 9
> a = [1..]
Unexpected token '=' at line 1, column 3

Normal list double works. But squares with infinite list does not.

Not sure if this is an issue with the docs or the runtime itself.

tejasbubane avatar Jun 11 '20 18:06 tejasbubane

@tejasbubane The evaluation model of hamler is strict, so the infinite list cannot work.

emqplus avatar Jun 12 '20 02:06 emqplus

@tejasbubane The evaluation model of hamler is strict, so the infinite list cannot work.

@emqplus Pardon my ignorance of Erlang, but this project looks interesting so I wanted to ask out of curiosity: is it possible to implement lazy evaluation and do you have any plans to support it in some form in the future?

spavikevik avatar Jun 12 '20 08:06 spavikevik