Changes between Version 1 and Version 2 of StandardClasses
 Timestamp:
 Sep 3, 2006 2:49:00 PM (10 years ago)
Legend:
 Unmodified
 Added
 Removed
 Modified

StandardClasses
v1 v2 12 12 * The default definitions of `enum`* would make more sense if `toEnum` and `fromEnum` used `Integer` instead of `Int`. 13 13 14 == The Functor class == 15 Proposal: 16 * Add instances for `((>) a)`, `((,) a)` and `Either a`. 17 14 18 == The Monad class == 15 19 Issues: 16 20 * Monads are really functors, but programmers can't always assume that `fmap` is defined for them, and so must use `liftM` instead. 17 21 Similarly, code parameterized by `Functor` cannot be used with monads. 22 * The `fail` method was added to the class in Haskell 98 to implement pattern match failure in `do` expressions. 23 However the assumption that errors are strings can be problematic (e.g. cf the `Error` class in [http://www.haskell.org/ghc/docs/6.4latest/html/libraries/mtl/ControlMonadError.html Control.Monad.Error], or for internationalization). 18 24 19 25 Proposals: 26 * Add instance for `((>) a)`. 20 27 * Make `Functor` a superclass of `Monad`. 21 28 This would impose an extra burden on those who just want to define a `Monad`.