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

Halp /prog/ :(

Name: Anonymous 2010-04-22 21:19

Well my professor is doing a chapter over functional languages and he decided he wanted us to try something new. He wants us to program a couple things up in haskell.

I don't know shit about haskell and I've never even touched a functional language, but he expects us to know everything about them for some reason.

does /prog/ know anything helpful about haskell? :(

Name: Anonymous 2010-04-23 3:25

>>7
slow factorial is slow:
*Main> length . show $ floop 30000
121288
(5.58 secs, 794481812 bytes)


compare to this:
*Factorial> length . show $ factorial 30000
121288
(0.25 secs, 13860712 bytes)


or even this:
Prelude Data.List> let fact = foldl' (*) 1 . enumFromTo 2
(0.00 secs, 0 bytes)
Prelude Data.List> length . show $ fact 30000
(0.77 secs, 786578628 bytes)

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