aboutsummaryrefslogtreecommitdiff
path: root/src/Nats.hs
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2024-03-27 22:58:51 +0100
committerTom Smeding <tom@tomsmeding.com>2024-03-27 22:58:51 +0100
commitae113c0249f3fe8be7df345081b1b51451cd3fdf (patch)
treefaf241d19fec975f7d77a4486505a57ed4cc0b8b /src/Nats.hs
parentcb31e179971293c519a530d8ce8ccc004458b1c4 (diff)
Ranked interface
Diffstat (limited to 'src/Nats.hs')
-rw-r--r--src/Nats.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Nats.hs b/src/Nats.hs
index a9ad47c..fdc090e 100644
--- a/src/Nats.hs
+++ b/src/Nats.hs
@@ -42,6 +42,10 @@ snatKnown :: SNat n -> Dict KnownNat n
snatKnown SZ = Dict
snatKnown (SS n) | Dict <- snatKnown n = Dict
+type family n + m where
+ Z + m = m
+ S n + m = S (n + m)
+
type family GNat n where
GNat Z = 0
GNat (S n) = 1 G.+ GNat n