AK
fold в моём случае как-то так:setJust (_lens foo) (newVal : (fold $ view (_lens foo) subj)) subj
но много скобок и линза переиспользуется, так что тоже может быть стоит вынести
Size: a a a
AK
fold в моём случае как-то так:setJust (_lens foo) (newVal : (fold $ view (_lens foo) subj)) subj
ЗП
10 L.: oneOf (Just (20 L.: L.Nil))AK
ЗП
AK
AK
AK
AG
AK
Вл
ЗП
AK
fold в моём случае как-то так:setJust (_lens foo) (newVal : (fold $ view (_lens foo) subj)) subj
consOrSingleton :: forall subj val. Lens' subj (Maybe (List val)) -> val -> subj -> subj
consOrSingleton lens val subj =
setJust lens newlist subj
where
newlist = val : (fold $ view lens subj)
VY
ЗП
TheseЗП
ЗП
logShow $ align (1..3) (1..5)
logShow $ salign ["foo", "bar", "baz"] ["quux"]
logShow $ padZipWith (\a b -> (+) <$> a <*> b) (1..5) (1..3)
logShow $ sequenceL [(1..5), (6..10), (11..12)]
logShow $ sequenceL (Just (1..5))
logShow $ sequenceL (Both (1..3) (4..8))
logShow $ bisequenceL (Left (1..5) :: Either (Array Int) (Array Int))
logShow $ bisequenceL (Right (1..5) :: Either (Array Int) (Array Int))
logShow $ bisequenceL (This (1..5) :: These (Array Int) (Array Int))
logShow $ bisequenceL (That (1..5) :: These (Array Int) (Array Int))
logShow $ bisequenceL (Both (1..4) (5..7) :: These (Array Int) (Array Int))
logShow $ optionally ([] :: Array Int) ([1] :: Array Int)