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

Yet Another Functional Programming Thread

Name: Anonymous 2011-10-10 18:42

I must say after trying the pure part of F#, I am really starting to like functional programming. If You had to use a completely pure functional programming language, which one would it be?

Here is Sieve of Eratosthenes (I know it's pig disgusting):


(* eratosthenes: the sieve of eratosthenes for |N \ {0,1} *)
let eratosthenes n =
    let list = 2::[3 .. 2 .. n]
    let rec sieve list acc =
        match (list,acc) with
        | ([],acc) -> []
        | (a::b,acc) -> a::(sieve (List.filter(fun x -> x % a <> 0) b) (a + 1))
    sieve list (List.head list) ;;

Name: Anonymous 2011-10-10 19:30

Let's do the Haskell!
Swing your penis around and slap some more!
Yes! Do the Haskell!
Slap your penis gently!
Jerk once!
jerk twice!
Slap your penis!
Praise the ribbon!
Do the Haskell!

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