Skip to content

Instantly share code, notes, and snippets.

@frenchy64
Created October 15, 2014 20:13
Show Gist options
  • Save frenchy64/176fa8aadfd5b0cbfc09 to your computer and use it in GitHub Desktop.
Save frenchy64/176fa8aadfd5b0cbfc09 to your computer and use it in GitHub Desktop.
map-span
(ns typed-poly.core
(:refer-clojure :exclude [for])
(:require [clojure.core.typed :as t :refer [All Map for ann]]))
(ann map-span (All [x y y1]
[(Map x y) [y -> y1] -> (Map x y1)]))
(defn map-span [m f]
(into {} (for [[k v] :- '[x y] m] :- '[x y1]
[k (f v)])))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment