on master help sign in
Add Cast instance for Nat to String
commit22bcbd3281872e8e5cb822c9b595da5ed52f7ff6 authorJoomy Korkut <joomy@cattheory.com> dateSat 19 Aug 2017, 22:10 (9 years ago) parente87d767
1 file changed+3
libs/prelude/Prelude/Nat.idr+3
libs/prelude/Prelude/Nat.idr+3
@@ -238,6 +238,9 @@ Cast Integer Nat where
238238Cast String Nat where
239239 cast str = cast (the Integer (cast str))
240240
241+Cast Nat String where
242+ cast n = cast (the Integer (cast n))
243+
241244||| A wrapper for Nat that specifies the semigroup and monoid implementations that use (*)
242245record Multiplicative where
243246 constructor GetMultiplicative