gitlab #177
Change-Id: I6cdcbbbe91f5074747eba64a9439e4f3ed123d60
then Nothing
else Just (remove l (Java.isub (size l) 1))
then Nothing
else Just (remove l (Java.isub (size l) 1))
+"Returns the first element of a list"
+@inline
+first :: T a -> <Proc> a
+first s = get s 0
+
+"Returns the last element of a list"
+@inline
+last :: T a -> <Proc> a
+last s = get s (Java.isub (size s) 1)
+
@inline
iter :: (a -> <e> ()) -> T a -> <e,Proc> ()
iter f s = Iterator.iter f (iterator s)
@inline
iter :: (a -> <e> ()) -> T a -> <e,Proc> ()
iter f s = Iterator.iter f (iterator s)