Re:Clojure's core.typed vs Haskell
by zeckalpha on Monday September 30, 2013 @09:58AM
(#6469617)
I'd be curious to see how Typed Racket compared, too.
[ Parent
| on HN ]
There would be annotations in the same places as Typed Clojure, except :no-check would be replaced by type soundness-preserving runtime assertions. There would be no need for :no-check anyway; Typed Racket's base annotations are complete AFAIK.
It is a little clearer to me how this works with things like primitives, but how do you annotate a function that takes a map as input and returns a list?
(defn my-keys [m]
(keys m))
Edit: Just found Seqable. Looking into it now. This link helped me a lot. https://github.com/clojure/core.typed/wiki/Types
Ambrose pointed me at this link for documentation of core.typed's convenience type wrappers (Vec, Seq, List etc.): http://clojure.github.io/core.typed/#clojure.core.typed/Seq
(ns my-ns (:require [clojure.core.typed :as t :refer [ann]]))
(ann my-keys (All [a] [(t/Map a Any) -> (t/Coll a)])
nice, thanks!
Re:Clojure's core.typed vs Haskell
by FireBringer on Monday September 30, 2013 @10:47AM
(#6469893)
Pretty close to clojure, problem 1: https://gist.github.com/anonymous/6764863