1{-# OPTIONS_GHC -Wall #-}
2{-# LANGUAGE OverloadedStrings #-}
9import Data.Foldable (foldrM)
10import qualified Data.Map.Strict as Map
12import Type.Type as Type
13import qualified Type.UnionFind as UF
20occurs :: Type.Variable -> IO Bool
22 occursHelp [] var False
25occursHelp :: [Type.Variable] -> Type.Variable -> Bool -> IO Bool
26occursHelp seen var foundCycle =
31 do (Descriptor content _ _ _) <- UF.get var
46 let newSeen = var : seen in
49 foldrM (occursHelp newSeen) foundCycle args
52 occursHelp newSeen a =<<
53 occursHelp newSeen b foundCycle
59 occursHelp newSeen ext =<<
60 foldrM (occursHelp newSeen) foundCycle (Map.elems fields)
68 occursHelp newSeen a =<<
69 occursHelp newSeen b foundCycle
72 occursHelp newSeen a =<<
73 occursHelp newSeen b =<<
74 occursHelp newSeen c foundCycle
77 foldrM (occursHelp (var:seen)) foundCycle (map snd args)
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