Idris2Doc : Chem.Parity

Chem.Parity

(source)

Definitions

data Parity : Type
Totality: total
Visibility: public export
Constructors:
Even : Parity
Odd : Parity

Hints:
Cast Nat Parity
Eq Parity
Monoid Parity
Ord Parity
Semigroup Parity
Show Parity
parity : Ord a => List a -> Parity
  Computes the parity of a permutation, that is, the number
of swaps required to convert the given list into an ordered
list.

Note: The list is expected to hold no duplicates

Totality: total
Visibility: export
sameParity : Ord a => List a -> List a -> Bool
  Tests if the given two permutations have the same parity.

Does not verify if the two lists are actually permutations of
the same sequence.

Totality: total
Visibility: export