
Thanks for the typo. Yes, for Haskell guys 'guard' is fine; but the main audience for the paper is non-haskell folk, so we have to spell out the defn. S | -----Original Message----- | From: glasgow-haskell-users-bounces@haskell.org [mailto:glasgow-haskell-users- | bounces@haskell.org] On Behalf Of Remi Turk | Sent: 06 February 2005 20:25 | To: glasgow-haskell-users@haskell.org | Subject: STM check/MonadPlus | | Hi, | | I have a few questions about the `check' function from | Control.Concurrent.STM. | | First, in the paper its definition contains a (type) error: | | check :: Bool -> STM a | check True = return () | check False = retry | | in fptools, however, it is defined as follows: | | check :: Bool -> STM a | check b = if b then return undefined else retry | | As we already have guard, and STM is an instance of MonadPlus, | I wonder why such a simple utility function as check is wanted | at all. | | guard :: (MonadPlus m) => Bool -> m () | guard True = return () | guard False = mzero | | Greetings, | Remi | | -- | Nobody can be exactly like me. Even I have trouble doing it. | _______________________________________________ | Glasgow-haskell-users mailing list | Glasgow-haskell-users@haskell.org | http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

On Mon, Feb 07, 2005 at 10:53:36AM -0000, Simon Peyton-Jones wrote:
Thanks for the typo. Yes, for Haskell guys 'guard' is fine; but the main audience for the paper is non-haskell folk, so we have to spell out the defn.
S
Hm, what about calling it `guard' and adding a footnote saying that in Haskell its type is actually more general? It smells a bit like namespace pollution to me right now. (Says he who hasn't even compiled 6.3 since STM got in ;) Groetjes, Remi
participants (2)
-
Remi Turk
-
Simon Peyton-Jones