Jeon-Young Kang writes:
> For pattern matching.. I implemented like this.
>
> compareName a (Person name age)
> | (a == name) = age
>
> but, I got stuck how to apply pattern matching for the two lists.
> i.e., both names and persons are lists.
>
> I really appreciate your advice..
Something like this works:
map age $ filter (\ p -> (name p) `elem` names) persons
/M
--
Magnus Therning OpenPGP: 0x927912051716CE39
email: magnus@therning.org jabber: magnus@therning.org
twitter: magthe http://therning.org/magnus
Finagle's Fifth Law:
Always draw your curves, then plot your readings.
_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners