Futures in Haskell

后端 未结 3 2149

Does Haskell have an equivalent of Alice\'s ability to bind a variable to a future?

val a = spawn foo;

where foo is some function.

I kn

3条回答
  •  心在旅途
    2021-02-07 21:30

    You can use par from Control.Parallel as in

    a `par` f a b c
    where
      a = foo
    

    This is a hint to the runtime that a could be evaluated in another thread.

提交回复
热议问题