def internal_head_reverse_go
import bend-mathlib@0.8.1.0/list.bend as Listimport Base
1793def internal_head_reverse_go(a, -A: Kind(a), xs: List<a, A>, -h: A, -acc: List<a, A>) -> {List.head(a, A, List.reverse.go(a, A, xs, h <> acc)) == Some{List.last.go(a, A, xs, h)} : Maybe<a, A>}:
1794 match xs:
1795 case Nil{}:
1796 {==}
1797 case y <> t:
1798 internal_head_reverse_go(a, A, t, y, h <> acc)