Skip to content

Commit

Permalink
[ base ] Make foldr1 and foldr1By public
Browse files Browse the repository at this point in the history
  • Loading branch information
dunhamsteve authored and gallais committed Aug 7, 2023
1 parent 3ce8b9f commit badf1e9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@
* Adds `getTermCols` and `getTermLines` to the base library. They return the
size of the terminal if either stdin or stdout is a tty.

* The `Data.List1` functions `foldr1` and `foldr1By` are now `public export`.

#### System

* Changes `getNProcessors` to return the number of online processors rather than
Expand Down
4 changes: 2 additions & 2 deletions libs/base/Data/List1.idr
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ init (x ::: xs) = loop x xs where
loop x [] = []
loop x (y :: xs) = x :: loop y xs

export
public export
foldr1By : (func : a -> b -> b) -> (map : a -> b) -> (l : List1 a) -> b
foldr1By f map (x ::: xs) = loop x xs where
loop : a -> List a -> b
Expand All @@ -58,7 +58,7 @@ public export
foldl1By : (func : b -> a -> b) -> (map : a -> b) -> (l : List1 a) -> b
foldl1By f map (x ::: xs) = foldl f (map x) xs

export
public export
foldr1 : (func : a -> a -> a) -> (l : List1 a) -> a
foldr1 f = foldr1By f id

Expand Down

0 comments on commit badf1e9

Please sign in to comment.