This file contains 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
const absurd = (v: never): never => v | |
const typed = <T,>(v: T): T => v | |
type Kinded<A extends B, B> = A | |
type Norm<T> = T extends T ? { [k in keyof T]: T[k] } : never | |
// | |
interface Condition { present: unknown; absent: unknown } | |
type Cond<P, A> = Condition & { present: P, absent: A } | |
type Not<C extends Condition> = Cond<C['absent'], C['present']> |
This file contains 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
-- We define uncurried versions of Pair and Either to help with type-checking | |
data Tuple : (Type, Type) -> Type where | |
MkTuple : a -> b -> Tuple (a, b) | |
data Sum : (Type, Type) -> Type where | |
Left : a -> Sum (a, b) | |
Right : b -> Sum (a, b) | |
-- These are bifunctor versions of projections/injections | |
data Fst : (Type, Type) -> Type where |