[Haskell-cafe] Language semantics
jcast at ou.edu
Fri Jun 29 18:24:15 EDT 2007
On Friday 29 June 2007, Andrew Coppin wrote:
> Jon Cast wrote:
> > On Wednesday 27 June 2007, Andrew Coppin wrote:
> >> Wow, wait a sec - case expressions are allowed to have guards too??
> > Yes. I guess I assumed you knew that, sorry.
> > The only syntactic (or semantic) difference between function equations
> > and case expressions (aside from the fact that case expressions require
> > you to tuple up the values you're pattern-matching on) is the fact that
> > case expressions use -> where function bindings use =. Other than that,
> > the two forms are exactly equivalent.
> I knew they were nearly identical. I didn't realise that they *were*
> Hmm, I tried to find out 1 thing and actually found out 2 things! :-D
> I wonder what the layout for that is... something like this?
> case foo of
> | guard1 -> ...
> | guard2 -> ...
> | guard3 -> ...
> | guard4 -> ...
More information about the Haskell-Cafe