Cale Gibbard wrote:
> Why not just:
> 
> secret :: a -> Classification String a
> secret = Classification "xyzzy"
> 
> The password string isn't part of the type, it doesn't even
> necessarily exist at compile time. You might have just got confused
> between type and data constructors for a moment.
> 

But now I want to be able to process the secret monadically:

mySecret =
  secret "Jimmy Hoffa is buried under the 50-yd line in the Meadowlands"

do secretData <- mySecret
   return (length secretData)

How do I define "return" so that it will put the password back, and how
do I define "(>>=)" so that the password won't be accessible within the
do-block?
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to