[Haskell-cafe] a monad for secret information

Felipe Almeida Lessa felipe.lessa at gmail.com
Tue Oct 10 20:47:59 EDT 2006


2006/10/10, David Roundy <droundy at darcs.net>:
>
>
> >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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20061010/148132f9/attachment.htm


More information about the Haskell-Cafe mailing list