Commit 70c3f81a authored by Camil Staps's avatar Camil Staps 🐧

Add Data._Int32Array for arrays of 32-bit integers

parent d971c0ae
Pipeline #31726 failed with stage
in 1 minute and 25 seconds
definition module Data._Int32Array
from _SystemArray import class Array
:: Int32Array_ a =: Int32Array_ () // actually {#INT32}, but INT32 only exists on ABC level
:: Int32Array :== Int32Array_ Int
instance Array Int32Array_ Int
where
uselect :: !u:(Int32Array_ Int) !Int -> *(!Int, !u:(Int32Array_ Int))
update :: !*(Int32Array_ e:Int) !Int !e:Int -> *Int32Array_ e:Int
createArray :: !Int !Int -> *Int32Array_ Int
replace :: !*(Int32Array_ e:Int) !Int !e:Int -> *(!e:Int, !*Int32Array_ e:Int)
implementation module Data._Int32Array
import StdEnv
instance Array Int32Array_ Int
where
select _ _ = code {
select INT32 0 1
}
uselect :: !u:(Int32Array_ Int) !Int -> *(!Int, !u:(Int32Array_ Int))
uselect _ _ = code {
push_a 0
select INT32 0 1
}
size _ = code {
push_arraysize INT32 0 1
}
usize _ = code {
push_a 0
push_arraysize INT32 0 1
}
update :: !*(Int32Array_ e:Int) !Int !e:Int -> *Int32Array_ e:Int
update _ _ _ = code {
update INT32 0 1
}
createArray :: !Int !Int -> *Int32Array_ Int
createArray _ _ = code {
create_array INT32 0 1
}
_createArray _ = code {
create_array_ INT32 0 1
}
replace :: !*(Int32Array_ e:Int) !Int !e:Int -> *(!e:Int, !*Int32Array_ e:Int)
replace _ _ _ = code {
replace INT32 0 1
}
......@@ -141,6 +141,7 @@ import qualified Data.Tree
import qualified Data.Tuple
import qualified Data.Word8
import qualified Data._Array
import qualified Data._Int32Array
import qualified Data.Encoding.GenBinary
import qualified Database.Native
import qualified Database.Native.JSON
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment