on master help sign in
Cast Int (Bits n) instance
001469dBenjamin Saunders
lib/Prelude/Bits.idr+3
@@ -22,6 +22,9 @@ intToBits {n=n} x with (Bits n)
22 | Bits32 = prim__intToB32 x
22 | Bits32 = prim__intToB32 x
23 | Bits64 = prim__intToB64 x
23 | Bits64 = prim__intToB64 x
24
24
25+instance Cast Int (Bits n) where
26+ cast = intToBits
27+
25bitsShl : {n: Nat} -> Bits n -> Bits n -> Bits n
28bitsShl : {n: Nat} -> Bits n -> Bits n -> Bits n
26bitsShl {n=n} x c with (Bits n)
29bitsShl {n=n} x c with (Bits n)
27 | Bits8 = prim__shlB8 x c
30 | Bits8 = prim__shlB8 x c