diff options
Diffstat (limited to 'lib/ur/list.urs')
-rw-r--r-- | lib/ur/list.urs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/ur/list.urs b/lib/ur/list.urs index fe730152..f81f38a4 100644 --- a/lib/ur/list.urs +++ b/lib/ur/list.urs @@ -7,6 +7,8 @@ val foldl : a ::: Type -> b ::: Type -> (a -> b -> b) -> b -> t a -> b val foldlAbort : a ::: Type -> b ::: Type -> (a -> b -> option b) -> b -> t a -> option b val foldlMapAbort : a ::: Type -> b ::: Type -> c ::: Type -> (a -> b -> option (c * b)) -> b -> t a -> option (t c * b) +val foldli : a ::: Type -> b ::: Type + -> (int -> a -> b -> b) -> b -> t a -> b val foldr : a ::: Type -> b ::: Type -> (a -> b -> b) -> b -> t a -> b @@ -20,6 +22,10 @@ val append : a ::: Type -> t a -> t a -> t a val mp : a ::: Type -> b ::: Type -> (a -> b) -> t a -> t b +val mapConcat : a ::: Type -> b ::: Type -> (a -> t b) -> t a -> t b + +val mapConcatM : m ::: (Type -> Type) -> monad m -> a ::: Type -> b ::: Type -> (a -> m (t b)) -> t a -> m (t b) + val mapPartial : a ::: Type -> b ::: Type -> (a -> option b) -> t a -> t b val mapi : a ::: Type -> b ::: Type -> (int -> a -> b) -> t a -> t b @@ -31,6 +37,9 @@ val mapXi : a ::: Type -> ctx ::: {Unit} -> (int -> a -> xml ctx [] []) -> t a - val mapM : m ::: (Type -> Type) -> monad m -> a ::: Type -> b ::: Type -> (a -> m b) -> t a -> m (t b) +val mapMi : m ::: (Type -> Type) -> monad m -> a ::: Type -> b ::: Type + -> (int -> a -> m b) -> t a -> m (t b) + val mapPartialM : m ::: (Type -> Type) -> monad m -> a ::: Type -> b ::: Type -> (a -> m (option b)) -> t a -> m (t b) val mapXM : m ::: (Type -> Type) -> monad m -> a ::: Type -> ctx ::: {Unit} @@ -64,8 +73,12 @@ val findM : m ::: (Type -> Type) -> monad m -> a ::: Type -> (a -> m bool) -> t val search : a ::: Type -> b ::: Type -> (a -> option b) -> t a -> option b +val searchM : m ::: (Type -> Type) -> monad m -> a ::: Type -> b ::: Type -> (a -> m (option b)) -> t a -> m (option b) + val all : a ::: Type -> (a -> bool) -> t a -> bool +val allM : m ::: (Type -> Type) -> monad m -> a ::: Type -> (a -> m bool) -> t a -> m bool + val app : m ::: (Type -> Type) -> monad m -> a ::: Type -> (a -> m unit) -> t a -> m unit @@ -104,6 +117,9 @@ val assoc : a ::: Type -> b ::: Type -> eq a -> a -> t (a * b) -> option b val assocAdd : a ::: Type -> b ::: Type -> eq a -> a -> b -> t (a * b) -> t (a * b) +val assocAddSorted : a ::: Type -> b ::: Type -> eq a -> ord a -> a -> b -> t (a * b) -> t (a * b) +(* Assume the list is already sorted in ascending order and maintain that ordering. *) + (** Converting records to lists *) val recToList : a ::: Type -> r ::: {Unit} -> folder r -> $(mapU a r) -> t a |