1module LetBoundVars (letBoundVars) where
6class LetBoundVars a where
7 letBoundVars :: a -> [String]
9instance LetBoundVars a => LetBoundVars [a] where
10 letBoundVars = concatMap letBoundVars
12instance LetBoundVars Statement where
15 Definition d -> letBoundVars d
16 Datatype _ _ tcs -> []
17 ImportEvent _ e _ _ -> letBoundVars e
18 ExportEvent _ _ _ -> []
19 TypeAnnotation _ _ -> []
22instance LetBoundVars Def where
23 letBoundVars (FnDef n _ e) = n : letBoundVars e
24 letBoundVars (OpDef _ _ _ e) = letBoundVars e
27instance LetBoundVars e => LetBoundVars (Context e) where
28 letBoundVars (C _ _ e) = letBoundVars e
30instance LetBoundVars Expr where
32 let f = letBoundVars in
39 Range e1 e2 -> f e1 ++ f e2
42 Insert e1 _ e2 -> f e1 ++ f e2
43 Modify e ps -> f e ++ concatMap (f . snd) ps
44 Record trps -> concatMap (\(_,_,e) -> f e) trps
45 Binop op e1 e2 -> f e1 ++ f e2
47 App e1 e2 -> f e1 ++ f e2
48 If e1 e2 e3 -> concatMap f [e1,e2,e3]
49 MultiIf ps -> concatMap (\(b,e) -> f b ++ f e) ps
50 Let defs e -> concatMap letBoundVars defs ++ f e
52 Data name es -> concatMap f es
53 Case e cases -> f e ++ concatMap (f . snd) cases
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