1module Data.Schematic.Path where
4import Data.Singletons.TypeLits
5import Data.Schematic.Utils
6import Data.Singletons.Prelude
10data PathSegment = Key Symbol | Ix Nat
12data instance Sing (jp :: PathSegment) where
13 SKey :: (KnownSymbol k, Known (Sing k)) => Sing (k :: Symbol) -> Sing (Key k)
14 SIx :: (KnownNat n, Known (Sing n)) => Sing (n :: Nat) -> Sing (Ix n)
16instance (KnownSymbol k, Known (Sing k))
17 => Known (Sing (Key k)) where
20instance (KnownNat n, Known (Sing n))
21 => Known (Sing (Ix n)) where
24pathToText :: Sing (ps :: [PathSegment]) -> Text
25pathToText = T.pack . go ""
27 go :: String -> Sing (ps :: [PathSegment]) -> String
29 go acc (SCons (SKey k) tl) = go (acc ++ "." ++ symbolVal k) tl
30 go acc (SCons (SIx n) tl) = go (acc ++ "[" ++ show (natVal n) ++ "]") tl
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list