Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Idris have an equivalent to Agda's `_` expressions?

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?

like image 666
jmite Avatar asked Mar 10 '16 21:03

jmite


1 Answers

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
like image 97
Andy Morris Avatar answered Nov 20 '22 01:11

Andy Morris