Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Stdlib/Data/List/Base.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@ head {A} (defaultValue : A) (list : List A) : A :=
| x :: _ := x
| nil := defaultValue;

--- 𝒪(1). Grabs the first element of a ;List;
headMaybe {A} : List A -> Maybe A
| (x :: _) := just x
| nil := nothing;

syntax iterator any {init := 0; range := 1};

--- 𝒪(𝓃). Returns ;true; if at least one element of the ;List; satisfies the predicate.
Expand Down
Loading