Skip to content

Instantly share code, notes, and snippets.

View sbelak's full-sized avatar

Simon Belak sbelak

View GitHub Profile
@david-mcneil
david-mcneil / typed-higher-order-functions.clj
Last active September 27, 2017 09:55
examples of prismatic schema extension to higher order functions
;; (:require [lonocloud.step.async.pschema :as s])
;; Define a higher-order function. Note the 'format-f' argument that is specified to be a function
;; of one arity that takes a String and an s/Int to produce a String
(s/defn write-person [format-f :- (s/fn String [String s/Int])
person :- {:name String
:age s/Int}]
(format-f (:name person) (:age person)))
(def joe {:name "joe" :age 19})