Prelude> (map manyA)
<interactive>:5:1:
No instance for (Show ([Int] -> [[Char]]))
arising from a use of `print'
Possible fix:
add an instance declaration for (Show ([Int] -> [[Char]]))
In a stmt of an interactive GHCi command: print it
Error, a function from a list of ints to a list of strings cannot be printed
Haskell errors are hard, maybe the hardest part of Haskell
All my previous languages had duck typing
Haskell is type-driven
Almost every Haskell error is a type Error, Haskellers are proud of this
@boatSoap Is there any specific part of Haskell or FP you are interested in?
Prelude> let last' = head . reverse
Prelude> last' [1,2,3]
3
@boatSoap there are no Objects in Haskell, Objects means to be Noun-centric
The error your code triggers is kind of verbose:
Prelude> 1.(+1)
<interactive>:26:1:
No instance for (Num (b0 -> c0)) arising from the literal `1'
Possible fix: add an instance declaration for (Num (b0 -> c0))
In the first argument of `(.)', namely `1'
In the expression: 1 . (+ 1)
In an equation for `it': it = 1 . (+ 1)
<interactive>:26:4:
No instance for (Num b0) arising from a use of `+'
The type variable `b0' is ambiguous
Possible fix: add a type signature that fixes these type variable(s)
Note: there are several potential instances:
You can actually define . (DOT) if you want, it is easy
And I consider myself a beginner in Haskell
so I am just scratching the surface
@boatSoap as in Math, it is all about understanding it, playing with it and gaining familiarity with it.
@boatSoap I wish you good luck with it, and of course you are welcome to post your programs to CodeReview for feedback