Skip to content

ApplicativeDo failed to desugar last line with pure $ <expr>

{-# LANGUAGE ApplicativeDo #-}
f m = do
  x <- m 1
  y <- m 2
  return $ x + y

f should have type (Applicative f, Num a, Num b) => (a -> f b) -> f b but ghc considers f a monad

maybe similar with #11607 (closed)

Trac metadata
Trac field Value
Version 8.0.1-rc2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information