logoalt Hacker News

itishappylast Monday at 11:51 PM1 replyview on HN

I would argue that imperative programming is the only one with a concept of linear time.

Here's a functional example:

    map (*3) [0,1,2,3,4,5,6,7,8,9]
Are those multiplications run in sequence or parallel?

Here's a fancier functional one:

    getUser = User <$> getName <*> getEmail <*> getStartDate
What order are the fields fetched?

If you answered "unspecified" then you're right! A compiler could parallelize either of these expressions!


Replies

1718627440last Tuesday at 11:53 AM

> A compiler could parallelize either of these expressions!

But that's also true for imperative languages.

show 1 reply