Last active
February 26, 2020 13:08
-
-
Save reidev275/cfae1b90ca4183d3fce73bbcd887b9d6 to your computer and use it in GitHub Desktop.
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 characters
export const equals = <A, K extends keyof A>(field: K, val: A[K]): Filter<A> => ({ | |
kind: "Equals", | |
field, | |
val | |
}); | |
export const greater = <A, K extends keyof A>(field: K, val: A[K]): Filter<A> => ({ | |
kind: "Greater", | |
field, | |
val | |
}); | |
export const less = <A, K extends keyof A>(field: K, val: A[K]): Filter<A> => ({ | |
kind: "Less", | |
field, | |
val | |
}); | |
export const and = <A>(a: Filter<A>, b: Filter<A>): Filter<A> => ({ | |
kind: "And", | |
a, | |
b | |
}); | |
export const or = <A>(a: Filter<A>, b: Filter<A>): Filter<A> => ({ | |
kind: "Or", | |
a, | |
b | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment