Safe Haskell | None |
---|---|
Language | Haskell2010 |
Folds over the fold family rooted at FoldFamily
.
- data Fold dataCase dataField dataTy foldFamily ty = Fold {
- mkAtomic :: ty -> dataField
- mkBifunct :: Name -> dataField -> dataField -> dataField
- mkDataCase :: Name -> [dataField] -> dataCase
- mkDataTy :: Name -> [dataCase] -> dataTy
- mkFoldFamily :: [dataTy] -> foldFamily
- mkFunct :: Name -> dataField -> dataField
- mkNonatomic :: ty -> dataField
- mkTrifunct :: Name -> dataField -> dataField -> dataField -> dataField
- mkTy :: Name -> ty
- idFold :: Fold DataCase DataField DataTy FoldFamily Ty
- errFold :: String -> Fold dataCase dataField dataTy foldFamily ty
- monadicFold :: Monad m => Fold dataCase dataField dataTy foldFamily ty -> Fold (m dataCase) (m dataField) (m dataTy) (m foldFamily) (m ty)
- foldFoldFamily :: Fold dataCase dataField dataTy foldFamily ty -> FoldFamily -> foldFamily
- foldDataTy :: Fold dataCase dataField dataTy foldFamily ty -> DataTy -> dataTy
- foldDataCase :: Fold dataCase dataField dataTy foldFamily ty -> DataCase -> dataCase
- foldDataField :: Fold dataCase dataField dataTy foldFamily ty -> DataField -> dataField
- foldTy :: Fold dataCase dataField dataTy foldFamily ty -> Ty -> ty
The Fold
structure and useful instances
data Fold dataCase dataField dataTy foldFamily ty Source
The fold. Bundles up the functions used to replace constructors in the fold family.
Fold | |
|
idFold :: Fold DataCase DataField DataTy FoldFamily Ty Source
The identity Fold
. Intended as a base to be modified.
errFold :: String -> Fold dataCase dataField dataTy foldFamily ty Source
The error Fold
. Intended as a base to be modified.
monadicFold :: Monad m => Fold dataCase dataField dataTy foldFamily ty -> Fold (m dataCase) (m dataField) (m dataTy) (m foldFamily) (m ty) Source
Using the constructors from the base Fold
, folds monadically in
a bottom-up, left-to-right manner.
folding functions
foldFoldFamily :: Fold dataCase dataField dataTy foldFamily ty -> FoldFamily -> foldFamily Source
Monadically folds over a FoldFamily
foldDataTy :: Fold dataCase dataField dataTy foldFamily ty -> DataTy -> dataTy Source
Monadically folds over a DataTy
foldDataCase :: Fold dataCase dataField dataTy foldFamily ty -> DataCase -> dataCase Source
Monadically folds over a DataCase
foldDataField :: Fold dataCase dataField dataTy foldFamily ty -> DataField -> dataField Source
Monadically folds over a DataField