Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

The list monad is awesome

Name: Anonymous 2011-10-17 14:44

sqrtM x = [sqrt x, -sqrt x]

addOne x = return $ x + 1

f x = do y <- sqrtM x
         z <- addOne y
         sqrtM z

*Main> f 0.5
[1.3065629648763766,-1.3065629648763766,0.5411961001461969,-0.5411961001461969]

Name: Anonymous 2011-10-18 11:16

<-- ultimate dubs
12 is dubs in base 11, which is dubs in base 10, which is dubs in base 9, which is dubs in base 8, which is dubs in base 7, which is dubs in base 6, which is dubs in base 5, which is dubs in base 4, which is dubs in base 3, which is dubs in binary.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List