On one hand, I can use #_
to construct Fin
s from literals:
open import Data.Fin
data I'mFinnish : Set where
Mk : Fin 5 → I'mFinnish
foo : I'mFinnish
foo = Mk (# 3)
On the other hand, I can use literals to pattern match on naturals:
open import Data.Nat
data I'mANatural : Set where
Mk : ℕ → I'mANatural
open import Data.Bool
bar : I'mANatural → Bool
bar (Mk 3) = true
bar _ = false
My question is, can I, on the gripping hand, use literals when matching on Fin
s? I.e., what can I do to approximate the following, invalid as-is, Agda code:
open import Data.Bool
bar′ : I'mFinnish → Bool
bar′ (Mk 3) = true
bar′ _ = false