Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: tools-analyzer
Fetching contributors…

Cannot retrieve contributors at this time

31 lines (27 sloc) 1.025 kb
(ns
^{:see-also [["http://matthew.brecknell.net/post/hole-driven-haskell/" "Hole Driven Development"]]
:doc "This namespace contains easy tools for hole driven development"}
clojure.core.typed.hole
(:require [clojure.core.typed :refer [ann ann-datatype] :as t]))
(binding [t/*collect-on-eval* false]
(ann silent-hole [-> Nothing]))
(defn silent-hole
"A silent hole. (silent-hole) passes for any other type
when type checking.
Use (silent-hole) as a placeholder for code.
Throws an exception when evaluted."
[]
(throw (Exception. "silent hole")))
(binding [t/*collect-on-eval* false]
(ann-datatype NoisyHole []))
(deftype NoisyHole [])
(binding [t/*collect-on-eval* false]
(ann noisy-hole [-> NoisyHole]))
(defn noisy-hole
"A noisy hole. The type system will complain when
(noisy-hole) is used in positions that expect a type
more specific than Object or Any.
Use (noisy-hole) as a placeholder for code.
Throws an exception when evaluted."
[]
(throw (Exception. "noisy hole")))
Jump to Line
Something went wrong with that request. Please try again.