turn off lazy evaluation in haskell

前端 未结 7 2044
长发绾君心
长发绾君心 2020-12-14 19:03

Is it possible to turn off lazy evaluation in Haskell?

Is there a specific compiler flag of library to facilitate this?

I wanted to try something new with

7条回答
  •  猫巷女王i
    2020-12-14 19:06

    There's a variant of Haskell called pH (http://csg.csail.mit.edu/projects/languages/ph.shtml) which uses eager evaluation while still providing non-strict semantics. The Haskell Report is careful to say that it's a non-strict language. Laziness is the obvious way to describe and, apparently, to implement non-strictness.

    So, if your question is "Can we use a different evaluation system while maintaining non-strict semantics", you could look at pH. If your question is "Is there a version of Haskell which shares the surface syntax but is strict by default", I think it's covered by other answers.

提交回复
热议问题