singleton-nats 0.3.0.1 → 0.3.1.0
raw patch · 2 files changed
+10/−1 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Data/Nat.hs +9/−0
- singleton-nats.cabal +1/−1
Data/Nat.hs view
@@ -47,6 +47,15 @@ natMul :: Nat -> Nat -> Nat natMul = (Data.Nat.*) +{-| Converts a runtime 'Integer' to an existentially wrapped 'Nat'. Returns 'Nothing' if+the argument is negative -}+someNat :: Integer -> Maybe (SomeSing (KindOf Z))+someNat n | n < 0 = Nothing+someNat n = Just (go n) where + go 0 = SomeSing SZ+ go n = case go (n - 1) of+ SomeSing sn -> SomeSing (SS sn)+ {-| Provides a shorthand for 'Nat'-s using "GHC.TypeLits", for example: >>> :kind! Lit 3
singleton-nats.cabal view
@@ -1,6 +1,6 @@ name: singleton-nats-version: 0.3.0.1+version: 0.3.1.0 synopsis: Unary natural numbers relying on the singletons infrastructure. license: BSD3 license-file: LICENSE