> par2 :: (a -> b -> c) -> a -> b -> c
> > > par2 f x y =
> > >    f x (par x y) 

Here is the dual: 'par' implemented in terms of parallel application:

    a `par` b = par2 (\x y-> y) a b

> ($!)    :: (a -> b) -> a -> b
> f $! x  = x `seq` f x
> 
> It's terseness vs. maximum composability. I don't even want to think
> about implementing seq in terms of $!, makes my brain twist.

It's not so difficult.  (And you may see some similarity with the above
defn of par.)

    a `seq` b = (\x y-> y) $! a b

Regards,
    Malcolm
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to