Skip to content

Commit fa953ee

Browse files
committed
Add MonadFail instance
In order to build on GHC 8.8.3 (via Stackage snapshot lts-15.8) there needed to be a MonadFail instance for the Parser monad.
1 parent 893d54b commit fa953ee

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Vimus/Command/Parser.hs

+3-1
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,12 @@ instance Applicative Parser where
4040
(<*>) = ap
4141

4242
instance Monad Parser where
43-
fail = parserFail . ParseError
4443
return a = Parser $ \input -> Right (a, input)
4544
p1 >>= p2 = Parser $ \input -> runParser p1 input >>= uncurry (runParser . p2)
4645

46+
instance MonadFail Parser where
47+
fail = parserFail . ParseError
48+
4749
instance Alternative Parser where
4850
empty = parserFail Empty
4951
p1 <|> p2 = Parser $ \input -> case runParser p1 input of

stack.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
resolver: lts-13.12
1+
resolver: lts-15.8

0 commit comments

Comments
 (0)