mtonnberg / refinement-proofs / RefinementProofs.Proofs.ListProofs

Some basic list proofs

Definition


type NonEmptyList

A non-empty list


type SortedList

A sorted list

Proofs

proveNonEmptyList : List a -> Maybe (RefinementProofs.Theory.Proven (List a) NonEmptyList)

Prove that a list is non-empty

mkSortedList : List comparable -> RefinementProofs.Theory.Proven (List comparable) SortedList

Make a sorted list.

Functions

head : RefinementProofs.Theory.Proven (List a) NonEmptyList -> a

Safely get a head of a non-empty list

nonEmptyListMap : (a -> b) -> RefinementProofs.Theory.Proven (List a) NonEmptyList -> RefinementProofs.Theory.Proven (List b) NonEmptyList

Map over a non-empty list

lengthOfNonEmptyList : RefinementProofs.Theory.Proven (List a) NonEmptyList -> RefinementProofs.Theory.Proven Basics.Int RefinementProofs.Proofs.NumberProofs.Positive

Get the length of a non-empty list