Created
May 21, 2015 01:34
-
-
Save andrewhr/82b77b80365be686ff83 to your computer and use it in GitHub Desktop.
Revisions
-
andrewhr created this gist
May 21, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ (deftype Event (U :new-release)) (defn probability :- Float "Return the probability of some `Event` to occur. IRL this should be some real and complicated calculus instead of a simply constant" [event :- Event :> Float] 0.95) (defn descriptive-propability "Describe the probability of a given `Event` to occur, for human readers." [event :- Event] :- String (match (probability event) 1.00 "certain" 0.00 "impossible" (range 0.00 0.25) "very unlikely" (range 0.25 0.50) "unlikely" (range 0.50 0.75) "likely" (range 0.75 1.00) "very likely" _ (unreachable!))) (defn -main [] (println! (descriptive-propability :new-release)))