diff --git a/src/Data/Stack.hs b/src/Data/Stack.hs index 975827f6dbb1ba69d90067725e66516643629c5a..7907219ab26cabca3035771e072d045b04b96c81 100644 --- a/src/Data/Stack.hs +++ b/src/Data/Stack.hs @@ -95,7 +95,9 @@ clear s = writeSTRefU (tos s) 0 -- | Insert a new element on top of the stack. -- --- Runtime: O(1) +-- This will reallocate the underlying memory if needed. +-- +-- Runtime: Amortized O(1) push :: VM.Unbox a => Stack s a -> a -> ST s () push s x = do currentTos <- readSTRefU (tos s)