[commit: ghc] wip/nfs-locking: Add an infix version of when (<?>). (f913c35)

git at git.haskell.org git at git.haskell.org
Thu Oct 26 23:03:44 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/nfs-locking
Link       : http://ghc.haskell.org/trac/ghc/changeset/f913c3580b486bf0c0aaf42fdc5090668cb63ab2/ghc

>---------------------------------------------------------------

commit f913c3580b486bf0c0aaf42fdc5090668cb63ab2
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Sun Jan 11 15:15:29 2015 +0000

    Add an infix version of when (<?>).


>---------------------------------------------------------------

f913c3580b486bf0c0aaf42fdc5090668cb63ab2
 src/Oracles/Flag.hs | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/Oracles/Flag.hs b/src/Oracles/Flag.hs
index 354b1d7..946c4fb 100644
--- a/src/Oracles/Flag.hs
+++ b/src/Oracles/Flag.hs
@@ -4,7 +4,7 @@ module Oracles.Flag (
     module Control.Monad,
     module Prelude,
     Flag (..), 
-    test, when, unless, not, (&&), (||)
+    test, when, unless, not, (&&), (||), (<?>)
     ) where
 
 import Control.Monad hiding (when, unless)
@@ -60,6 +60,10 @@ unless x act = do
     bool <- toCondition x
     if bool then mempty else act
 
+-- Infix version of when
+(<?>) :: (ToCondition a, Monoid m) => a -> Action m -> Action m
+(<?>) = when
+
 class Not a where
     type NotResult a
     not :: a -> NotResult a



More information about the ghc-commits mailing list