-module(stack). -compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). -export([new/0, push/2, is_empty/1]). -export_type([stack/1]). -opaque stack(FJS) :: {stack, list(FJS)}. -spec new() -> stack(any()). new() -> {stack, []}. -spec push(stack(FJV), FJV) -> stack(FJV). push(S, New_element) -> {stack, [New_element | erlang:element(2, S)]}. -spec is_empty(stack(any())) -> boolean(). is_empty(S) -> gleam@list:is_empty(erlang:element(2, S)).