3 ms·
Actually, in Haskell, given that Maybe is Foldable, you can technically implement the maybe function as maybe' def f value = foldr (const . f) def value Altho
by shirogane86x 7y ago
Actually, in Haskell, given that Maybe is Foldable, you can technically implement the maybe function as
maybe' def f value = foldr (const . f) def value
Although in pratcice almost noone uses Maybe's foldable instance (and it also doesn't scale to other datatypes, like Either, nearly as well, because of the multiple type parameters).