0

The following Idris definition typechecks with Idris 1.3.0:

foo : (xs : List Nat) -> xs = ([] <+> xs)
foo xs = Refl

however, this doesn't:

foo : (xs : List Nat) -> xs = (neutral <+> xs)
foo xs = Refl

giving the following type error:

 When checking right hand side of foo with expected type
         xs = neutral <+> xs

 Type mismatch between
         neutral ++ xs = neutral ++ xs (Type of Refl)
 and
         xs = neutral ++ xs (Expected type)

 Specifically:
         Type mismatch between
                 neutral ++ xs
         and
                 xs

Why does neutral <+> xs not normalize to xs here?

Cactus
  • 27,075
  • 9
  • 69
  • 149

1 Answers1

1

neutral will be interpreted as a implicit argument because it's lower case and appears in a type declaration. But you can just specify the module. :doc neutral gives me Prelude.Algebra.neutral:

foo : (xs : List Nat) -> xs = (Algebra.neutral <+> xs)
foo xs = Refl
xash
  • 3,702
  • 10
  • 22