definition: |
toJson :: Config -> String -> [SrcLine] -> Message -> JValue toJson conf name _ m = case m of (Message (Span (Position l1 c1) (Position l2 c2)) sW sH) -> JObject [ ("file", JString name) , ("span", JObject [ ("from", JObject [ ("line" , JNumber (toFloat l1)) , ("column", JNumber (toFloat c1))]) , ("to", JObject [ ("line" , JNumber (toFloat l2)) , ("column", JNumber (toFloat c2))]) ]) , ("warning", JString (pPrint (warningToDoc sW))) , ("hint", JString (pPrint (hintToDoc conf sH))) ] _ -> error "toJson: Invalid Span" |
demand: |
argument 4 |
deterministic: |
deterministic operation |
documentation: |
-- Renders a single message with fields: -- [ ("file" : string), -- ("span" : -- ("from" : -- [("line" : number), ("column" : number)]) -- ("to" : -- [("line" : number), ("column" : number)])), -- ("warning" : string), -- ("hint" : string) -- ] |
failfree: |
(_, _, _, _) |
indeterministic: |
referentially transparent operation |
infix: |
no fixity defined |
iotype: |
{(_,_,_,{Message}) |-> {JObject}} |
name: |
toJson |
precedence: |
no precedence defined |
result-values: |
{JObject} |
signature: |
Types.Config -> String -> [(Prelude.Int, String)] -> Types.Message -> JSON.Data.JValue |
solution-complete: |
operation might suspend on free variables |
terminating: |
possibly non-terminating |
totally-defined: |
possibly non-reducible on same data term |