Copyright | (c) gspia 2023- |
---|---|
License | BSD |
Maintainer | gspia |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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.
Documentation
>>>
import qualified GHC.TypeLits as TL
>>>
import Fcf.Data.Nat
data Foldl :: (b -> a -> Exp b) -> b -> t a -> Exp b Source #
Foldl in terms of Foldr.
Example
>>>
:kind! Eval (Foldl (Fcf.-) 10 '[3,2,1])
Eval (Foldl (Fcf.-) 10 '[3,2,1]) :: TL.Natural = 4
data MaybeToList :: Maybe a -> Exp [a] Source #
Turn Maybe into a list.
Example
>>>
:kind! Eval (MaybeToList ('Just 1))
Eval (MaybeToList ('Just 1)) :: [TL.Natural] = '[1]
Instances
type Eval (MaybeToList ('Nothing :: Maybe a) :: [a] -> Type) Source # | |
Defined in Fcf.Data.List.Utils | |
type Eval (MaybeToList ('Just a) :: [k] -> Type) Source # | |
Defined in Fcf.Data.List.Utils |