Re:Effectful Haskell: IO, Monads, Functors
by MuffinFlavored on Saturday August 29, 2015 @03:52PM
(#10141164)
As a novice programmer used to node.js, C, etc., how the hell is one supposed to get started with Haskell? I've tried multiple tutorials, read many articles like this, and still can't follow along.
It makes me wonder who ends up using this language for anything serious in even the slightest time crunch...
Re:Effectful Haskell: IO, Monads, Functors
by tinco on Saturday August 29, 2015 @05:04PM
(#10141344)
The big not-so-secret secret is that you don't have to understand much of Monad theory to enjoy Haskell. If you want to use Haskell as a nice functional language with a great typesystem.
As spopejoy says, Monad is a typeclass, that means every Monad is a type on itself. So you you can get by just learning every monad for its use without ever needing to know the theory that binds them.
The Maybe Monad is just an option type, the list monad is just a list and the IO monad is just a sequence of operations that gets returned to the runtime from the main function. Who cares that they all share a typeclass?
Re:Effectful Haskell: IO, Monads, Functors
by lockfinn on Saturday August 29, 2015 @04:32PM
(#10141264)
I recommend this, https://github.com/bitemyapp/learnhaskell
Re:Effectful Haskell: IO, Monads, Functors
by dllthomas on Saturday August 29, 2015 @05:05PM
(#10141347)
I've heard good things about the opening sections of the WikiBook - and if it is hard to understand, ask questions and then improve it! :)
Re:Effectful Haskell: IO, Monads, Functors
by RehnoLindeque on Saturday August 29, 2015 @10:11PM
(#10142035)
Try elm (http://elm-lang.org/) first; it doesn't mention Functor, Applicative, Monoid, Monad anywhere.
You might come back to Haskell later and it won't seem like such a big deal. (I use Haskell for serious work and love that a quick patch doesn't suddenly start breaking things in 10 other places - it's a real time-saver!)
Likewise with "Mappable": in most other languages, `map` is only an operation on lists or list-like things. `ask` in `Reader` is implementable with Functor only: by what tortured metaphor does `Mappable` help you understand that? Also it sounds like Java. Yuck :)
Names are a bikeshed. Monad, Applicative and Functor have the advantage of at least being rigorous, I can't see any other name being better.