r/programming • • May 08 '15

Five programming problems every Software Engineer should be able to solve in less than 1 hour

https://blog.svpino.com/2015/05/07/five-programming-problems-every-software-engineer-should-be-able-to-solve-in-less-than-1-hour
2.5k Upvotes

2.1k comments sorted by

View all comments

Show parent comments

38

u/eagle23 May 08 '15

You are right, they aren't. Haskell is (for the most part, there are exceptions) purely functional and all data structures immutable and thus no point in conventional for loops. Instead Haskell users employ folds, maps and recursive functions. /u/spacelibby wrote a recursive function to emulate a for loop so as to try and hack one in.

1

u/Isvara May 08 '15

What are the exceptions?

1

u/Gloomzy May 08 '15

IO, for example

1

u/Isvara May 08 '15

The IO monad is entirely functional, no? I thought that was the point of it.

→ More replies (3)