mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-15 22:32:19 +03:00
15 lines
278 B
Idris
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 []
|