module Chiasma.Data.DecodeError where

import Text.ParserCombinators.Parsec (ParseError)

data DecodeFailure =
  ParseFailure Text ParseError
  |
  IntParsingFailure Text
  |
  BoolParsingFailure Text
  |
  TooFewFields
  |
  TooManyFields [Text]
  |
  TooManyRecords [Text]
  |
  TargetMissing
  deriving stock (DecodeFailure -> DecodeFailure -> Bool
(DecodeFailure -> DecodeFailure -> Bool)
-> (DecodeFailure -> DecodeFailure -> Bool) -> Eq DecodeFailure
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DecodeFailure -> DecodeFailure -> Bool
== :: DecodeFailure -> DecodeFailure -> Bool
$c/= :: DecodeFailure -> DecodeFailure -> Bool
/= :: DecodeFailure -> DecodeFailure -> Bool
Eq, Int -> DecodeFailure -> ShowS
[DecodeFailure] -> ShowS
DecodeFailure -> String
(Int -> DecodeFailure -> ShowS)
-> (DecodeFailure -> String)
-> ([DecodeFailure] -> ShowS)
-> Show DecodeFailure
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DecodeFailure -> ShowS
showsPrec :: Int -> DecodeFailure -> ShowS
$cshow :: DecodeFailure -> String
show :: DecodeFailure -> String
$cshowList :: [DecodeFailure] -> ShowS
showList :: [DecodeFailure] -> ShowS
Show)

data DecodeError =
  DecodeError {
    DecodeError -> [Text]
output :: [Text],
    DecodeError -> DecodeFailure
failure :: DecodeFailure
  }
  deriving stock (DecodeError -> DecodeError -> Bool
(DecodeError -> DecodeError -> Bool)
-> (DecodeError -> DecodeError -> Bool) -> Eq DecodeError
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DecodeError -> DecodeError -> Bool
== :: DecodeError -> DecodeError -> Bool
$c/= :: DecodeError -> DecodeError -> Bool
/= :: DecodeError -> DecodeError -> Bool
Eq, Int -> DecodeError -> ShowS
[DecodeError] -> ShowS
DecodeError -> String
(Int -> DecodeError -> ShowS)
-> (DecodeError -> String)
-> ([DecodeError] -> ShowS)
-> Show DecodeError
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DecodeError -> ShowS
showsPrec :: Int -> DecodeError -> ShowS
$cshow :: DecodeError -> String
show :: DecodeError -> String
$cshowList :: [DecodeError] -> ShowS
showList :: [DecodeError] -> ShowS
Show)