I want to define a function out of an indexed higher inductive type, and am running into some problems.
Here is a somewhat contrived minimal example of what I'm doing:
{-# OPTIONS --cubical #-}
open import Cubical.Foundations.Prelude
using(_≡_ ; Type)
open import Data.Bool
using(Bool ; true ; false ; if_then_else_)
data Test : Type₀ where
point : Test
loop : Bool → point ≡ point
foo : Test → Bool
foo point = true
foo (loop x i) = if x then true else true
Clearly foo
is just a very roundabout way of writing const true
, but Agda protests saying:
true != if x then true else true of type Bool
when checking the definition of foo
Is there a way to write a function like this, in which the result depends on x
?
Alternatively, is there a reason it should not be possible?