diff --git a/Stdlib/Data/List/Base.juvix b/Stdlib/Data/List/Base.juvix index 589836ff..4ea06ecd 100644 --- a/Stdlib/Data/List/Base.juvix +++ b/Stdlib/Data/List/Base.juvix @@ -96,6 +96,10 @@ drop {A} : (elemsNum : Nat) -> (list : List A) -> List A | (suc n) (x :: xs) := drop n xs | _ xs := xs; +--- Take the nth value of a ;List; +nth {A} : Nat -> List A -> Maybe A + | n := drop n >> headMaybe; + --- 𝒪(𝓃). Returns a tuple where first element is the --- prefix of the given list of length prefixLength and second element is the --- remainder of the ;List;.