#836: rebindable if-then-else syntax ----------------------------------+----------------------------------------- Reporter: nibro | Owner: Type: feature request | Status: new Priority: normal | Milestone: _|_ Component: Compiler (Parser) | Version: 6.13 Keywords: | Testcase: N/A Blockedby: | Difficulty: Unknown Os: Unknown/Multiple | Blocking: Architecture: Unknown/Multiple | Failure: None/Unknown ----------------------------------+----------------------------------------- Changes (by vivian):
* cc: haskell.vivian.mcph...@… (added) * failure: => None/Unknown * version: 6.4.2 => 6.13 * component: Compiler => Compiler (Parser) Comment: The do notation is syntactic sugar on top of (>>=) and return. Why not syntactic sugar for "if ... then ... else." With language Extension 'OverlappingInstances' it is possible to have a default definition {{{ class IfThenElse a where if_then_else :: Bool -> a -> a -> a instance IfThenElse a where if_then_else b t f = case b of True -> t False -> f }}} And then monads such as LogicT [http://hackage.haskell.org/package/logict-0.2.1] and other code regions with a requirement for custom ifte can overload their own. -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/836#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler _______________________________________________ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs