stackop :: Int -> AsolEvent () -> AsolEvent ()
stackop n op =
  do stack <- get
     if length stack < n
        then error "Stack underflow"
        else op
stackop :: Int -> AsolEvent () -> AsolEvent ()
stackop n op =
  do stack <- get
     if length stack < n
        then error "Stack underflow"
        else op
stackop n op =
  do stack <- get
     if length stack < n
        then error "Stack underflow"
        else op