6

In addition to having implicit arguments, Agda lets you omit the value of an explicit argument and replace it with a metavariable, denoted by the _ character, whose value is then determined through the same procedure as implicit resolution.

Does Idris have a similar feature, or are implicit arguments the only way of introducing metavariables into programs?

jmite
  • 8,171
  • 6
  • 40
  • 81

1 Answers1

8

You can use _ in Idris as well.

import Data.Vect

foo : (n : Nat) -> Vect n a -> Vect n a
foo n xs = xs

bar : Vect 3 Nat
bar = foo _ [1, 2, 3]   -- works
Andy Morris
  • 720
  • 3
  • 10
  • Looks like I missed this, thought it was invalid because I had other syntax errors! Either way, it's not very clearly documented. Thanks! – jmite Mar 14 '16 at 20:30