From 77ffde450e92ffe6527c35ffc2383b17d4c04f68 Mon Sep 17 00:00:00 2001 From: braxtonhall Date: Sun, 23 Oct 2022 12:27:49 -0700 Subject: Rename directory to use GitHub ID --- entries/braxtonhall/types/index.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 entries/braxtonhall/types/index.ts (limited to 'entries/braxtonhall/types/index.ts') diff --git a/entries/braxtonhall/types/index.ts b/entries/braxtonhall/types/index.ts new file mode 100644 index 0000000..11f4086 --- /dev/null +++ b/entries/braxtonhall/types/index.ts @@ -0,0 +1,18 @@ +type Zero = "😰"; + +type Succ = {prev: N}; + +type Prev = N extends Succ ? P : never; + +type Add = B extends Zero ? A : Succ>>; + +type _Fib = + N extends Zero + ? AccumulatorA + : N extends Succ + ? AccumulatorB + : _Fib, AccumulatorB, Add>; + +type Fib = _Fib>; + +export type {Zero, Succ, Fib}; -- cgit v1.2.3-70-g09d2