module Toml.Parser.Types (
Key,
Expr(..),
Val(..),
SectionKind(..),
) where
import Data.List.NonEmpty (NonEmpty)
import Data.Time (Day, LocalTime, TimeOfDay, ZonedTime)
import Toml.Located (Located)
type Key = NonEmpty (Located String)
data Expr
= KeyValExpr Key Val
| TableExpr Key
| ArrayTableExpr Key
deriving (ReadPrec [Expr]
ReadPrec Expr
Int -> ReadS Expr
ReadS [Expr]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Expr]
$creadListPrec :: ReadPrec [Expr]
readPrec :: ReadPrec Expr
$creadPrec :: ReadPrec Expr
readList :: ReadS [Expr]
$creadList :: ReadS [Expr]
readsPrec :: Int -> ReadS Expr
$creadsPrec :: Int -> ReadS Expr
Read, Int -> Expr -> ShowS
[Expr] -> ShowS
Expr -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Expr] -> ShowS
$cshowList :: [Expr] -> ShowS
show :: Expr -> String
$cshow :: Expr -> String
showsPrec :: Int -> Expr -> ShowS
$cshowsPrec :: Int -> Expr -> ShowS
Show)
data Val
= ValInteger Integer
| ValFloat Double
| ValArray [Val]
| ValTable [(Key, Val)]
| ValBool Bool
| ValString String
| ValTimeOfDay TimeOfDay
| ValZonedTime ZonedTime
| ValLocalTime LocalTime
| ValDay Day
deriving (ReadPrec [Val]
ReadPrec Val
Int -> ReadS Val
ReadS [Val]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Val]
$creadListPrec :: ReadPrec [Val]
readPrec :: ReadPrec Val
$creadPrec :: ReadPrec Val
readList :: ReadS [Val]
$creadList :: ReadS [Val]
readsPrec :: Int -> ReadS Val
$creadsPrec :: Int -> ReadS Val
Read, Int -> Val -> ShowS
[Val] -> ShowS
Val -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Val] -> ShowS
$cshowList :: [Val] -> ShowS
show :: Val -> String
$cshow :: Val -> String
showsPrec :: Int -> Val -> ShowS
$cshowsPrec :: Int -> Val -> ShowS
Show)
data SectionKind
= TableKind
| ArrayTableKind
deriving (ReadPrec [SectionKind]
ReadPrec SectionKind
Int -> ReadS SectionKind
ReadS [SectionKind]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SectionKind]
$creadListPrec :: ReadPrec [SectionKind]
readPrec :: ReadPrec SectionKind
$creadPrec :: ReadPrec SectionKind
readList :: ReadS [SectionKind]
$creadList :: ReadS [SectionKind]
readsPrec :: Int -> ReadS SectionKind
$creadsPrec :: Int -> ReadS SectionKind
Read, Int -> SectionKind -> ShowS
[SectionKind] -> ShowS
SectionKind -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SectionKind] -> ShowS
$cshowList :: [SectionKind] -> ShowS
show :: SectionKind -> String
$cshow :: SectionKind -> String
showsPrec :: Int -> SectionKind -> ShowS
$cshowsPrec :: Int -> SectionKind -> ShowS
Show, SectionKind -> SectionKind -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SectionKind -> SectionKind -> Bool
$c/= :: SectionKind -> SectionKind -> Bool
== :: SectionKind -> SectionKind -> Bool
$c== :: SectionKind -> SectionKind -> Bool
Eq)