case, , . :
data Shapely (fs :: [* -> *]) where
ShZ :: Shapely '[]
ShS :: (Dim f) => Shapely fs -> Shapely (f ': fs)
, :
class SShapely (fs :: [* -> *]) where
shapely :: Shapely fs
instance SShapely '[] where
shapely = ShZ
instance (Dim f, SShapely fs) => SShapely (f ': fs) where
shapely = ShS shapely
, , , . -
pureSh :: Shapely fs -> a -> Hyper fs a
pureSh ShZ x = Scalar x
pureSh (ShS s) x = Prism (pureSh s (pure x))
instance SShapely fs => Applicative (Hyper fs) where
pure = pureSh shapely
ShZ , fs ~ '[], fs '[] Scalar x . ShS .
check, Prism SShapely fs, Shapely fs (, , ), :
data Shapely (fs :: [* -> *]) where
ShZ :: Shapely '[]
ShS :: (Dim f, SShapely fs) => Shapely (f ': fs)
class SShapely (fs :: [* -> *]) where
shapely :: Shapely fs
instance SShapely '[] where
shapely = ShZ
instance (Dim f, SShapely fs) => SShapely (f ': fs) where
shapely = ShS
pureSh :: Shapely fs -> a -> Hyper fs a
pureSh ShZ x = Scalar x
pureSh ShS x = Prism (pureSh shapely (pure x))
instance SShapely fs => Applicative (Hyper fs) where
pure = pureSh shapely
ShS Shapely Shapely fs , SShapely fs, a Shapely fs. .
.