[Haskell-cafe] take the keywords from a string

Jason Dagit dagit at eecs.oregonstate.edu
Sun Jun 18 01:40:59 EDT 2006

On 6/17/06, Sara Kenedy <sarakenedy at gmail.com> wrote:
> When I try function lisOfString as below, it runs forever (non-stop)
> although I have the stop criteria for it ??

The patterns are tested on a 'first come first served' basis.  As your
program executes, it tries the first pattern listed, if it matches
then the right-hand side of the equation is evaluated.  You do have a
stop criteria for both functions but it is not evaluating because the
pattern that comes before it matches.  When using patterns you must
remember to put the most specific patterns first or else they may
never be reached.

I hope that helps,

More information about the Haskell-Cafe mailing list