Skip to content

Commit

Permalink
Add freezeCloneIO to clone an Array(Like) into an IArray (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
gergoerdi authored Aug 27, 2023
1 parent 650f991 commit ebfb4dc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions js/src/JS/Array.idr
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,10 @@ record IArray (a : Type) where
constructor MkIArray
array : Array a

export
freezeCloneIO : (HasIO io, ArrayLike arr el) => arr -> io (IArray el)
freezeCloneIO xs = MkIArray <$> primIO (prim__fromArrayLikeIO xs)

export
freeze : forall sze,a . (1 _ : LinArray sze a) -> IArray a
freeze (MkLinArray arr) = MkIArray arr
Expand Down

0 comments on commit ebfb4dc

Please sign in to comment.