ЗП
Size: a a a
ЗП
ЗП
ЗП
ЗП
ЗП
VK
ЗП
VK
append зависит линейно как от размера первого аргумента, так и от размера второго.O(n^2), балансированной - O(n * log(n)).ЗП
append зависит линейно как от размера первого аргумента, так и от размера второго.O(n^2), балансированной - O(n * log(n)).VK
ЗП
ЗП
ЗП
VK
VK
ЗП
VK
class Cons s t a b | s -> a, t -> b, s b -> t, t a -> s where
_Cons :: L.Prism s t (Tuple a s) (Tuple b t)
class Snoc s t a b | s -> a, t -> b, s b -> t, t a -> s where
_Snoc :: L.Prism s t (Tuple s a) (Tuple t b)
_Cons :: forall p. Choice p =>
p (Tuple a (List a)) (Tuple a (List a)) ->
p (L.List a) (List a)
VK
class Cons s t a b | s -> a, t -> b, s b -> t, t a -> s where
_Cons :: L.Prism s t (Tuple a s) (Tuple b t)
simply :: forall p s a r. (L.Optic' p s a -> r) -> L.Optic' p s a -> r
simply = identity
consDefault :: forall s a. Cons s s a a => a -> s -> s
consDefault = curry (simply L.review _Cons)
instance consList :: Cons (List a) (List a) a a where
-- _Cons :: forall p. Choice p => p (Tuple a (List a)) (Tuple a (List a)) -> p (List a) (List a)
_Cons = undefined
ЗП