Permalink
Browse files

Placed file in a wrong place; fixed

  • Loading branch information...
1 parent 6de73e2 commit bfeb666e4432a3c4e6bcd75ce447ab8d456a6a64 @dnaumov committed Apr 8, 2012
Showing with 8 additions and 2 deletions.
  1. +8 −2 {test/contracts/test → src/contracts}/preds.clj
@@ -2,12 +2,18 @@
(:refer-clojure :exclude [= == not= < > <= >=
identical? instance? extends? satisfies? isa?
contains? every? not-every? some not-any?
- and or not])
- (:require [clojure.core :as c]))
+ and or not vector-of])
+ (:require [clojure.core :as c])
+ (:use [clojure.core.match :only [match]]))
;; TODO: tests!
(defn boolean? [x] (c/instance? Boolean x))
+(defn either [f vals] #(c/some (partial f %) vals))
+(def anything (constantly true))
+
+(defmacro match? [pattern]
+ `(fn [x#] (match x# ~pattern true)))
(def and c/every-pred)
(def or c/some-fn)

0 comments on commit bfeb666

Please sign in to comment.