2006/10/10, David Roundy <[EMAIL PROTECTED]>:
>declassify :: Secret a -> String -> Maybe a
>declassify (Secret pw x) pw' | pw' == pw = Just x
>declassify (Secret _ _) _ = Nothing
Why does this works? "Yet Another Haskell Tutorial" teaches that pattern matching occurs at one stage and guard processing at other, and that there's no back (page 94).
--
Felipe.
_______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
