Documentation

PfsProgs25.Unit04.NatDouble

Match Examples #

To see how match works, we consider an example with Nat, which is a non-trivial inductive type. We will see how to define functions by recursion on Nat.

def Nat.double (n : ) :
Equations
Instances For

    Double of a natural number defined in a more complicated way.

    def Nat.double' (n : ) :
    Equations
    Instances For

      A non-terminating function defined using match.

      partial def Nat.notDouble (n : ) :