def peek
import bend-collections@1.0.0.0/src/containers/stack.bend as Stackimport Base
import bend-collections@1.0.0.0/src/containers/types/stack.bend as E
27def peek(~T: Data, s: Stack<T>) -> Stack<T> & Result<&2, &2, E.Error, T>:
28 match s:
29 case ST{Nil{}, n}:
30 (ST{Nil{}, n}, Fail{E.EmptyStack{}})
31 case ST{Con{+x, xs}, n}:
32 (ST{Con{x, xs}, n}, Done{x})