mirror of
https://github.com/edwinb/Idris2-boot.git
synced 2024-12-11 06:41:04 +03:00
c725d37488
This is the same as %auto_implicits in Idris 1, but with a more appropriate name, because auto implicits are something else. '%unbound_implicits off' turns off implicit forall bindings. See test basic033 for an example.
21 lines
517 B
Idris
21 lines
517 B
Idris
import Data.Vect
|
|
|
|
%unbound_implicits off
|
|
|
|
append : forall n, m, a . Vect n a -> Vect m a -> Vect (n + m) a
|
|
append [] ys = ys
|
|
append (x :: xs) ys = x :: append xs ys
|
|
|
|
data Env : forall n . Vect n Type -> Type where
|
|
ENil : Env []
|
|
ECons : forall t, ts . t -> Env ts -> Env (t :: ts)
|
|
|
|
-- fine because the only name used in bound, and it'll infer types for
|
|
-- xs and its indices
|
|
len : forall xs . Env xs -> Nat
|
|
|
|
-- neither of these are fine
|
|
len': Env xs -> Nat
|
|
append' : Vect n a -> Vect m a -> Vect (n + m) a
|
|
|