Skip to content

Commit

Permalink
Add specialize pragma for find (#109)
Browse files Browse the repository at this point in the history
* Depends on anoma/juvix#2899
  • Loading branch information
lukaszcz authored Jul 15, 2024
1 parent 5062b32 commit 2ff6172
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Stdlib/Data/List/Base.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ elem {A} (eq : A → A → Bool) (s : A) : List A → Bool

--- 𝒪(𝓃). Returns the leftmost element of the list satisfying the predicate or
--- nothing if there's no such element.
{-# specialize: [1] #-}
find {A} (predicate : A → Bool) : List A → Maybe A
| nil := nothing
| (x :: xs) :=
Expand Down

0 comments on commit 2ff6172

Please sign in to comment.