-
-
Save kuribas/3539cd48795232553061571f6b7a64c1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Local Variables: | |
-- idris-load-packages: ("contrib") | |
-- End: | |
module Main | |
import Data.Maybe | |
import Decidable.Equality | |
import Data.Vect | |
import Data.List | |
import Data.Linear.Array | |
dupArr : (LinArray Int, LinArray Int) | |
dupArr = | |
let x = newArray 3 (\x => x) | |
in (x, x) | |
writeTwice : LinArray Int -> (LinArray Int, LinArray Int) | |
writeTwice la = | |
let x = write la 2 4 | |
in (case x of _ # a => | |
case (write a 3 3) of | |
_ # b => b | |
,case x of _ # a => a) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment