2 % (c) The GRASP/AQUA Project, Glasgow University, 1995-1996
4 \section[Parallel]{Parallel Constructs}
7 module Parallel (par, seq -- re-exported
8 #if defined(__GRANSIM__)
9 , parGlobal, parLocal, parAt, parAtForNow
13 import ConcBase ( par )
15 #if defined(__GRANSIM__)
17 {-# INLINE parGlobal #-}
18 parGlobal :: Int -> Int -> Int -> Int -> a -> b -> b
19 parLocal :: Int -> Int -> Int -> Int -> a -> b -> b
20 parAt :: Int -> Int -> Int -> Int -> a -> b -> c -> c
21 parAtForNow :: Int -> Int -> Int -> Int -> a -> b -> c -> c
23 parGlobal (I# w) (I# g) (I# s) (I# p) x y = case (parGlobal# x w g s p y) of { 0# -> parError; _ -> y }
24 parLocal (I# w) (I# g) (I# s) (I# p) x y = case (parLocal# x w g s p y) of { 0# -> parError; _ -> y }
26 parAt (I# w) (I# g) (I# s) (I# p) v x y = case (parAt# x v w g s p y) of { 0# -> parError; _ -> y }
27 parAtForNow (I# w) (I# g) (I# s) (I# p) v x y = case (parAtForNow# x v w g s p y) of { 0# -> parError; _ -> y }
31 -- Maybe parIO and the like could be added here later.