Update Data.NumIdr.Scalar
This commit is contained in:
parent
95a13ffd91
commit
8384f8f68b
|
@ -8,7 +8,7 @@ import public Data.NumIdr.Array
|
||||||
%default total
|
%default total
|
||||||
|
|
||||||
||| Scalars are `Array []`, the unique 0-rank array type. They hold a single value.
|
||| Scalars are `Array []`, the unique 0-rank array type. They hold a single value.
|
||||||
||| Scalars are not particularly useful as container types, but they are
|
||| Scalars are not particularly useful as data structures, but they are
|
||||||
||| included here anyways.
|
||| included here anyways.
|
||||||
public export
|
public export
|
||||||
Scalar : Type -> Type
|
Scalar : Type -> Type
|
||||||
|
@ -29,3 +29,11 @@ unwrap = index 0 . getPrim
|
||||||
export
|
export
|
||||||
Num a => Mult (Scalar a) (Scalar a) (Scalar a) where
|
Num a => Mult (Scalar a) (Scalar a) (Scalar a) where
|
||||||
(*.) = (*)
|
(*.) = (*)
|
||||||
|
|
||||||
|
export
|
||||||
|
Num a => MultMonoid (Scalar a) where
|
||||||
|
identity = scalar 1
|
||||||
|
|
||||||
|
export
|
||||||
|
Fractional a => MultGroup (Scalar a) where
|
||||||
|
inverse = recip
|
||||||
|
|
Loading…
Reference in a new issue