on master help sign in
Add shiftL and shiftR

These should probably be in an interface rather than specifically for Int, but that can be done in a backwards compatible way later.

commitb1b6a03c06cb5a0a3b70a6dc7a25953818342b47 authorEdwin Brady <ecb10@st-andrews.ac.uk> dateSun 12 Jun 2016, 16:29 (10 years ago) parenta0d095d
1 file changed+7
libs/prelude/Prelude.idr+7
libs/prelude/Prelude.idr+7
@@ -130,6 +130,13 @@ pow : (Num a) => a -> Nat -> a
130130pow x Z = 1
131131pow x (S n) = x * (pow x n)
132132
133+-- XXX these should probably also go somewhere else (in an interface somewhere?)
134+shiftR : Int -> Int -> Int
135+shiftR = prim__ashrInt
136+
137+shiftL : Int -> Int -> Int
138+shiftL = prim__shlInt
139+
133140---- Ranges
134141
135142natRange : Nat -> List Nat