diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Data/Array/Nested/Convert.hs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Data/Array/Nested/Convert.hs b/src/Data/Array/Nested/Convert.hs index beb978e..d07bab9 100644 --- a/src/Data/Array/Nested/Convert.hs +++ b/src/Data/Array/Nested/Convert.hs @@ -3,6 +3,7 @@ {-# LANGUAGE PolyKinds #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeAbstractions #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeOperators #-} @@ -104,6 +105,12 @@ shxFromShS (n :$$ sh) = SKnown n :$% shxFromShS sh -- @'@: 'CastXS'' and 'CastXX''. For the other constructors, the types ensure -- that the shapes are already compatible. To convert between 'Ranked' and -- 'Shaped', go via 'Mixed'. +-- +-- The guiding principle behind 'Castable' is that it should represent the +-- array restructurings, or perhaps re-presentations, that do not change the +-- underlying 'XArray's. This leads to the inclusion of some operations that do +-- not look like a cast at first glance, like 'CastZip'; with the underlying +-- representation in mind, however, they are very much like a cast. data Castable a b where CastId :: Castable a a CastCmp :: Castable b c -> Castable a b -> Castable a c @@ -144,6 +151,7 @@ data Castable a b where => Castable (Mixed sh a, Mixed sh b) (Mixed sh (a, b)) CastUnzip :: (Elt a, Elt b) => Castable (Mixed sh (a, b)) (Mixed sh a, Mixed sh b) +deriving instance Show (Castable a b) instance Category Castable where id = CastId |