Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Cabal-syntax/src/Distribution/Fields/LexerMonad.hs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ instance Applicative Lex where
(<*>) = ap

instance Monad Lex where
return = pure
(>>=) = thenLex

data LexResult a = LexResult {-# UNPACK #-} !LexState a
Expand Down
1 change: 0 additions & 1 deletion Cabal-syntax/src/Distribution/Fields/ParseResult.hs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ instance Applicative (ParseResult src) where
{-# INLINE (<*) #-}

instance Monad (ParseResult src) where
return = pure
(>>) = (*>)

m >>= k = PR $ \ !s fp failure success ->
Expand Down
2 changes: 0 additions & 2 deletions Cabal-syntax/src/Distribution/Parsec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,6 @@ instance Alternative ParsecParser where
{-# INLINE some #-}

instance Monad ParsecParser where
return = pure

m >>= k = PP $ \v -> unPP m v >>= \x -> unPP (k x) v
{-# INLINE (>>=) #-}
(>>) = (*>)
Expand Down
2 changes: 0 additions & 2 deletions Cabal-syntax/src/Distribution/Types/Condition.hs
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ instance Applicative Condition where
(<*>) = ap

instance Monad Condition where
return = pure

-- Terminating cases
(>>=) (Lit x) _ = Lit x
(>>=) (Var x) f = f x
Expand Down
1 change: 0 additions & 1 deletion Cabal/src/Distribution/Backpack/ReadyComponent.hs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ instance Applicative InstM where
in (f' x', s'')

instance Monad InstM where
return = pure
InstM m >>= f = InstM $ \s ->
let (x, s') = m s
in runInstM (f x) s'
Expand Down
1 change: 0 additions & 1 deletion Cabal/src/Distribution/Backpack/UnifyM.hs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ instance Applicative (UnifyM s) where
Just x'' -> return (Just (f'' x''))

instance Monad (UnifyM s) where
return = pure
UnifyM m >>= f = UnifyM $ \r -> do
x <- m r
case x of
Expand Down
2 changes: 0 additions & 2 deletions Cabal/src/Distribution/Simple/BuildTarget.hs
Original file line number Diff line number Diff line change
Expand Up @@ -908,8 +908,6 @@ instance Applicative Match where
(<*>) = ap

instance Monad Match where
return = pure

NoMatch d ms >>= _ = NoMatch d ms
ExactMatch d xs >>= f =
addDepth d $
Expand Down
1 change: 0 additions & 1 deletion Cabal/src/Distribution/Utils/LogProgress.hs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ instance Applicative LogProgress where
LogProgress f <*> LogProgress x = LogProgress $ \r -> f r `ap` x r

instance Monad LogProgress where
return = pure
LogProgress m >>= f = LogProgress $ \r -> m r >>= \x -> unLogProgress (f x) r

-- | Run 'LogProgress', outputting traces according to 'Verbosity',
Expand Down
1 change: 0 additions & 1 deletion Cabal/src/Distribution/Utils/Progress.hs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ foldProgress step err done = fold
fold (Done r) = done r

instance Monad (Progress step fail) where
return = pure
p >>= f = foldProgress Step Fail f p

instance Applicative (Progress step fail) where
Expand Down
1 change: 0 additions & 1 deletion Cabal/src/Distribution/ZinzaPrelude.hs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ instance Applicative Writer where
(<*>) = ap

instance Monad Writer where
return = pure
m >>= k = W $ \s1 ->
let (s2, x) = unW m s1
in unW (k x) s2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ foldProgress step' fail' done' = fold
fold (Done r) = done' r

instance Monad (Progress step fail) where
return = pure
p >>= f = foldProgress Step Fail f p

instance MonadFail (Progress step String) where
Expand Down
1 change: 0 additions & 1 deletion cabal-install/src/Distribution/Client/Init/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,6 @@ instance Applicative PurePrompt where
Right (a, s'') -> Right (f a, s'')

instance Monad PurePrompt where
return = pure
PurePrompt a >>= k = PurePrompt $ \s -> case a s of
Left e -> Left e
Right (a', s') -> runPromptState (k a') s'
Expand Down
1 change: 0 additions & 1 deletion cabal-install/src/Distribution/Client/TargetSelector.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2365,7 +2365,6 @@ instance Alternative Match where
(<|>) = matchPlus

instance Monad Match where
return = pure
NoMatch d ms >>= _ = NoMatch d ms
Match m d xs >>= f =
-- To understand this, it needs to be read in context with the
Expand Down
1 change: 0 additions & 1 deletion cabal-install/src/Distribution/Deprecated/ParseUtils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ instance Applicative ParseResult where
(<*>) = ap

instance Monad ParseResult where
return = pure
ParseFailed err >>= _ = ParseFailed err
ParseOk ws x >>= f = case f x of
ParseFailed err -> ParseFailed err
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ instance Applicative ProjectParseResult where
(<*>) = ap

instance Monad ProjectParseResult where
return = pure
ProjectParseFailed err >>= _ = ProjectParseFailed err
ProjectParseOk ws x >>= f = case f x of
ProjectParseFailed err -> ProjectParseFailed err
Expand Down
Loading