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

Happiest programmers?

Name: faggot 2011-07-26 15:24

Name: Anonymous 2011-07-28 8:24

Whats wrong with haskell? lol I find it very a compact and concise useful language. There's a few great compilers out there for haskell too, such that one needn't worry about optimisation. For example,

reverse      :: [Int] -> [Int]
reverse   []  = []
reverse x:xs  = reverse xs ++ [x]

is replaced in the compiler by some function like:

reverse2            :: [Int] -> [Int] -> [Int]
reverse2 [] ys       = ys
reverse2 x:xs ys     = reverse2 xs x:ys

useReverse     :: [Int] -> [Int]
useReverse xs   = reverse2 xs []

since the useReverse is much faster (because ++ takes more steps).

So one really doesn't have to worry about memory usage and such in haskell, which is why it's so awesome! :)

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