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
It is currently necessary to pass down Scope n as an extra parameter in many functions, and then extend it manually via extendScope or extendScopePattern. However, it appears that the scopes can be extracted from the type directly via an approach a la singleton package or type level literals in GHC. In particular, the idea is that we could introduce the following typeclass
The Fresh constraint should ensure that i is indeed fresh in scope. I think, an alternative to adding this constraint is to hide ExtS from the user.
The definition of Fresh could follow something like this:
classFresh (i::Nat) (scope::S)
instanceFreshiVoidSinstance (Freshis, Not (i==j)) =>Freshi (ExtSjs)
However, I'm not sure the Not (i == j) part is possible to express properly in haskell, since type equality can yield False for polymorphic types and KnownNat is not enough to force i and j to be known statically.
It might be worth looking into permissive nominal terms1, as I have a strong suspicion that the foil is at least related to that.
Footnotes
Gilles Dowek, Murdoch J. Gabbay, Dominic P. Mulligan, Permissive nominal terms and their unification: an infinite, co-infinite approach to nominal techniques, Logic Journal of the IGPL, Volume 18, Issue 6, December 2010, Pages 769–822, https://doi.org/10.1093/jigpal/jzq006↩
The text was updated successfully, but these errors were encountered:
It is currently necessary to pass down
Scope n
as an extra parameter in many functions, and then extend it manually viaextendScope
orextendScopePattern
. However, it appears that the scopes can be extracted from the type directly via an approach a lasingleton
package or type level literals in GHC. In particular, the idea is that we could introduce the following typeclassOf course, the empty scope is known:
The tricky part is to make extended scopes known in functions like
withFresh
:One way to achieve this would be to extend data kind
S
:The
Fresh
constraint should ensure thati
is indeed fresh inscope
. I think, an alternative to adding this constraint is to hideExtS
from the user.The definition of
Fresh
could follow something like this:However, I'm not sure the
Not (i == j)
part is possible to express properly in haskell, since type equality can yieldFalse
for polymorphic types andKnownNat
is not enough to forcei
andj
to be known statically.It might be worth looking into permissive nominal terms1, as I have a strong suspicion that the foil is at least related to that.
Footnotes
Gilles Dowek, Murdoch J. Gabbay, Dominic P. Mulligan, Permissive nominal terms and their unification: an infinite, co-infinite approach to nominal techniques, Logic Journal of the IGPL, Volume 18, Issue 6, December 2010, Pages 769–822, https://doi.org/10.1093/jigpal/jzq006 ↩
The text was updated successfully, but these errors were encountered: