4 ms·
Every time I try to play with Haskell I give up in just a few days. Too much math! Maybe you don't need a PHD, but from my perspective you do need more than an
by commentzorro 11y ago
Every time I try to play with Haskell I give up in just a few days. Too much math! Maybe you don't need a PHD, but from my perspective you do need more than an undergraduate in Engineering.
So, what's a good purely functional language that's easier to learn than Haskell. One that I can learn more by hacking about than trying to keep so many things juggling about in my memory all at once?
Ideally one that runs native on Windows and Linux and is suitable for web and business apps? So I might actually end up with something I could put in (light) production.
- octatoan 11y agoHave you tried Learn You a Haskell? I think it doesn't need more than a little previous programming experience.
- erokar 11y agoCheck out Elm. Only for Web though.
- kyllo 11y agoMaybe you don't need a PHD, but from my perspective you do need more than an undergraduate in Engineering. You just need a lot of patience. Learning Haskell takes a lot more than a few days. But it's worth it. Haskell is the only industrial-strength purely functional (i.e. referentially transparent) programming language. The other popular functional languages (SML, OCaml, F#, and various Lisp and Scheme dialects) are all impure--they all have type systems that allow side effects anywhere in your code. Haskell does run on Windows, Mac and Linux and is suitable for web and business applications. It has several fully-featured web programming frameworks: https://wiki.haskell.org/Web/Frameworks https://wiki.haskell.org/Web/Frameworks I am using Yesod and I highly recommend it. It's like Ruby on Rails except the compiler automatically typechecks everything when you make a code change and tells you if you messed up. It is virtually impossible to even have a broken link.
- cschneid 11y agoDon't confuse new terminology with math. Programming has lots of terminology, and some of it is backed by mathematically rigorous definitions, but that doesn't require you to know that in order to use them. OO has 'Inheritance', 'Subclassing', 'SOLID', 'Liskov', every design pattern name, 'Object', 'Class', 'Overloading', 'Factory', etc, etc. Haskell has similar words, covering both core concepts, and common patterns of implementation. 'Monoid', 'Monad', 'State', 'Reader', 'Function', 'Lambda', 'Typeclass' are all examples of terminology in Haskell None of those words are inherently more difficult than the OO ones, you're just not familiar with them. The best way to learn Haskell is to follow along with a course that has you do exercises, and actually do the exercises. See the https://github.com/bitemyapp/learnhaskell https://github.com/bitemyapp/learnhaskell course for some class recommendations.
- commentzorro 11y agoNot just terminology. It's more like there's only two levels of Haskell: first it's understandable and I say, "Okay just step by step and I got this. Then all of a sudden we run smack into something like this big wall of WFT: * The infix application function (ma>>=\a->f(a)), commonly called bind, executes the computation ma to expose its effects, calling the resulting value a, and passes that to function f. Evidently, the result of this application (f a) should again be a potentially side-effecting computation; hence, the type signature for bind looks like this: (>>=):: M a -> (a -> M b) -> M b. * The injection function (return a) injects a pure value into a computation. Its type signature is: return :: a -> M a. In practice, each effect usually comes with so-called nonproper morphisms. These domain-specific operations are unique to that effect ... Seriously, how can I hack around and understand this?
- marcosdumay 11y agoOh, God, you just came to the Monad definition... From my experience, it only really falls in place after you write your first or second monad. To learn that you go in that order: 1 - Get used to use the IO monad in do notation. 2 - Learn a couple more monads. I'd recommend State and one of Parsec or Attoparsec. (As a bonus, use a bit of applicative syntax too.) 3 - Get used to write some somewhat complex one liners without the do notation. 4 - Abuse the List monad for practice. 5 - Write your own. All the time, look at the types as much as you need, but do not obsess over them.