14 Aug 2007

n00b Thoughts on Haskell

Posted by elfasbrynja

I toyed with the idea of learning a functional programming language before. It’s good to see that toying often eventually leads to doing, as has been the case with Swedish. Some things that eventually prompted me to pursue FP more were an excellent article on the subject and personal experience with tedious maintenance of state in an ugly ‘monster class’ Python program I wrote. I thought that perhaps obsession with remaining functional and encapsulating state as much as possible—via monads, the mysterious components with which Haskell compilers reproduce—is perhaps a good idea. I still love object-oriented programming, especially in Python, because it is so easy, but FP makes anything imperative look like troglodyte crap now.

I have done some exercises and read parts of Yet Another Haskell Tutorial, among a few others. At this point, I have only recently learned a new distinction between ‘classes’ (like ‘interfaces’ in Java) and ‘types’ (more or less like ‘classes’ in other languages), and am barely qualified to comment on the matter, but that never stopped me before. Haskell is interesting in that, without monads, no program written in Haskell would ever ‘run’. Pure Haskell, like a system of equations, cannot ‘run’. It simply is. That sounds like ‘crystallogy weenie and pipe-stress freak’ substance until you consider that functional programming languages such as Haskell are inherently thread-safe and allow foolproof test units. Overall, it seems to be a very rich, powerful and concise language. The well-known quicksort implementation is a good example:

quicksort :: Ord a => [a] -> [a]
quicksort  []           =  []
quicksort (x:xs)        =  quicksort [y | y <- xs, y<x]
                        ++ [x]
                        ++ quicksort [y | y <- xs, y>=x]

Five lines, including (an automatically deducible) declaration. It could probably fit into three. Haskell pwns n00bs.

I remember that object-oriented programming used to be considered an academic toy, used only by ivory-tower chair-polishers who drink liberal tea and eat quiche. Since then, OO has not only come into mainstream acceptance, it has also become a meaningless buzzword fit for the meager intellects of PHBs. I wonder whether Haskell and other FP systems will meet the same fate one day. In any case, I will remain faithful to Haskell, so no one can claim that I jumped on the bandwagon and avoid the turgidity usually associated with bandwagons (e.g., XML).

Well, second post in and I’m quite ready for Hank Dagny to step in and decry the liberal decadence of ‘lazy evaluation’.

Subscribe to Comments

No Responses to “n00b Thoughts on Haskell”

  1. Hi there, I enjoy reading through your article post. I like to write a little comment
    to support you.



  2. I absolutely love your website.. Great colors & theme.
    Did you make this website yourself? Please reply back as I’m hoping to
    create my very own blog and would like to know where you got this from or just
    what the theme is called. Many thanks!


    quest bars nutrition

  3. Hey there! I simply would like to offer you a big thumbs up for the great
    info you’ve got here on this post. I’ll be returning to your blog for more soon.


    plenty of fish dating site of free dating

  4. This paragraph is really a nice one it assists new the web
    users, who are wishing for blogging.


    Plenty of fish dating site Of free dating

  5. I have read so many articles or reviews on the topic of the
    blogger lovers however this post is in fact a fastidious paragraph,
    keep it up.


    plenty of fish Dating site Of free dating

  6. you are in reality a excellent webmaster. The website loading
    velocity is incredible. It seems that you are doing
    any distinctive trick. In addition, The contents are masterwork.
    you’ve done a fantastic task on this matter!


    kroger Digital Coupons

  7. If you desire to improve your familiarity simply
    keep visiting this web page and be updated with the newest news update posted here.


    kroger coupons

  8. Helpful info. Fortunate me I discovered your website unintentionally,
    and I am shocked why this coincidence did not happened earlier!
    I bookmarked it.


    payday loans no credit check Los Angeles, California

  9. Hi my name is Sandra and I just wanted to drop you a quick note here instead of calling you. I discovered your Dum Pendebat Filius » Blog Archive » n00b Thoughts on Haskell page and noticed you could have a lot more hits. I have found that the key to running a popular website is making sure the visitors you are getting are interested in your niche. There is a company that you can get targeted visitors from and they let you try their service for free for 7 days. I managed to get over 300 targeted visitors to day to my website. Visit them here: http://ittsy.com/it/3x



  10. obviously like your web-site however you need to check
    the spelling on quite a few of your posts. Several of them are rife with
    spelling issues and I find it very troublesome to tell the reality however I
    will definitely come back again.



  11. My partner and I stumbled over here coming from a different page and thought
    I may as well check things out. I like what I see so now
    i am following you. Look forward to looking into your web page repeatedly.



  12. Hello there! This is my first visit to your blog!
    We are a collection of volunteers and starting a new initiative in a community in the same
    niche. Your blog provided us useful information to work on. You have
    done a extraordinary job!



  13. Fine way of describing, and fastidious article to take data about my presentation subject, which
    i am going to convey in academy.


    kroger feedback

  14. I think the article is very helpful for us,it has solved our problem,thanks!


    hard disk data recovery software free download xp

  15. Good day! This post could not be written any better! Reading
    through this post reminds me of my good old room mate!

    He always kept chatting about this. I will forward this page to him.
    Fairly certain he will have a good read. Thank you for sharing!


    appdata minecraft

  16. Fantastic site. Lots of helpful information here. I’m sending it to some buddies
    ans also sharing in delicious. And naturally, thanks for your effort!



  • Browse

  • Older DPF Archives

  • Post Categories

  • Twitter @dumpendebat

    • #Ethiopia army seeks to rescue Gambella's abducted children https://t.co/HPP2fgNg7X
    • #Ethiopia attack: 200 people dead, 100 children missing https://t.co/o4C02FXeKd #SouthSudan
    • #Philippines candidate Duterte condemned over rape comments https://t.co/CT5fWS0Bw3
    • Ethiopian forces hunt #SouthSudan gunmen who killed 208 in raid https://t.co/rCSUD1cWXU #Ethiopia
    • Egyptians Denounce President Sisi in Biggest Rally in 2 Years https://t.co/3fFzfYy1c5 #Egypt
    • #SaudiArabia Warns of Economic Fallout if Congress Passes 9/11 Bill https://t.co/kENSz4FtC9 #KSA #WarOnTerror
    • Japanese McDonald's workers demonstrating for a living wage, 15 April 2016. #Tokyo #Japan #fightfor15 #solidarity https://t.co/tJxXEoz8a6
    • #Ghana president makes no-panic plea over terror threat memo https://t.co/6RTZF5DU1a
    • Le président malien IBK se remet de l'opération d'une tumeur en France https://t.co/n45kINsUqr #Mali
    • Op-ed: Average North Koreans will be hit hardest by sanctions https://t.co/TjdXJoFYpp #NorthKorea
  • Meta