I have a Vehicle
type depending on a PowerSource
type:
data PowerSource = Petrol | Pedal | Electric
data Vehicle : PowerSource -> Type where
Unicycle : Vehicle Pedal
Motorcycle : (fuel: Nat) -> Vehicle Petrol
Tram: (battery : Nat) -> Vehicle Electric
and a function wheels
. Tram
is an unhandled case.
wheels : Vehicle power -> Nat
wheels Unicycle = 1
wheels Motorcycle = 2
When I check the total-ness of wheels
from the REPL,
:total wheels
Main.wheels is Total
As I did not handle the Tram
type in wheels
, I don't understand how wheels
can be total. Am I misunderstanding what 'total' mean?