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
18 | Canonicalize Canonicalize.Error
24toString :: A.Located Error -> String
25toString (A.A region err) =
28 Syntax.toString region syntaxError
30 Canonicalize canonicalizeError ->
31 Canonicalize.toString region canonicalizeError
34 Type.toString region typeError
39toJson :: A.Located Error -> String
40toJson (A.A region err) =
44 Syntax.toJson syntaxError
46 Canonicalize canonicalizeError ->
47 Canonicalize.toJson canonicalizeError
52 BS.unpack $ Json.encode $
54 [ "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