From fbffeaf7fe5aae08918aa72281c19e895865b7f1 Mon Sep 17 00:00:00 2001 From: Rodrigo Mesquita Date: Wed, 11 Oct 2023 16:21:07 +0100 Subject: [PATCH] WIP start using NP from sop-core, realise fields are not linear --- .../ghengin-core-indep/Ghengin/Core/Prelude.hs | 7 ++++++- ghengin-core/ghengin-core.cabal | 4 +++- ghengin-core/ghengin-core/Ghengin/Core/Render/Property.hs | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ghengin-core-indep/ghengin-core-indep/Ghengin/Core/Prelude.hs b/ghengin-core-indep/ghengin-core-indep/Ghengin/Core/Prelude.hs index 55203af..1be6824 100644 --- a/ghengin-core-indep/ghengin-core-indep/Ghengin/Core/Prelude.hs +++ b/ghengin-core-indep/ghengin-core-indep/Ghengin/Core/Prelude.hs @@ -29,13 +29,16 @@ module Ghengin.Core.Prelude -- reference-counting , Aliasable, Forgettable, Shareable, SomeAlias(..) + -- sop-core + , NP(..) + -- * Re-exports under different names , (<$$>) -- ** With multiplicity generalization , vmap, vtraverse -- * Our own things - , GHList(..), (=<<), (<=<), (>=>), v2vec, l2vec, vec2l + , (=<<), (<=<), (>=>), v2vec, l2vec, vec2l , vzipWith ) @@ -74,6 +77,7 @@ import qualified Data.V.Linear.Internal as VL import qualified Data.V.Linear.Internal.Instances as VL import GHC.Generics +import Data.SOP import Data.Kind import Data.Word import Data.IORef (IORef) @@ -104,6 +108,7 @@ infixr 6 :## Note [Coerce HList to List] ~~~~~~~~~~~~~~~~~~~~~~~~~~~ They have the same representation ^_^, so unsafeCoerce is safe ^_^ +(We use NP from sop-core instead of our own HList) -} -- GHList instances diff --git a/ghengin-core/ghengin-core.cabal b/ghengin-core/ghengin-core.cabal index 0d5c378..d84bb85 100644 --- a/ghengin-core/ghengin-core.cabal +++ b/ghengin-core/ghengin-core.cabal @@ -130,5 +130,7 @@ library gl-block, ghengin-core-indep, - linear-utils + linear-utils, + + sop-core diff --git a/ghengin-core/ghengin-core/Ghengin/Core/Render/Property.hs b/ghengin-core/ghengin-core/Ghengin/Core/Render/Property.hs index 0a333a9..04a7ac0 100644 --- a/ghengin-core/ghengin-core/Ghengin/Core/Render/Property.hs +++ b/ghengin-core/ghengin-core/Ghengin/Core/Render/Property.hs @@ -9,7 +9,7 @@ module Ghengin.Core.Render.Property , writeProperty -- * Utils - , GHList(..) + , NP(..) ) where import Ghengin.Core.Prelude as Linear