Idris2/tests/idris2/evaluator/evaluator002/Lib.idr
2023-09-07 14:57:22 +01:00

15 lines
278 B
Idris

module Lib
import Data.List
%default total
export
accMapAux : (a -> b) -> List a -> List b -> List b
accMapAux f [] acc = reverse acc
accMapAux f (x :: xs) acc = accMapAux f xs (f x :: acc)
public export
accMap : (a -> b) -> List a -> List b
accMap f xs = accMapAux f xs []