diff options
author | Tom Smeding <tom@tomsmeding.com> | 2024-03-27 22:58:51 +0100 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2024-03-27 22:58:51 +0100 |
commit | ae113c0249f3fe8be7df345081b1b51451cd3fdf (patch) | |
tree | faf241d19fec975f7d77a4486505a57ed4cc0b8b /src/Nats.hs | |
parent | cb31e179971293c519a530d8ce8ccc004458b1c4 (diff) |
Ranked interface
Diffstat (limited to 'src/Nats.hs')
-rw-r--r-- | src/Nats.hs | 4 |
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 |