From ae113c0249f3fe8be7df345081b1b51451cd3fdf Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Wed, 27 Mar 2024 22:58:51 +0100 Subject: Ranked interface --- src/Nats.hs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/Nats.hs') 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 -- cgit v1.2.3-70-g09d2