Remove unnecessary Data.Reify module
This commit is contained in:
parent
0a4be10a0d
commit
ad25af6e3f
|
@ -1,7 +1,6 @@
|
||||||
module Data.NumIdr.Array.Array
|
module Data.NumIdr.Array.Array
|
||||||
|
|
||||||
import Data.Vect
|
import Data.Vect
|
||||||
import Data.Reify
|
|
||||||
import Data.NumIdr.PrimArray
|
import Data.NumIdr.PrimArray
|
||||||
import Data.NumIdr.Array.Order
|
import Data.NumIdr.Array.Order
|
||||||
|
|
||||||
|
@ -9,28 +8,30 @@ import Data.NumIdr.Array.Order
|
||||||
|
|
||||||
|
|
||||||
export
|
export
|
||||||
record Array {0 rk : Nat} (s : Vect rk Nat) a where
|
data Array : Vect rk Nat -> Type -> Type where
|
||||||
constructor MkArray
|
MkArray : (ord : Order rk) -> (sts : Vect rk Nat) ->
|
||||||
shape : Reify s
|
(s : Vect rk Nat) -> PrimArray a -> Array s a
|
||||||
strides : Vect rk Nat
|
|
||||||
contents : PrimArray a
|
|
||||||
|
|
||||||
|
|
||||||
export
|
export
|
||||||
getPrim : Array s a -> PrimArray a
|
getPrim : Array s a -> PrimArray a
|
||||||
getPrim = contents
|
getPrim (MkArray _ _ _ arr) = arr
|
||||||
|
|
||||||
|
export
|
||||||
|
getOrder : Array {rk} s a -> Order rk
|
||||||
|
getOrder (MkArray ord _ _ _) = ord
|
||||||
|
|
||||||
export
|
export
|
||||||
getStrides : Array {rk} s a -> Vect rk Nat
|
getStrides : Array {rk} s a -> Vect rk Nat
|
||||||
getStrides = strides
|
getStrides (MkArray _ sts _ _) = sts
|
||||||
|
|
||||||
export
|
export
|
||||||
size : Array s a -> Nat
|
size : Array s a -> Nat
|
||||||
size arr = length arr.contents
|
size = length . getPrim
|
||||||
|
|
||||||
export
|
export
|
||||||
shape : Array {rk} s a -> Vect rk Nat
|
shape : Array {rk} s a -> Vect rk Nat
|
||||||
shape arr = getReify arr.shape
|
shape (MkArray _ _ s _) = s
|
||||||
|
|
||||||
export
|
export
|
||||||
rank : Array s a -> Nat
|
rank : Array s a -> Nat
|
||||||
|
@ -50,3 +51,9 @@ public export
|
||||||
Vects : Vect rk Nat -> Type -> Type
|
Vects : Vect rk Nat -> Type -> Type
|
||||||
Vects [] a = a
|
Vects [] a = a
|
||||||
Vects (d::s) a = Vect d (Vects s a)
|
Vects (d::s) a = Vect d (Vects s a)
|
||||||
|
|
||||||
|
|
||||||
|
export
|
||||||
|
reshape' : (s' : Vect rk' Nat) -> Order rk -> Array {rk} s a ->
|
||||||
|
product s = product s' => Array rk' s' a
|
||||||
|
reshape' s' ord arr = MkArray
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
module Data.Reify
|
|
||||||
|
|
||||||
%default total
|
|
||||||
|
|
||||||
|
|
||||||
public export
|
|
||||||
data Reify : a -> Type where
|
|
||||||
MkReify : (x : a) -> Reify x
|
|
||||||
|
|
||||||
public export
|
|
||||||
getReify : {0 x : a} -> Reify x -> a
|
|
||||||
getReify (MkReify x) = x
|
|
||||||
|
|
Loading…
Reference in a new issue