News for hackers. Stuff that matters.
Re:A Pythonista's Review of Haskell by elbear on Friday January 31, 2020 @12:56PM (#22203784)
One thing that could help you understand is that Haskell has many types which act kind of like containers of primitive values.

One example is `Maybe a` which has a value `Just a`. `a` can have any type, including `String`, `Int`, `Float`, etc. But a function that accepts a `String` can't take `Just String` as an argument.

This is the problem that `Functor` solves. It applies your function to the value inside the container.

`Applicative` applies a function that takes two arguments to the values inside two containers. For example, you have the function: `<> :: String -> String -> String` and you apply it to two `Just String` values, like this:

    ghci> liftA2 (<>) (Just "hello") (Just " world")
    Just "hello world"

There are no comments on this comment yet.