From d4086966b95c2ed556f5628a4cfcc41f5e19fab7 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Tue, 21 May 2024 10:34:55 +0200 Subject: Add Float primitive type --- src/Data/Array/Nested/Internal.hs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Data/Array/Nested/Internal.hs b/src/Data/Array/Nested/Internal.hs index a8db1b6..66b3130 100644 --- a/src/Data/Array/Nested/Internal.hs +++ b/src/Data/Array/Nested/Internal.hs @@ -438,6 +438,7 @@ instance PrimElt Int instance PrimElt Int64 instance PrimElt Int32 instance PrimElt CInt +instance PrimElt Float instance PrimElt Double instance PrimElt () @@ -466,6 +467,7 @@ newtype instance Mixed sh Int = M_Int (Mixed sh (Primitive Int)) deriving (Show) newtype instance Mixed sh Int64 = M_Int64 (Mixed sh (Primitive Int64)) deriving (Show) newtype instance Mixed sh Int32 = M_Int32 (Mixed sh (Primitive Int32)) deriving (Show) newtype instance Mixed sh CInt = M_CInt (Mixed sh (Primitive CInt)) deriving (Show) +newtype instance Mixed sh Float = M_Float (Mixed sh (Primitive Float)) deriving (Show) newtype instance Mixed sh Double = M_Double (Mixed sh (Primitive Double)) deriving (Show) newtype instance Mixed sh () = M_Nil (Mixed sh (Primitive ())) deriving (Show) -- no content, orthotope optimises this (via Vector) -- etc. @@ -491,6 +493,7 @@ newtype instance MixedVecs s sh Int64 = MV_Int64 (VS.MVector s Int64) newtype instance MixedVecs s sh Int32 = MV_Int32 (VS.MVector s Int32) newtype instance MixedVecs s sh CInt = MV_CInt (VS.MVector s CInt) newtype instance MixedVecs s sh Double = MV_Double (VS.MVector s Double) +newtype instance MixedVecs s sh Float = MV_Float (VS.MVector s Float) newtype instance MixedVecs s sh () = MV_Nil (VS.MVector s ()) -- no content, MVector optimises this -- etc. @@ -661,6 +664,7 @@ deriving via Primitive Int64 instance Elt Int64 deriving via Primitive Int32 instance Elt Int32 deriving via Primitive CInt instance Elt CInt deriving via Primitive Double instance Elt Double +deriving via Primitive Float instance Elt Float deriving via Primitive () instance Elt () instance Storable a => KnownElt (Primitive a) where @@ -674,6 +678,7 @@ deriving via Primitive Int64 instance KnownElt Int64 deriving via Primitive Int32 instance KnownElt Int32 deriving via Primitive CInt instance KnownElt CInt deriving via Primitive Double instance KnownElt Double +deriving via Primitive Float instance KnownElt Float deriving via Primitive () instance KnownElt () -- Arrays of pairs are pairs of arrays. -- cgit v1.2.3-70-g09d2