ЗП
instance consArray :: Cons (Array a) (Array b) a b where
_Cons = L.prism (uncurry (:)) $ \arr -> case A.uncons arr of
Nothing -> Left []
Just r -> Right (Tuple r.head r.tail)
Size: a a a
ЗП
instance consArray :: Cons (Array a) (Array b) a b where
_Cons = L.prism (uncurry (:)) $ \arr -> case A.uncons arr of
Nothing -> Left []
Just r -> Right (Tuple r.head r.tail)
VK
instance consArray :: Cons (Array a) (Array b) a b where
_Cons = L.prism (uncurry (:)) $ \arr -> case A.uncons arr of
Nothing -> Left []
Just r -> Right (Tuple r.head r.tail)
class Cons s a | s -> a where
_Cons :: LE.Setter a (s -> s) a s
instance consList :: Cons (L.List a) a where
_Cons f a l = f a <> l
VK
prism :: forall s t a b. (b -> t) -> (s -> Either t a) -> Prism s t a b
prism to fro pab = dimap fro (either identity identity) (right (rmap to pab))
ЗП
class Cons s a | s -> a where
_Cons :: LE.Setter a (s -> s) a s
instance consList :: Cons (L.List a) a where
_Cons f a l = f a <> l
VK
ЗП
VK
ЗП
ЗП
VK
VK
ЗП
VK
ЗП
ЗП
VK
ЗП
ЗП
ЗП