1{-# LANGUAGE OverloadedStrings #-}
2module Reporting.Error where
4import Data.Aeson ((.=))
5import qualified Data.Aeson as Json
6import qualified Data.ByteString.Lazy.Char8 as BS
8import qualified Reporting.Annotation as A
9import qualified Reporting.Error.Canonicalize as Canonicalize
10import qualified Reporting.Error.Syntax as Syntax
11import qualified Reporting.Error.Type as Type
12import qualified Reporting.Error.CheckMatch as CheckMatch
19 | Canonicalize Canonicalize.Error
21 | CheckMatch CheckMatch.Error
26toString :: A.Located Error -> String
27toString (A.A region err) =
30 Syntax.toString region syntaxError
32 Canonicalize canonicalizeError ->
33 Canonicalize.toString region canonicalizeError
36 Type.toString region typeError
38 CheckMatch matchError ->
39 CheckMatch.toString region matchError
43toJson :: A.Located Error -> String
44toJson (A.A region err) =
48 Syntax.toJson syntaxError
50 Canonicalize canonicalizeError ->
51 Canonicalize.toJson canonicalizeError
56 CheckMatch matchError ->
57 CheckMatch.toJson matchError
59 BS.unpack $ Json.encode $
61 [ "tag" .= ("error" :: String)
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