Thread: How Do We Feel about Haskell?

  1. #1
    Registered User MutantJohn's Avatar
    Join Date
    Feb 2013
    Posts
    2,665

    How Do We Feel about Haskell?

    So, I've had the language Haskell introduced to me and it actually got me to look at a book I found online called, Learn You a Haskell for Great Good.

    I've kind of looked through it and Haskell seems pretty neat. In Node-land, there's a library called Ramda which is a functional one and it's pretty neat and some of the functions seem to borrow concepts such as lenses. This makes Haskell intrigue me.

    What are some of the super cool things that Haskell can do over a language like C++?

  2. #2
    Make Fortran great again
    Join Date
    Sep 2009
    Posts
    1,413
    I am thankful for functional programming languages in the sense that I learned to program because of them (one of AutoCAD's macro languages is Lisp), but other than that I think they're pretty much a trendy/novelty thing. More popular languages (C++, Python) have stolen the useful things from them, e.g. map()/reduce() in Python, lambdas in both, etc.

  3. #3
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    2,158
    Quote Originally Posted by MutantJohn View Post
    So, I've had the language Haskell introduced to me and it actually got me to look at a book I found online called, Learn You a Haskell for Great Good.

    I've kind of looked through it and Haskell seems pretty neat. In Node-land, there's a library called Ramda which is a functional one and it's pretty neat and some of the functions seem to borrow concepts such as lenses. This makes Haskell intrigue me.

    What are some of the super cool things that Haskell can do over a language like C++?
    Though alien, Haskell's syntax is very intuitive. In some ways its syntax is more Pythonic than Python. And the Where clause is very nice indeed, a good match for a lazily evaluated language.

    The popular claim that Haskell has no side effects is but a lie thinly veiled behind monads. Apparently, Monads are so great they cure cancer and can resurrect your dead hamster, but in practice I find them to be only mildly more succinct than more traditional solutions, but a lot stickier.

    There's no support for proper ("nominal") structures. Many people are okay with this, but it's is a big problem for me, since I can't break things down the way I wanna.

    Then there's also the all too common rubbish meme of "If my Haskell program compiles it's almost guaranteed to be correct".

    The Stdlib is rather odd, with type names like Int and Integer. But it's not worse than any other mainstream language.
    Last edited by Yarin; 02-06-2016 at 06:04 PM.

  4. #4
    Registered User MutantJohn's Avatar
    Join Date
    Feb 2013
    Posts
    2,665
    Quote Originally Posted by Epy View Post
    I am thankful for functional programming languages in the sense that I learned to program because of them (one of AutoCAD's macro languages is Lisp), but other than that I think they're pretty much a trendy/novelty thing. More popular languages (C++, Python) have stolen the useful things from them, e.g. map()/reduce() in Python, lambdas in both, etc.
    Hmm.. I'm curious why you say "trendy/novelty thing". I've been looking a bit more through the book and it seems like Haskell tries very hard to keep you away from implementation details.

  5. #5
    Make Fortran great again
    Join Date
    Sep 2009
    Posts
    1,413
    Nothing to do with implementation details, more of it just being popular because it's different. There used to be a site called LangPop that showed Haskell was one of the most discussed languages out there, but the actual usage of it was minimal.

    Always seeing stuff on Slashdot about some great new language, thing is, none of them really do things that much better than anything else. Someone just got bored and decided they wanted to make a new language. Remember Google's Go? That was all the craze for like a year then everyone realized "pfft" and moved on. No one cares about Go anymore.

  6. #6
    Make Fortran great again
    Join Date
    Sep 2009
    Posts
    1,413

  7. #7
    Registered User MutantJohn's Avatar
    Join Date
    Feb 2013
    Posts
    2,665
    Quote Originally Posted by Yarin View Post
    The popular claim that Haskell has no side effects is but a lie thinly veiled behind monads. Apparently, Monads are so great they cure cancer and can resurrect your dead hamster...
    I do get that impression...

    Then there's also the all too common rubbish meme of "If my Haskell program compiles it's almost guaranteed to be correct".
    Again, that's the impression I kind of get too.

    It's kind of braggy in the same way Rust is.

  8. #8
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,613
    lolcode is my favorite toy

  9. #9
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657
    Quote Originally Posted by MutantJohn View Post
    What are some of the super cool things that Haskell can do over a language like C++?
    In my opinion, pattern matching and currying.

    Examples:
    Code:
    (x, y) = (1, 2)
    
    length [] = 0
    length (_ : foo) = 1 + length foo
    //Not limited to : , works for your own constructors too.
    This is something I really want to be able to do in C++!

    Code:
    foo x y = x + y
    foo x //gives you the equivalent of std::bind(foo, x, _1) in a cleaner way
    
    (+42) //gives you a function that adds 42 to its single argument

  10. #10
    Registered User MacNilly's Avatar
    Join Date
    Oct 2005
    Location
    CA, USA
    Posts
    466
    To me, functional languages like Haskell and ML are interesting because they are the closest to a purely mathematical programming language. It's good to see more ideas from these languages making their way into common parlance.

    However, a language like Scheme that guarantees proper tail calls cannot support exceptions because there is no stack in this case... that's also why Java doesn't do tail recursion... Edit: I mean exceptions cannot carry any stack trace information.

    As for side effects, they are a necessary evil. It is good to avoid them, but in some cases this is impossible due to finite resources time and space. Also for things like I/O that are inherently side-effecting. For if we avoid side effects our programs become easier to understand, read, and debug.
    Last edited by MacNilly; 02-10-2016 at 02:43 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Haskell??
    By Annonymous in forum General Discussions
    Replies: 6
    Last Post: 05-21-2012, 05:02 AM
  2. haskell programming?
    By brack in forum Tech Board
    Replies: 3
    Last Post: 11-15-2010, 07:37 AM
  3. modify a haskell program.
    By brack in forum Tech Board
    Replies: 1
    Last Post: 11-11-2010, 06:50 PM
  4. Haskell startup?
    By brack in forum General AI Programming
    Replies: 2
    Last Post: 11-05-2010, 09:34 PM
  5. Haskell equivalent to cboard
    By Shakti in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 12-23-2008, 08:25 AM