mirror of
https://github.com/simonmichael/hledger.git
synced 2024-12-28 12:54:07 +03:00
lib: applyN comment
This commit is contained in:
parent
f84324682e
commit
264e81c430
@ -125,6 +125,9 @@ isRight = not . isLeft
|
|||||||
-- | Apply a function the specified number of times. Possibly uses O(n) stack ?
|
-- | Apply a function the specified number of times. Possibly uses O(n) stack ?
|
||||||
applyN :: Int -> (a -> a) -> a -> a
|
applyN :: Int -> (a -> a) -> a -> a
|
||||||
applyN n f = (!! n) . iterate f
|
applyN n f = (!! n) . iterate f
|
||||||
|
-- from protolude, compare
|
||||||
|
-- applyN :: Int -> (a -> a) -> a -> a
|
||||||
|
-- applyN n f = X.foldr (.) identity (X.replicate n f)
|
||||||
|
|
||||||
-- | Convert a possibly relative, possibly tilde-containing file path to an absolute one,
|
-- | Convert a possibly relative, possibly tilde-containing file path to an absolute one,
|
||||||
-- given the current directory. ~username is not supported. Leave "-" unchanged.
|
-- given the current directory. ~username is not supported. Leave "-" unchanged.
|
||||||
|
Loading…
Reference in New Issue
Block a user