[GHC] #11650: Documentation does not mention that default definitions for Alternative(some, many) can easily blow up
GHC
ghc-devs at haskell.org
Fri Feb 26 14:53:25 UTC 2016
#11650: Documentation does not mention that default definitions for
Alternative(some, many) can easily blow up
-------------------------------------+-------------------------------------
Reporter: bgamari | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Documentation | Version: 7.10.3
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by RyanGlScott):
We could also fix this issue by making the `Applicative` instance less
strict:
{{{#!hs
instance Applicative U1 where
U1 <*> _ = U1
}}}
I'm not sure which is the best approach. `Proxy` (which is isomorphic to
`U1`) doesn't pattern-match on its arguments in ''any'' of its instances,
which allows it to short-circuit in a lot of possibly diverging
computations. Then again, `Proxy` doesn't have an
`Alternative`/`MonadPlus` instance for some reason...
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11650#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list