top | item 33569111

(no title)

mdm12 | 3 years ago

In my perusals into the Haskell ecosystem, discovering Hoogle[1] was definitely a revelation on the power of a strongly-typed language. Sometimes, you know the _shape_ of the thing you are looking for, but not the name. The ability to search a repository of packages for all functions conforming to a certain type signature (e.g., (a -> Bool) -> [a] -> [a]) is a superpower.

[1] https://hoogle.haskell.org/

discuss

order

DonaldPShimoda|3 years ago

A minor nitpick: the crucial element here is that Haskell is statically typed. "Strong" typing is not well-defined, and even in contexts where that word is appropriate, it only exists as a relative descriptor (not in a vacuum).

But I agree with your takeaway. Hoogle is one of the coolest development tools I've ever used, and I desperately wish every other statically typed language had their own Hoogle.

msla|3 years ago

"Strong" as a descriptor makes more sense if you see a type as a kind of contract: You agree that you will only perform these operations on this value, and the language agrees that all of those operations will be well-defined. "Strength" is how difficult it is to disregard those contracts and peel back the abstraction they enforce to get at some underlying representation, possibly all the way down to where "Bits Is Bits" and everything is permitted. You'll notice that this makes Python's type system stronger than the one C++ has, once you get over the idea that Python's types attach to values, not variables.