From 137eaa13144c2599ac29da9ebd3af24ac1ce8968 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Fri, 7 Mar 2025 15:11:59 +0100 Subject: WIP revamp accumulator projection type repr I stopped working on this because I realised that having sparse products (and coproducts, prehaps) everywhere is a very bad idea in general, and that we need to fix that first before really being able to do anything else productive with performance. --- src/Data.hs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/Data.hs') diff --git a/src/Data.hs b/src/Data.hs index 1304a5f..60afdd0 100644 --- a/src/Data.hs +++ b/src/Data.hs @@ -101,6 +101,10 @@ type family n + m where Z + m = m S n + m = S (n + m) +type family n - m where + n - Z = n + S n - S m = n - m + snatAdd :: SNat n -> SNat m -> SNat (n + m) snatAdd SZ m = m snatAdd (SS n) m = SS (snatAdd n m) -- cgit v1.2.3-70-g09d2