Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
f913c358
Commit
f913c358
authored
Jan 11, 2015
by
Andrey Mokhov
Browse files
Add an infix version of when (<?>).
parent
9fbf3c8c
Changes
1
Show whitespace changes
Inline
Side-by-side
src/Oracles/Flag.hs
View file @
f913c358
...
@@ -4,7 +4,7 @@ module Oracles.Flag (
...
@@ -4,7 +4,7 @@ module Oracles.Flag (
module
Control
.
Monad
,
module
Control
.
Monad
,
module
Prelude
,
module
Prelude
,
Flag
(
..
),
Flag
(
..
),
test
,
when
,
unless
,
not
,
(
&&
),
(
||
)
test
,
when
,
unless
,
not
,
(
&&
),
(
||
)
,
(
<?>
)
)
where
)
where
import
Control.Monad
hiding
(
when
,
unless
)
import
Control.Monad
hiding
(
when
,
unless
)
...
@@ -60,6 +60,10 @@ unless x act = do
...
@@ -60,6 +60,10 @@ unless x act = do
bool
<-
toCondition
x
bool
<-
toCondition
x
if
bool
then
mempty
else
act
if
bool
then
mempty
else
act
-- Infix version of when
(
<?>
)
::
(
ToCondition
a
,
Monoid
m
)
=>
a
->
Action
m
->
Action
m
(
<?>
)
=
when
class
Not
a
where
class
Not
a
where
type
NotResult
a
type
NotResult
a
not
::
a
->
NotResult
a
not
::
a
->
NotResult
a
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment