[Haskell-beginners] Looking for more information about Pattern Matching

Mike Meyer mwm at mired.org
Fri Apr 29 18:43:51 CEST 2011


On Fri, 29 Apr 2011 03:27:48 +0200
Daniel Fischer <daniel.is.fischer at googlemail.com> wrote:
> On Friday 29 April 2011 02:35:13, Graham Hopper wrote:
> Basically, a pattern is
[...]
> Or
> 
> - a constructor application, (Con arg1 arg2), (x:xs), (a,b,c,d), ((:) x xs)
[...]
> Also there are 
[...]

I've been wondering about this case. Since : is "just another
function", then if things were consistent, I ought to be able to use
other functions in constructor applications. But my attempts to do so
always seem to result in syntax errors.

So my question is - what are the rules for constructor applications?
Is the list above complete? Are there just a few more? Is there some
rule to determine which functions are ok in patterns and which aren't?

     Thanks,
     <mike
-- 
Mike Meyer <mwm at mired.org>		http://www.mired.org/consulting.html
Independent Software developer/SCM consultant, email for more information.

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org



More information about the Beginners mailing list