For today’s project I decided to dip my toe into Haskell, a functional language that Elm borrows a lot of syntax from. I did the traditional programmer thing and wrote a hello world program. I think it’s a little ironic to do a “hello world” message from a functional language since printing is a side effect but none the less that’s what I opted for. I played around a little and this is the program I ended up with at the end:
reversePrint = putStrLn . reverse
main = (reversePrint "Hello World")
The output is dlroW olleH in case you were wondering. The function composition operator (the dot between putStrLn and reverse) was new to me. It’s an interesting concept. Essentially you can use it to turn function pipelines into functions.
That about sums it up for today. I’ll probably be playing with Haskell a bit more here on future posts. See you then,
-Aaron