Skip to content

Instantly share code, notes, and snippets.

View ddellacosta's full-sized avatar

Dave Della Costa ddellacosta

View GitHub Profile
The question was asked why I (as a programmer who prefers dynamic languages) don't consider static types "worth it". Here
is a short list of what I would need from a type system for it to be truely useful to me:
1) Full type inference. I would really prefer to be able to write:
(defn concat-names [person]
(assoc person :full-name (str (:first-name person)
(:second-name person))))
And have the compiler know that whatever type required and produced from this function was acceptible as long as the
(ns example.net
(:require [goog.net.WebSocket]
[goog.events :refer (listen)]
[cljs.core.async :as async :refer (chan <! >! put! close)]
[cljs.core.async.impl.protocols :as proto])
(:require-macros [cljs.core.async.macros :refer (go)]))
(defn ws
"WebSocket as a core.async channel
returns a channel which delivers the ws chan then closes"