Foldl in terms of Foldr.
Example
:kind! Eval (Foldl (Fcf.-) 10 '[3,2,1])Eval (Foldl (Fcf.-) 10 '[3,2,1]) :: TL.Natural= 4
:: a typeCtrl KGHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05
Modulefcf-containers-0.8.2Haskell2010
Some of the following methods would probably have better place at the first-class-families library. That is, polish and make a PR.
import qualified GHC.TypeLits as TLimport Fcf.Data.Nat
Foldl in terms of Foldr.
:kind! Eval (Foldl (Fcf.-) 10 '[3,2,1])Eval (Foldl (Fcf.-) 10 '[3,2,1]) :: TL.Natural= 4
Turn Maybe into a list.
:kind! Eval (MaybeToList ('Just 1))Eval (MaybeToList ('Just 1)) :: [TL.Natural]= '[1]
type Eval (MaybeToList 'Nothing) = '[]Defined in fcf-containers-0.8.2 · Fcf.Data.List.Utilstype Eval (MaybeToList ('Just a)) = '[a]Defined in fcf-containers-0.8.2 · Fcf.Data.List.Utils