3 ms·
I love Purescript, but I think in some ways it is even more arcane than Haskell for a beginner. e.g., > :t (+) forall a. Semiring a => a -> a -> a
by mjhoy 9y ago
I love Purescript, but I think in some ways it is even more arcane than Haskell for a beginner.
e.g.,
> :t (+)
forall a. Semiring a => a -> a -> a
> :t (&&)
forall a. HeytingAlgebra a => a -> a -> a
- dualogy 9y agoAgreed on both points, love it and a bit too wicked for new-comers. Elm is perfect there and should find its place into all kinds of educational contexts hopefully. Such a friendly ML language, I secretly call it "the Basic of FP/ML land" (an honour in my book; more modern equivalent might be Python there but you get the idea). Also good that it's missing "advanced" stuff like type-classes, built-in monad/functor/applicative & friends. Good for teaching because students will be compelled to learn to write that themselves from the ground up. It's all lambda calculus under the hood anyway, and thusly representable "hand-made from scratch".
- kccqzy 9y agoBut it requires a different kind of skill altogether. A semiring is a concept in abstract algebra that’s quite independent from general functional programming.
- mjhoy 9y agoThat's kind of my point. Usually when you're just learning "general functional programming", you're thinking about, say, (+) as a function that takes two numbers, and returns a number, because you're at the stage of figuring out how something like fold (+) 0 [1,2,3] works. Introducing "Semiring" as a concept at the same time can be a bit much for a beginner! I do think it's a useful concept, and that Purescript is an excellent, intermediate-level FP language.