Safe Haskell | Unsafe |
---|---|
Language | Haskell2010 |
de Bruijn indices for well-scoped terms.
Synopsis
- newtype Idx j where
- absurdIdx :: Idx EmptyCtx -> a
- unIdx :: a -> (Idx n -> a) -> Idx (S n) -> a
- idxToInt :: Idx ctx -> Int
- pattern I1 :: () => m ~ S (S n) => Idx m
- pattern I2 :: () => m ~ S (S (S n)) => Idx m
- pattern I3 :: () => m ~ S (S (S (S n))) => Idx m
- pattern I4 :: () => m ~ S (S (S (S (S n)))) => Idx m
- pattern I5 :: () => m ~ S (S (S (S (S (S n))))) => Idx m
- pattern I6 :: () => m ~ S (S (S (S (S (S (S n)))))) => Idx m
- pattern I7 :: () => m ~ S (S (S (S (S (S (S (S n))))))) => Idx m
- pattern I8 :: () => m ~ S (S (S (S (S (S (S (S (S n)))))))) => Idx m
- pattern I9 :: () => m ~ S (S (S (S (S (S (S (S (S (S n))))))))) => Idx m
de Bruijn indices
de Bruijn indices.
>>>
IS (IS (IS IZ))
3
absurdIdx :: Idx EmptyCtx -> a Source #
Derive anything from index into empty scope.
Note: don't use EmptyCase
on Idx
as it doesn't work for unsafe representation.