1{-# OPTIONS_GHC -Wall #-}
2module Reporting.Annotation
18import Prelude hiding (traverse)
19import Control.Monad (liftM2)
20import Data.Binary (Binary, get, put)
21import Data.Word (Word16)
29 At Region a -- TODO see if unpacking region is helpful
32instance Functor Located where
33 fmap f (At region a) =
37traverse :: (Functor f) => (a -> f b) -> Located a -> f (Located b)
38traverse func (At region value) =
39 At region <$> func value
42toValue :: Located a -> a
47merge :: Located a -> Located b -> value -> Located value
48merge (At r1 _) (At r2 _) value =
49 At (mergeRegions r1 r2) value
58 {-# UNPACK #-} !Word16
59 {-# UNPACK #-} !Word16
63at :: Position -> Position -> a -> Located a
65 At (Region start end) a
72data Region = Region Position Position
76toRegion :: Located a -> Region
77toRegion (At region _) =
81mergeRegions :: Region -> Region -> Region
82mergeRegions (Region start _) (Region _ end) =
88 Region (Position 0 0) (Position 0 0)
93 Region (Position 1 1) (Position 1 1)
96instance Binary Region where
97 put (Region a b) = put a >> put b
98 get = liftM2 Region get get
101instance Binary Position where
102 put (Position a b) = put a >> put b
103 get = liftM2 Position get get
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