Can `foldr` and `foldl` be defined in terms of each other?
问题 Can foldr and foldl be defined in terms of each other? Programming in Haskell by Hutton says What do we need to define manually? The minimal complete definition for an instance of the Foldable class is to define either foldMap or foldr , as all other functions in the class can be derived from either of these two using the default definitions and the instance for lists. So how can foldl be defined in terms of foldr ? Can foldr be defined in terms of foldl , so that we can define a Foldable