#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
----------------------------------+-----------------------------------------
Comment(by vivian):
Great!
What is not yet clear to me (a relative ghc non-cognito), is that the
"overloaded type" of `cond` can be bound to one function:
{{{
cond :: Boot -> t -> t -> t -- standard `case Bool of`
equivalent
cond' :: Bool -> Int -> Char -> Foo -- arbitrary user instantiation
condition :: (Error e, Monad m) -- slightly different type
signature
=> ErrorT e m b -> (b -> ErrorT e m a) -> ErrorT e m a -> Error
T e m a
}}}
(Note there was an error in the previous type signature for the first
argument of condition)
With respect to the pedantics of function names, I think that
`if_then_else` is more indicative (visually and semantically) of the "if
... then ... else ..." construct than `cond`. (I defer to historical
arguments over CamelCase versus under_score versus ifthenelse).
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/836#comment:9>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs