elbenshira
Joined 17 years ago
Joined 17 years ago
What's the problem? Fund managers—who are in a position to understand the risks more than your everyday investor—can decide if they want buy these bonds or not, just like any other public corporate bond.
let prefix = connectWords "Hello "
world = prefix "world"
bob = prefix "bob"
in ...
`world` is "Hello world", and `bob` is "Hello bob". That is the power of currying. A maybe more useful example is specifying the mapping function in `List.map` without supplying the list to map over. This allows you to use the same map with multiple lists. - When two equivalent anonymous functions can be extracted out?
- When a library method already exists for an expression?
- When you fail to match every possible result in a case statement?Elm's latest blog post said it really well:
> Compilers should be assistants, not adversaries. A compiler should not just detect bugs, it should then help you understand why there is a bug.
But I wished there was a bigger push from the top, from Rich himself, on "first-classing" typed Clojure. Aim for 100% annotation coverage for the most popular libraries. Start with core (maybe it already is? I haven't kept up) and ring, then move outwards from there.
Library writers will be more motivated to add annotations if the big libraries are doing it.
For the most part, Ring is well-documented. But, as you noted, human-typed doc strings go only so far. I applaud the writers of ring in their discipline, but certainly we can do better than depending on human discipline.
You even noted, I picked "less well-documented libraries." I didn't pick them because they were not well-documented—I picked them because I'm using them!
From my (short) time with Haskell, I've found the type system to be the best I've ever used. It really does feel like it's helping you, instead of getting in the way. And so it feels more like a dynamic language than other strongly typed languages I've used (e.g. Scala, Java).
Below is a simple example, but look, no types to type!
>> let plus1 = (+1)
>> plus1 10
11
>> :t plus1
plus1 :: Num a => a -> a
You can ask for the type by `:t plus1`.I've also used Clojure, and I do really like Lisps, but I don't think untyped languages give enough benefit for all the problems it causes. I'm excited, however, about Typed Clojure (and Typed Racket).
Would you be able to explain, at a high level, how ClojureScript bootstrapped itself, and how Google Closure comes into play?