Skip to content

Instantly share code, notes, and snippets.

@yangsu
Created April 23, 2013 22:11
Show Gist options
  • Save yangsu/5447857 to your computer and use it in GitHub Desktop.
Save yangsu/5447857 to your computer and use it in GitHub Desktop.
Haskell Do Notation
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