You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I faced a strange behavior when I was trying to get an implicit variable.
Steps to Reproduce
module ImplicitCatchImp
All: (a : i -> Type) ->TypeAll a {i} = {j: i} -> a j
infixr1:->
(:->) : (a, b : i ->Type) -> (i ->Type)
(:->) a b i = a i -> b i
record Parser (a:Type) (n : Nat) where
constructor MkParserRunParser:List Char ->List a
guardM: (a ->Maybe b) -> All (Parser a :-> Parser b)
guardM f {a} {b} =?guardM_rhs
This is how the hole looks like
ImplicitCatchImp.guardM_rhs [P]
`-- b : Type
a : Type
f : a -> Maybe b
j : Nat
--------------------------------------------------------
ImplicitCatchImp.guardM_rhs : Parser a j -> Parser b j
So, everything is just as it should be (as I see). Now, I try to access j:
guardM: (a ->Maybe b) -> All (Parser a :-> Parser b)
guardM f {a} {b} {j} =?guardM_rhs
And this is how the hole looks like now
- + ImplicitCatchImp.guardM_rhs [P]
`-- j : Type
b : Type
a : b -> Maybe j
j1 : Nat
f : Parser b j1
--------------------------------------------
ImplicitCatchImp.guardM_rhs : Parser j j1
So, it renamed j to j1 and I'm not able to get access to it. When I try to get j1 it answers that j1 is not an implicit argument of ImplicitCatchImp.guardM. That is true...
Expected Behavior
j of type Nat should be in scope
Observed Behavior
j has type Type and needed variable is ranamed to j1
There are many issues with implicit arguments but I think most close to this one are #2258 and #4206
The text was updated successfully, but these errors were encountered:
andreykl
changed the title
unable go get implicit variable
unable to get implicit variable
Nov 17, 2018
The syntax you need here is guardM f {a} {b} = \{j} => ... aka implicit lambda arguments, but this is currently not supported and, from what I understand, is likely to not be added before Idris 2.
andreykl
changed the title
unable to get implicit variable
Feature request: implicit lambda arguments syntax
Nov 17, 2018
I faced a strange behavior when I was trying to get an implicit variable.
Steps to Reproduce
This is how the hole looks like
So, everything is just as it should be (as I see). Now, I try to access j:
And this is how the hole looks like now
So, it renamed
j
toj1
and I'm not able to get access to it. When I try to getj1
it answers thatj1
is not an implicit argument of ImplicitCatchImp.guardM. That is true...Expected Behavior
j
of typeNat
should be in scopeObserved Behavior
j
has typeType
and needed variable is ranamed toj1
There are many issues with implicit arguments but I think most close to this one are #2258 and #4206
The text was updated successfully, but these errors were encountered: