Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is Haskell so large? [closed]

Tags:

syntax

haskell

I'm new to Haskell and so far quite enjoying it. One thing that strikes me is that it seems quite large, with many syntactical constructs and libraries that define functions for just about everything. For example, Data.Map defines almost 100 functions. Data.Set also defines many functions, as does Data.List, which also provides alot of the same functionality as Data.Set.

I have my beginner's opinion on why this might be (provide functions for all common patterns, reduce noise), but I'm interested to hear some veteran opinions on the topic.

like image 383
Scott Avatar asked Apr 15 '12 18:04

Scott


1 Answers

I would say that the size of the Haskell language is somewhere in the middle (larger than Lisp, smaller than C++). Although since all the syntactic sugar has well defined translations down to Haskell Core (which has about 7 elements), its a bit hard to distinguish between library and language.

Its true that the libraries do contain a lot of small functions, basically because Haskell programmers have found patterns that kept turning up and then put them into code. As a learner I often had the feeling "there ought to be a function to do that" and then discovering that there was. You learn them in the same way as they were written: write the function yourself, and then find it in the documentation for some library a few days later.

like image 51
Paul Johnson Avatar answered Oct 14 '22 00:10

Paul Johnson