Cast Int (Bits n) instance
commit001469dd92ce7362d7527ad42fb57774dc7fa59b
authorBenjamin Saunders <besaunde@sfu.ca>
dateThu 20 Dec 2012, 17:12 (14 years ago)
parent8216c7f
lib/Prelude/Bits.idr+3
@@ -22,6 +22,9 @@ intToBits {n=n} x with (Bits n)
2222 | Bits32 = prim__intToB32 x
2323 | Bits64 = prim__intToB64 x
2424
25+instance Cast Int (Bits n) where
26+ cast = intToBits
27+
2528bitsShl : {n: Nat} -> Bits n -> Bits n -> Bits n
2629bitsShl {n=n} x c with (Bits n)
2730 | Bits8 = prim__shlB8 x c