[erlang-questions] Erlang again!

Masklinn masklinn@REDACTED
Thu Jul 22 19:08:47 CEST 2010


On 2010-07-22, at 18:55 , Boris Mühmer wrote:
> 
> Is such a solution plain bad, or just a newbie mistake/error?

I would say it's a not-very-useful reimplementation of something which already exists in the stdlib. It's mostly a question of not knowing your toolbox, so I wouldn't say it's bad, but it definitely isn't optimum.

On the other hand, the Erlang toolbox isn't very discoverable/searchable so you have to read it all (several time if needed).

That's a big advantage of haskell and its strong typing: hoogle[0] lets you search functions by type. In this case you can search for [a] -> [b] -> [c] (a function taking a list of 'a's, a list of 'b's and returning a list of 'c's) and the first result is zipWith[1].

It's not perfect though, as a search for [Int] -> [Int] -> [Int] demonstrates[2] with zipWith ending up on the third page of the results, and the return of such functions as `drop :: Int -> [a] -> [a]`.

[0] http://haskell.org/hoogle/
[1] http://haskell.org/hoogle/?q=[a]%20->%20[b]%20->%20[c]
[2] http://haskell.org/hoogle/?hoogle=[Int]+->+[Int]+->+[Int]&start=41#more


More information about the erlang-questions mailing list