1{-# OPTIONS_GHC -Wall #-}
2module Reporting.Annotation
13import Prelude hiding (drop, map)
14import qualified Data.List as List
15import Data.List.NonEmpty (NonEmpty((:|)))
16import qualified Data.Map as Map
17import Data.Semigroup ((<>))
18import Data.Text (Text)
19import qualified Reporting.Region as R
26data Annotated annotation a =
35 Annotated (R.Region, Maybe Text) a
42at :: R.Position -> R.Position -> a -> Located a
44 A (R.Region start end) value
47merge :: Located a -> Located b -> value -> Located value
48merge (A region1 _) (A region2 _) value =
49 A (R.merge region1 region2) value
52sameAs :: Annotated info a -> b -> Annotated info b
53sameAs (A annotation _) value =
61map :: (a -> b) -> Annotated info a -> Annotated info b
66drop :: Annotated info a -> a
75listToDict :: (Ord key) => (a -> key) -> [Annotated i a] -> Map.Map key (NonEmpty i)
76listToDict toKey list =
78 add dict (A info value) =
79 Map.insertWith (<>) (toKey value) (info :| []) dict
81 List.foldl' add Map.empty list
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