git » blacktide.git » master » tree

[master] / src / com / tailrecursion / nanopass / pipeline.clj

(ns ^:typed.clojure com.tailrecursion.nanopass.pipeline
  "Adapt a value transformation to a [state value] compilation pair.
  Typed unary stages compose with ordinary ->.")

(defn map-value
  "Transform the value, preserving state. Each stage retains its own value type."
  {:com.tailrecursion.nanopass/signature
   '(typed.clojure/All [s a b]
      [[a :-> b] (typed.clojure/HVec [s a]) :-> (typed.clojure/HVec [s b])])}
  [pass [state value]]
  [state (pass value)])