Our teacher in Programming Languages gave us a topic to report about a particular programming language that is totally new to us. I and my partner, somehow, got excited to the idea of learning a new language even though it is a challenge to our part. Well, in the end we were told to report about Haskell, a functional programming language developed in the '80s.
And so i looked at the library for books i could use as reference and gladly found a sole copy. Well it's okay. I had one, at least. And so my sleepless nights began on that day. i spent hours trying to learn the language. It was hard, I admit. The mathematical symbols make me sick. But i know i have to do a little push on my self not to stop. And so i did. I continued reading the book until i finally understood "some" strengths of the language. Let me show you some syntax.
--this is a factorial function
factorial :: Int ->Int
factorial x | x>0 = product [1..x]
|x==0 = 1
|otherwise = x
T.T
For me, it's such an accomplishment to make that code. It is simple yet it gave me some sense of reward after those hard nights. I know it isn't sophisticated. I still have lots to learn-- and read!
Well if you are interested to learn about the language, try visiting this link.:)
No comments:
Post a Comment