5 ms·
Perl might have a lot of operators but Haskell's ability to define your own operators leads to a ton of operators in the standard library and third party packag
by DasIch 10y ago
Perl might have a lot of operators but Haskell's ability to define your own operators leads to a ton of operators in the standard library and third party packages.
- zzleeper 10y agoThat's one of the things keeping me away from Haskell. It seems that to be proficient I would need to know way more beyond the "standard library", but go into the String vs Text debates, and the huge amounts of common knowledge out there.
- kazagistar 10y agoString is a type alias for a lazy linked list of characters: not very high performance, but easy to work with using all the basic list manipulation tools. Text is a compact and efficient representation, more similar to strings in other languages. As far as learning libraries: its not mandatory and you can code as well as anywhere else without them, but the "language enhancing libraries" are undeniably useful, and can do some incredibly useful things. Monad transformers let you merge computational contexts, Conduit lets you cleanly define stream transformations, Lens lets you manipulate specific aspects of some state in a context, etc.
- klodolph 10y agoI feel your pain. Haskell makes it possible to write very powerful libraries which change how you think about your program, like MTL or conduits, and has APIs like Data.Text which change how you think about string processing. However, the language and community is quite mature. Most of the debates either have answers (use Text instead of String, most of the time) or don't matter to most people (MTL vs transformers or monadLib). In my mind, it's no worse than trying to pick a JavaScript framework. If you're interested, give it a shot some day.
- evincarofautumn 10y agoExcept for Lens, most packages shy away from operator soup. The basic set you need to know to read most Haskell code is quite small, and tied to the core concepts you need to know anyway, such as: Functor (<$>) Applicative (<*>, <*, *>) Monad (>>=, =<<, >=>, <=<) Monoid (<>) Alternative (<|>)
- nv-vn 10y agoAlso ++, $, ., and some others. But yeah, you don't need to know too many to be able to read 90% of Haskell code.
- GlitchMr 10y agoSo does Perl 6 (it may be because initial Perl 6 implementation was made in Haskell).
- ugexe 10y agoLike Perl 6?
- labster 10y agoPerl 6 has a similar ability to define custom operators. In addition to the rich selection of normal operators, there are the meta operators like summation [+] and the bat operator ^..^ and a full range of set operators like ∈.