File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -16,11 +16,6 @@ import Stdlib.Trait.Foldable open using {
1616 fromPolymorphicFoldable;
1717};
1818
19- --- πͺ(1). Partial function that returns the first element of a ;List;.
20- phead {A} {{Partial}} : List A -> A
21- | (x :: _) := x
22- | nil := fail "head: empty list";
23-
2419instance
2520eqListI {A} {{Eq A}} : Eq (List A) :=
2621 let
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import Stdlib.Function open;
77import Stdlib.Data.Nat.Base open;
88import Stdlib.Data.Maybe.Base open;
99import Stdlib.Trait.Ord open;
10+ import Stdlib.Trait.Partial open;
1011import Stdlib.Data.Pair.Base open;
1112
1213--- πͺ(π). Returns ;true; if the given object elem is in the ;List;.
@@ -165,6 +166,11 @@ head {A} (defaultValue : A) (list : List A) : A :=
165166 | x :: _ := x
166167 | nil := defaultValue;
167168
169+ --- πͺ(1). Partial function that returns the first element of a ;List;.
170+ phead {A} {{Partial}} : List A -> A
171+ | (x :: _) := x
172+ | nil := fail "head: empty list";
173+
168174syntax iterator any {init := 0; range := 1};
169175
170176--- πͺ(π). Returns ;true; if at least one element of the ;List; satisfies the predicate.
You canβt perform that action at this time.
0 commit comments