On Mar 8, 2004, at 12:55, Ben Rudiak-Gould wrote:

This would work, but I will have to write [] part for each option.
Generics approach is overkill but looks much neater when used.
But thanks for suggestion anyway, it is always good to learn yet
another way of doing things.

Sincerely,
Vadim

Try this instead:
        doSomething $ option "none" [fltflag | Filter fltflag <- opts]

        option :: a -> [a] -> a
        option def []  = def
        option def [x] = x
        option def _   = error "Only one of each option allowed"


-- "La perfection est atteinte non quand il ne reste rien a ajouter, mais quand il ne reste rien a enlever." (Antoine de Saint-Exupery)


Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to