4 ms·
Retarded? Really? I guess that you don't know that generics in Java were derived from Haskell type classes and designed by the same man who added monads to Ha
by brl 18y ago
Retarded? Really?
I guess that you don't know that generics in Java were derived from Haskell type classes and designed by the same man who added monads to Haskell.
- fhars 18y agoRetarded, indeed. Almost half of that code is a redundant repetition of type information.
- brl 18y agoIt's not redundant information and in Haskell you write exactly the same thing. doSomething :: HashSet Int -> HashSet Int
- wernerv0nbraun 18y agono again. in the case of a haskell analogue to HashSet (Set, Map, etc), you could use type inference due to haskell's type classes. go look at the definitions of these libraries, they use them.
- eru 18y agoHe had to work in the constraints of the language..
- jganetsk 18y agoAnd that man would absolutely love it if Java had a type system closer to Hindley-Milner with type inference. But, given the reality of Java, generics become undesirably verbose.
- brl 18y agoA typical well written Haskell program has more type annotation than the same program written in Java. Not only that but because of type classes those annotations are even more verbose than an equivalent declaration in Java. It's true that you can omit most of the type signatures and let the compiler figure it out but nobody really writes Haskell code that way if they want it to be comprehensible by human readers.
- silentbicycle 18y agoI've wondered about this. It seems common for OCaml code to only have the type annotations where necessary, but it's usually included in Haskell by convention.