1{-# OPTIONS_GHC -Wall #-}
2{-# LANGUAGE OverloadedStrings #-}
3{-# LANGUAGE Rank2Types #-}
14import Data.Monoid ((<>))
15import qualified Data.Set as Set
16import qualified Data.Text as Text
18import qualified AST.Optimized as Opt
19import qualified AST.Module.Name as ModuleName
20import qualified Elm.Name as N
33 -> (Int -> Set.Set N.Name -> Set.Set Opt.Global -> a -> r)
38run :: Tracker a -> (Set.Set N.Name, Set.Set Opt.Global, a)
40 k 0 Set.empty Set.empty
41 (\_uid kernels globals value -> (kernels, globals, value))
44generate :: Tracker N.Name
46 Tracker $ \n k g ok ->
47 ok (n + 1) k g ("_n" <> Text.pack (show n))
50registerKernel :: N.Name -> a -> Tracker a
51registerKernel name value =
52 Tracker $ \n k g ok ->
53 ok n (Set.insert name k) g value
56registerGlobal :: ModuleName.Canonical -> N.Name -> Tracker Opt.Expr
57registerGlobal home name =
58 Tracker $ \n k g ok ->
59 let global = Opt.Global home name in
60 ok n k (Set.insert global g) (Opt.VarGlobal global)
67instance Functor Tracker where
68 fmap func (Tracker kv) =
69 Tracker $ \n k g ok ->
72 ok n1 k1 g1 (func value)
77instance Applicative Tracker where
80 Tracker $ \n k g ok -> ok n k g value
82 (<*>) (Tracker kf) (Tracker kv) =
83 Tracker $ \n0 k0 g0 ok ->
88 ok n2 k2 g2 (func value)
95instance Monad Tracker where
98 (>>=) (Tracker ka) callback =
99 Tracker $ \n k g ok ->
103 Tracker kb -> kb n1 k1 g1 ok
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