Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Would seq ever be used instead of pseq?

If pseq ensures order of evaluation and seq doesn't, why does seq exist? Is there any time that seq should be used over pseq?

like image 681
Vlad the Impala Avatar asked Sep 15 '11 07:09

Vlad the Impala


1 Answers

It says on the documentation page,

[pseq] restricts the transformations that the compiler can do, and ensures that the user can retain control of the evaluation order

therefore, if all you need to do is ensure strictness so that you don't get an infinite stack, use seq. I don't know of any examples where being able to transform

a `seq` b

into

b `seq` a `seq` b

would help performance though, sorry.

like image 126
gatoatigrado Avatar answered Nov 08 '22 00:11

gatoatigrado