[Haskell-cafe] The (>|) function in Control.Parallel.Strategies

Wei Hu wei.hoo at gmail.com
Sat Oct 31 23:08:00 EDT 2009


The documentation of (>|) says that it "evaluates the first argument
before the second". The function is defined as
(http://www.haskell.org/ghc/docs/6.10-latest/html/libraries/parallel/src/Control-Parallel-Strategies.html#%3E|):

(>|) :: Done -> Done -> Done
{-# INLINE (>|) #-}
(>|) = Prelude.seq

I'm curious why it's defined as Prelude.seq, instead of pseq? The
semantics seems to require pseq here. I also found the following
comment that doesn't make sense to me:

The operators >| and >|| are alternative names for `seq` and `par`.
With the introduction of a Prelude function `seq` separating the Prelude
function from the Strategy function becomes a pain. The notation also matches
the notation for strategic function application.


More information about the Haskell-Cafe mailing list