[Haskell-cafe] Re: Tips of Conditional Expression
topekarem at gmail.com
Fri Feb 22 09:22:51 EST 2008
Thanks. My question is whether it can call a function (say map) previously
defined elsewhere in the program. Same goes for filter.
On Fri, Feb 22, 2008 at 6:04 AM, Christian Maeder <Christian.Maeder at dfki.de>
> TOPE KAREM wrote:
> > I know the following:
> >  That the general form of conditional expression is: if
> > *Boolean_expression* then /exp1/ else /exp2
> > / That a conditional expression must always have both a then and an
> > else expression.
> >  That both /exp1/ and /exp2/ must have the same type, which is the
> > type of the entire conditional expression.
> >  That /exp1/ must be <true-value> and /exp2/ must be <false-value>
> > Reference: Discrete Mathematics Using Computer by John O'Donnell and et
> > al. (Second Edition)
> > My question: Is it possible that exp1 and exp 2 be different function
> > calls of another functions (separately) elsewhere within the same
> > Note: My Boolean_expression is Boolean
> > My /exp1/ is a function call elsewhere within the same program
> > (more like a subroutine)
> > My /exp2/ is another function call also elsewhere within the
> > same program.
> I'm not sure what you're asking, but exp1 and exp2 may have (the same)
> function type:
> if <cond> then map else filter :: (Bool -> Bool) -> [Bool] -> [Bool]
> HTH Christian
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe