From 21eb3ead0ced0aaca4fb400e98349b8acb99599a Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Wed, 4 Jun 2025 15:12:24 +0200 Subject: Describe Castable philosophy --- src/Data/Array/Nested/Convert.hs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/Data') diff --git a/src/Data/Array/Nested/Convert.hs b/src/Data/Array/Nested/Convert.hs index beb978e..cea2489 100644 --- a/src/Data/Array/Nested/Convert.hs +++ b/src/Data/Array/Nested/Convert.hs @@ -104,6 +104,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 -- cgit v1.2.3-70-g09d2