HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulefcf-containers-0.8.2Haskell2010

Fcf.Data.List.Utils

Fcf.Data.List.Utils

Some of the following methods would probably have better place at the first-class-families library. That is, polish and make a PR.

  • 2 types
Example2 expressions
import qualified GHC.TypeLits as TLimport           Fcf.Data.Nat
datadata Foldl (c :: b -> a -> Exp b) (d :: b) (e :: t a) (f :: b)
#

Foldl in terms of Foldr.

Example
Example1 expression
:kind! Eval (Foldl (Fcf.-) 10 '[3,2,1])Eval (Foldl (Fcf.-) 10 '[3,2,1]) :: TL.Natural= 4
Instances1Eval
datadata MaybeToList (b :: Maybe a) (c :: [a])
#

Turn Maybe into a list.

Example
Example1 expression
:kind! Eval (MaybeToList ('Just 1))Eval (MaybeToList ('Just 1)) :: [TL.Natural]= '[1]
Instances2Eval