Time cost of Haskell `seq` operator

前端 未结 5 1162
逝去的感伤
逝去的感伤 2021-02-13 22:32

This FAQ says that

The seq operator is

seq :: a -> b -> b

x seq y will evaluate x, enough to chec

5条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-13 23:24

    I believe x will only be evaluated once (and the result retained for future use, as is typical for lazy operations). That behavior is what makes seq useful.

提交回复
热议问题