Module Lib.ForkJoin

Support for ad hoc parallelism in Frege through java's ForkJoin mechanism

Imports

Table of Content

Definitions

par ∷ β → α → α
infixr  2
 a `par` b

Fork evaluation of a and return b.

$| ∷ (β→α) → β → α
infixr  1
 f $| a

Equivalent to

 a `par` f a

Is useful only if f takes a lazy argument, otherwise the thunk will be evaluated right away.

parOp ∷ (β→γ→α) → β → γ → α
   parOp f a b

Equivalent to

 a `par` (b `par` f a b)

The function should be lazy in both arguments.

:| ∷ α → [α] → [α]
infixr  4
 a :| as

Equivalent to

 parOp (:) a as
mapP ∷ (β→α) → [β] → [α]
 mapP f xs

Like map, but applies the function parallel to mapping the rest of the list. It does therefore not work with infinite lists.

Functions and Values by Type

α → [α] → [α]

:|

(β→α) → [β] → [α]

mapP

(β→α) → β → α

$|

β → α → α

par

(β→γ→α) → β → γ → α

parOp

Valid HTML 4.01 Strict