ApplicativeDo in MonadComprehensions
It appears that a MonadComp (even one that is "Applicative only") is not transformed appropriately in the presence of ApplicativeDo.
{-# LANGUAGE MonadComprehensions #-}
{-# LANGUAGE ApplicativeDo #-}
value1 = [ f a b c | a <- ma, b <- mb, c <- mc ]
value2 = do { a <- ma; b <- mb; c <- mc; return (f a b c) }
value3 = f <$> ma <*> mb <*> mc
value1 should desugar to value2 via monadcomp and to value3 via appdo. Yet I observe very bad performance in some specific instance (due to a slower Monad instance) when using value1, where value2 and value3 have good performance. I have not looked at desuraged/core dumps but the observation seems clear.
Tested on ghc-8.0.2 only.
Trac metadata
| Trac field | Value |
|---|---|
| Version | 8.0.2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture |