#113 closed modification (superseded)
Joined-Up Classes
Reported by: | Owned by: | none | |
---|---|---|---|
Priority: | normal | Milestone: | ⊥ |
Version: | Keywords: | ||
Cc: | David Luposchainsky | Meta Owner: | |
State: | Section: | Predefined Types/Classes | |
Related Tickets: | #146 |
Description
Currently the Monad class is not a subclass of Functor. It should be.
Proposal:
- Add this:
class (Functor f) => Idiom f where -- or Applicative return :: a -> f a ap :: f (a -> b) -> f a -> f b (>>) :: f a -> f b -> f b fa >> fb = ap (fmap (const id) fa) fb
(See also Control.Applicative in GHC HEAD.)
- Replace existing Monad class with this:
class (Idiom m) => Monad m where (>>=) :: m a -> (a -> m b) -> m b fail :: String -> m a fail = error
- Remove existing "ap", generalise and remove redundant Prelude functions as appropriate.
Change History (4)
comment:1 Changed 4 years ago by
Milestone: | → ⊥ |
---|
comment:2 Changed 4 years ago by
Priority: | major → normal |
---|
Set default priority (as this confuses Trac otherwise)
comment:3 Changed 4 years ago by
Cc: | David Luposchainsky added |
---|---|
Resolution: | → superseded |
Section: | → Predefined Types/Classes |
Status: | new → closed |
This is effectively superseded by #146 (AMP)
comment:4 Changed 4 years ago by
Related Tickets: | → #146 |
---|
Note: See
TracTickets for help on using
tickets.
moving non-milestoned many year old legacy tickets out of the way