Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
db56cf4e
Commit
db56cf4e
authored
Aug 14, 2017
by
Andrey Mokhov
Browse files
Provide more useful ToPredicate instances
parent
0ef2b1f8
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Hadrian/Expression.hs
View file @
db56cf4e
...
...
@@ -75,14 +75,14 @@ p ? e = do
bool
<-
toPredicate
p
if
bool
then
e
else
mempty
instance
(
c
~
c'
,
b
~
b'
)
=>
ToPredicate
(
Predicate
c
b
)
c'
b'
where
toPredicate
=
id
instance
ToPredicate
Bool
c
b
where
toPredicate
=
pure
instance
ToPredicate
(
Action
Bool
)
c
b
where
toPredicate
=
expr
instance
ToPredicate
p
c
b
=>
ToPredicate
(
Action
p
)
c
b
where
toPredicate
=
toPredicate
.
expr
instance
(
c
~
c'
,
b
~
b'
,
ToPredicate
p
c'
b'
)
=>
ToPredicate
(
Expr
c
b
p
)
c'
b'
where
toPredicate
p
=
toPredicate
=<<
p
-- | Interpret a given expression according to the given 'Target'.
interpret
::
Target
c
b
->
Expr
c
b
a
->
Action
a
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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