Created
April 23, 2013 22:11
-
-
Save yangsu/5447857 to your computer and use it in GitHub Desktop.
Haskell Do Notation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
crack = do x <- ['a'..'c'] ; y <- ['a'..'c'] ; z <- ['a'..'c'] ; | |
let { password = [x, y, z] } ; | |
if attempt password | |
then return (password, True) | |
else return (password, False) | |
attempt pw = if pw == "cab" then True else False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment