Files
agdaproofs/Lists/Fold/Fold.agda
2020-01-05 15:06:35 +00:00

10 lines
273 B
Agda

{-# OPTIONS --safe --warning=error --without-K #-}
open import Lists.Definition
module Lists.Fold.Fold {a b : _} {A : Set a} {B : Set b} where
fold : (f : A B B) B List A B
fold f default [] = default
fold f default (x :: l) = f x (fold f default l)