D•
Size: a a a
D•
RY
AK
(a -> SomeType b c a) -> SomeType b c a -> SomeType b c a
, то есть andThen
, но без смены a -> b
. И есть ли смысл в такой, может я туплю? У меня просто внутри типа функция внутри мейби (SomeType b c a = SomeType b c (Maybe (c -> a))
) , andThen
на нём никак не сделать, а вот такое можно и нужно иногда.AP
andThen
чем не подходит-то?K
SomeType b c a = SomeType b c (Maybe (c -> a))
Чтоита?AP
andThen
не накладываетAP
andThen
подходит больше всегоK
AP
AP
type SomeType b c a = SomeType b c (Maybe (c -> a))
K
K
a
как два байта переслатьAP
AP
a
AP
AP
andThen
с (a -> b)
! :)AP
andThen : (a -> d) -> SomeType b c a -> SomeType b c d
andThen f (SomeType b c mbA) = SomeType b c (Maybe.map (<<< f) mbA)
AP
K
type SomeType b c a = SomeType b c (Maybe (c -> a))
andThen : (a -> SomeType b c d) -> SomeType b c a -> SomeType b c d
andThen k s = case s of
SomeType b c (Just f) -> k (f c)
SomeType b c Nothing -> SomeType b c Nothing