Add new indexing functions
This commit is contained in:
parent
9ece7e6963
commit
3246e0ed94
3 changed files with 81 additions and 37 deletions
|
|
@ -44,6 +44,10 @@ unsafeFromIns size ins = unsafePerformIO $ do
|
|||
for_ ins $ \(i,x) => arrayDataSet i x arr
|
||||
pure $ MkPrimArray size arr
|
||||
|
||||
export
|
||||
unsafeDoIns : List (Nat, a) -> PrimArray a -> IO ()
|
||||
unsafeDoIns ins arr = for_ ins $ \(i,x) => arrayDataSet i x arr.content
|
||||
|
||||
||| Create an array given its size and a function to generate its elements by
|
||||
||| its index.
|
||||
export
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue