-- | A model which provides a common syntax tree for Hydra serializers

module Hydra.Util.Codetree.Ast where

import qualified Hydra.Core as Core
import Data.List
import Data.Map
import Data.Set

-- | Operator associativity
data Associativity = 
  AssociativityNone  |
  AssociativityLeft  |
  AssociativityRight  |
  AssociativityBoth 
  deriving (Associativity -> Associativity -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Associativity -> Associativity -> Bool
$c/= :: Associativity -> Associativity -> Bool
== :: Associativity -> Associativity -> Bool
$c== :: Associativity -> Associativity -> Bool
Eq, Eq Associativity
Associativity -> Associativity -> Bool
Associativity -> Associativity -> Ordering
Associativity -> Associativity -> Associativity
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Associativity -> Associativity -> Associativity
$cmin :: Associativity -> Associativity -> Associativity
max :: Associativity -> Associativity -> Associativity
$cmax :: Associativity -> Associativity -> Associativity
>= :: Associativity -> Associativity -> Bool
$c>= :: Associativity -> Associativity -> Bool
> :: Associativity -> Associativity -> Bool
$c> :: Associativity -> Associativity -> Bool
<= :: Associativity -> Associativity -> Bool
$c<= :: Associativity -> Associativity -> Bool
< :: Associativity -> Associativity -> Bool
$c< :: Associativity -> Associativity -> Bool
compare :: Associativity -> Associativity -> Ordering
$ccompare :: Associativity -> Associativity -> Ordering
Ord, ReadPrec [Associativity]
ReadPrec Associativity
Int -> ReadS Associativity
ReadS [Associativity]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Associativity]
$creadListPrec :: ReadPrec [Associativity]
readPrec :: ReadPrec Associativity
$creadPrec :: ReadPrec Associativity
readList :: ReadS [Associativity]
$creadList :: ReadS [Associativity]
readsPrec :: Int -> ReadS Associativity
$creadsPrec :: Int -> ReadS Associativity
Read, Int -> Associativity -> ShowS
[Associativity] -> ShowS
Associativity -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Associativity] -> ShowS
$cshowList :: [Associativity] -> ShowS
show :: Associativity -> String
$cshow :: Associativity -> String
showsPrec :: Int -> Associativity -> ShowS
$cshowsPrec :: Int -> Associativity -> ShowS
Show)

_Associativity :: Name
_Associativity = (String -> Name
Core.Name String
"hydra/util/codetree/ast.Associativity")

_Associativity_none :: FieldName
_Associativity_none = (String -> FieldName
Core.FieldName String
"none")

_Associativity_left :: FieldName
_Associativity_left = (String -> FieldName
Core.FieldName String
"left")

_Associativity_right :: FieldName
_Associativity_right = (String -> FieldName
Core.FieldName String
"right")

_Associativity_both :: FieldName
_Associativity_both = (String -> FieldName
Core.FieldName String
"both")

-- | Formatting option for code blocks
data BlockStyle = 
  BlockStyle {
    BlockStyle -> Bool
blockStyleIndent :: Bool,
    BlockStyle -> Bool
blockStyleNewlineBeforeContent :: Bool,
    BlockStyle -> Bool
blockStyleNewlineAfterContent :: Bool}
  deriving (BlockStyle -> BlockStyle -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BlockStyle -> BlockStyle -> Bool
$c/= :: BlockStyle -> BlockStyle -> Bool
== :: BlockStyle -> BlockStyle -> Bool
$c== :: BlockStyle -> BlockStyle -> Bool
Eq, Eq BlockStyle
BlockStyle -> BlockStyle -> Bool
BlockStyle -> BlockStyle -> Ordering
BlockStyle -> BlockStyle -> BlockStyle
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: BlockStyle -> BlockStyle -> BlockStyle
$cmin :: BlockStyle -> BlockStyle -> BlockStyle
max :: BlockStyle -> BlockStyle -> BlockStyle
$cmax :: BlockStyle -> BlockStyle -> BlockStyle
>= :: BlockStyle -> BlockStyle -> Bool
$c>= :: BlockStyle -> BlockStyle -> Bool
> :: BlockStyle -> BlockStyle -> Bool
$c> :: BlockStyle -> BlockStyle -> Bool
<= :: BlockStyle -> BlockStyle -> Bool
$c<= :: BlockStyle -> BlockStyle -> Bool
< :: BlockStyle -> BlockStyle -> Bool
$c< :: BlockStyle -> BlockStyle -> Bool
compare :: BlockStyle -> BlockStyle -> Ordering
$ccompare :: BlockStyle -> BlockStyle -> Ordering
Ord, ReadPrec [BlockStyle]
ReadPrec BlockStyle
Int -> ReadS BlockStyle
ReadS [BlockStyle]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BlockStyle]
$creadListPrec :: ReadPrec [BlockStyle]
readPrec :: ReadPrec BlockStyle
$creadPrec :: ReadPrec BlockStyle
readList :: ReadS [BlockStyle]
$creadList :: ReadS [BlockStyle]
readsPrec :: Int -> ReadS BlockStyle
$creadsPrec :: Int -> ReadS BlockStyle
Read, Int -> BlockStyle -> ShowS
[BlockStyle] -> ShowS
BlockStyle -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BlockStyle] -> ShowS
$cshowList :: [BlockStyle] -> ShowS
show :: BlockStyle -> String
$cshow :: BlockStyle -> String
showsPrec :: Int -> BlockStyle -> ShowS
$cshowsPrec :: Int -> BlockStyle -> ShowS
Show)

_BlockStyle :: Name
_BlockStyle = (String -> Name
Core.Name String
"hydra/util/codetree/ast.BlockStyle")

_BlockStyle_indent :: FieldName
_BlockStyle_indent = (String -> FieldName
Core.FieldName String
"indent")

_BlockStyle_newlineBeforeContent :: FieldName
_BlockStyle_newlineBeforeContent = (String -> FieldName
Core.FieldName String
"newlineBeforeContent")

_BlockStyle_newlineAfterContent :: FieldName
_BlockStyle_newlineAfterContent = (String -> FieldName
Core.FieldName String
"newlineAfterContent")

-- | An expression enclosed by brackets
data BracketExpr = 
  BracketExpr {
    BracketExpr -> Brackets
bracketExprBrackets :: Brackets,
    BracketExpr -> Expr
bracketExprEnclosed :: Expr,
    BracketExpr -> BlockStyle
bracketExprStyle :: BlockStyle}
  deriving (BracketExpr -> BracketExpr -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BracketExpr -> BracketExpr -> Bool
$c/= :: BracketExpr -> BracketExpr -> Bool
== :: BracketExpr -> BracketExpr -> Bool
$c== :: BracketExpr -> BracketExpr -> Bool
Eq, Eq BracketExpr
BracketExpr -> BracketExpr -> Bool
BracketExpr -> BracketExpr -> Ordering
BracketExpr -> BracketExpr -> BracketExpr
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: BracketExpr -> BracketExpr -> BracketExpr
$cmin :: BracketExpr -> BracketExpr -> BracketExpr
max :: BracketExpr -> BracketExpr -> BracketExpr
$cmax :: BracketExpr -> BracketExpr -> BracketExpr
>= :: BracketExpr -> BracketExpr -> Bool
$c>= :: BracketExpr -> BracketExpr -> Bool
> :: BracketExpr -> BracketExpr -> Bool
$c> :: BracketExpr -> BracketExpr -> Bool
<= :: BracketExpr -> BracketExpr -> Bool
$c<= :: BracketExpr -> BracketExpr -> Bool
< :: BracketExpr -> BracketExpr -> Bool
$c< :: BracketExpr -> BracketExpr -> Bool
compare :: BracketExpr -> BracketExpr -> Ordering
$ccompare :: BracketExpr -> BracketExpr -> Ordering
Ord, ReadPrec [BracketExpr]
ReadPrec BracketExpr
Int -> ReadS BracketExpr
ReadS [BracketExpr]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BracketExpr]
$creadListPrec :: ReadPrec [BracketExpr]
readPrec :: ReadPrec BracketExpr
$creadPrec :: ReadPrec BracketExpr
readList :: ReadS [BracketExpr]
$creadList :: ReadS [BracketExpr]
readsPrec :: Int -> ReadS BracketExpr
$creadsPrec :: Int -> ReadS BracketExpr
Read, Int -> BracketExpr -> ShowS
[BracketExpr] -> ShowS
BracketExpr -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BracketExpr] -> ShowS
$cshowList :: [BracketExpr] -> ShowS
show :: BracketExpr -> String
$cshow :: BracketExpr -> String
showsPrec :: Int -> BracketExpr -> ShowS
$cshowsPrec :: Int -> BracketExpr -> ShowS
Show)

_BracketExpr :: Name
_BracketExpr = (String -> Name
Core.Name String
"hydra/util/codetree/ast.BracketExpr")

_BracketExpr_brackets :: FieldName
_BracketExpr_brackets = (String -> FieldName
Core.FieldName String
"brackets")

_BracketExpr_enclosed :: FieldName
_BracketExpr_enclosed = (String -> FieldName
Core.FieldName String
"enclosed")

_BracketExpr_style :: FieldName
_BracketExpr_style = (String -> FieldName
Core.FieldName String
"style")

-- | Matching open and close bracket symbols
data Brackets = 
  Brackets {
    Brackets -> Symbol
bracketsOpen :: Symbol,
    Brackets -> Symbol
bracketsClose :: Symbol}
  deriving (Brackets -> Brackets -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Brackets -> Brackets -> Bool
$c/= :: Brackets -> Brackets -> Bool
== :: Brackets -> Brackets -> Bool
$c== :: Brackets -> Brackets -> Bool
Eq, Eq Brackets
Brackets -> Brackets -> Bool
Brackets -> Brackets -> Ordering
Brackets -> Brackets -> Brackets
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Brackets -> Brackets -> Brackets
$cmin :: Brackets -> Brackets -> Brackets
max :: Brackets -> Brackets -> Brackets
$cmax :: Brackets -> Brackets -> Brackets
>= :: Brackets -> Brackets -> Bool
$c>= :: Brackets -> Brackets -> Bool
> :: Brackets -> Brackets -> Bool
$c> :: Brackets -> Brackets -> Bool
<= :: Brackets -> Brackets -> Bool
$c<= :: Brackets -> Brackets -> Bool
< :: Brackets -> Brackets -> Bool
$c< :: Brackets -> Brackets -> Bool
compare :: Brackets -> Brackets -> Ordering
$ccompare :: Brackets -> Brackets -> Ordering
Ord, ReadPrec [Brackets]
ReadPrec Brackets
Int -> ReadS Brackets
ReadS [Brackets]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Brackets]
$creadListPrec :: ReadPrec [Brackets]
readPrec :: ReadPrec Brackets
$creadPrec :: ReadPrec Brackets
readList :: ReadS [Brackets]
$creadList :: ReadS [Brackets]
readsPrec :: Int -> ReadS Brackets
$creadsPrec :: Int -> ReadS Brackets
Read, Int -> Brackets -> ShowS
[Brackets] -> ShowS
Brackets -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Brackets] -> ShowS
$cshowList :: [Brackets] -> ShowS
show :: Brackets -> String
$cshow :: Brackets -> String
showsPrec :: Int -> Brackets -> ShowS
$cshowsPrec :: Int -> Brackets -> ShowS
Show)

_Brackets :: Name
_Brackets = (String -> Name
Core.Name String
"hydra/util/codetree/ast.Brackets")

_Brackets_open :: FieldName
_Brackets_open = (String -> FieldName
Core.FieldName String
"open")

_Brackets_close :: FieldName
_Brackets_close = (String -> FieldName
Core.FieldName String
"close")

-- | An abstract expression
data Expr = 
  ExprConst Symbol |
  ExprOp OpExpr |
  ExprBrackets BracketExpr
  deriving (Expr -> Expr -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Expr -> Expr -> Bool
$c/= :: Expr -> Expr -> Bool
== :: Expr -> Expr -> Bool
$c== :: Expr -> Expr -> Bool
Eq, Eq Expr
Expr -> Expr -> Bool
Expr -> Expr -> Ordering
Expr -> Expr -> Expr
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Expr -> Expr -> Expr
$cmin :: Expr -> Expr -> Expr
max :: Expr -> Expr -> Expr
$cmax :: Expr -> Expr -> Expr
>= :: Expr -> Expr -> Bool
$c>= :: Expr -> Expr -> Bool
> :: Expr -> Expr -> Bool
$c> :: Expr -> Expr -> Bool
<= :: Expr -> Expr -> Bool
$c<= :: Expr -> Expr -> Bool
< :: Expr -> Expr -> Bool
$c< :: Expr -> Expr -> Bool
compare :: Expr -> Expr -> Ordering
$ccompare :: Expr -> Expr -> Ordering
Ord, 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)

_Expr :: Name
_Expr = (String -> Name
Core.Name String
"hydra/util/codetree/ast.Expr")

_Expr_const :: FieldName
_Expr_const = (String -> FieldName
Core.FieldName String
"const")

_Expr_op :: FieldName
_Expr_op = (String -> FieldName
Core.FieldName String
"op")

_Expr_brackets :: FieldName
_Expr_brackets = (String -> FieldName
Core.FieldName String
"brackets")

-- | An operator symbol
data Op = 
  Op {
    Op -> Symbol
opSymbol :: Symbol,
    Op -> Padding
opPadding :: Padding,
    Op -> Precedence
opPrecedence :: Precedence,
    Op -> Associativity
opAssociativity :: Associativity}
  deriving (Op -> Op -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Op -> Op -> Bool
$c/= :: Op -> Op -> Bool
== :: Op -> Op -> Bool
$c== :: Op -> Op -> Bool
Eq, Eq Op
Op -> Op -> Bool
Op -> Op -> Ordering
Op -> Op -> Op
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Op -> Op -> Op
$cmin :: Op -> Op -> Op
max :: Op -> Op -> Op
$cmax :: Op -> Op -> Op
>= :: Op -> Op -> Bool
$c>= :: Op -> Op -> Bool
> :: Op -> Op -> Bool
$c> :: Op -> Op -> Bool
<= :: Op -> Op -> Bool
$c<= :: Op -> Op -> Bool
< :: Op -> Op -> Bool
$c< :: Op -> Op -> Bool
compare :: Op -> Op -> Ordering
$ccompare :: Op -> Op -> Ordering
Ord, ReadPrec [Op]
ReadPrec Op
Int -> ReadS Op
ReadS [Op]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Op]
$creadListPrec :: ReadPrec [Op]
readPrec :: ReadPrec Op
$creadPrec :: ReadPrec Op
readList :: ReadS [Op]
$creadList :: ReadS [Op]
readsPrec :: Int -> ReadS Op
$creadsPrec :: Int -> ReadS Op
Read, Int -> Op -> ShowS
[Op] -> ShowS
Op -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Op] -> ShowS
$cshowList :: [Op] -> ShowS
show :: Op -> String
$cshow :: Op -> String
showsPrec :: Int -> Op -> ShowS
$cshowsPrec :: Int -> Op -> ShowS
Show)

_Op :: Name
_Op = (String -> Name
Core.Name String
"hydra/util/codetree/ast.Op")

_Op_symbol :: FieldName
_Op_symbol = (String -> FieldName
Core.FieldName String
"symbol")

_Op_padding :: FieldName
_Op_padding = (String -> FieldName
Core.FieldName String
"padding")

_Op_precedence :: FieldName
_Op_precedence = (String -> FieldName
Core.FieldName String
"precedence")

_Op_associativity :: FieldName
_Op_associativity = (String -> FieldName
Core.FieldName String
"associativity")

-- | An operator expression
data OpExpr = 
  OpExpr {
    OpExpr -> Op
opExprOp :: Op,
    OpExpr -> Expr
opExprLhs :: Expr,
    OpExpr -> Expr
opExprRhs :: Expr}
  deriving (OpExpr -> OpExpr -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OpExpr -> OpExpr -> Bool
$c/= :: OpExpr -> OpExpr -> Bool
== :: OpExpr -> OpExpr -> Bool
$c== :: OpExpr -> OpExpr -> Bool
Eq, Eq OpExpr
OpExpr -> OpExpr -> Bool
OpExpr -> OpExpr -> Ordering
OpExpr -> OpExpr -> OpExpr
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: OpExpr -> OpExpr -> OpExpr
$cmin :: OpExpr -> OpExpr -> OpExpr
max :: OpExpr -> OpExpr -> OpExpr
$cmax :: OpExpr -> OpExpr -> OpExpr
>= :: OpExpr -> OpExpr -> Bool
$c>= :: OpExpr -> OpExpr -> Bool
> :: OpExpr -> OpExpr -> Bool
$c> :: OpExpr -> OpExpr -> Bool
<= :: OpExpr -> OpExpr -> Bool
$c<= :: OpExpr -> OpExpr -> Bool
< :: OpExpr -> OpExpr -> Bool
$c< :: OpExpr -> OpExpr -> Bool
compare :: OpExpr -> OpExpr -> Ordering
$ccompare :: OpExpr -> OpExpr -> Ordering
Ord, ReadPrec [OpExpr]
ReadPrec OpExpr
Int -> ReadS OpExpr
ReadS [OpExpr]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OpExpr]
$creadListPrec :: ReadPrec [OpExpr]
readPrec :: ReadPrec OpExpr
$creadPrec :: ReadPrec OpExpr
readList :: ReadS [OpExpr]
$creadList :: ReadS [OpExpr]
readsPrec :: Int -> ReadS OpExpr
$creadsPrec :: Int -> ReadS OpExpr
Read, Int -> OpExpr -> ShowS
[OpExpr] -> ShowS
OpExpr -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OpExpr] -> ShowS
$cshowList :: [OpExpr] -> ShowS
show :: OpExpr -> String
$cshow :: OpExpr -> String
showsPrec :: Int -> OpExpr -> ShowS
$cshowsPrec :: Int -> OpExpr -> ShowS
Show)

_OpExpr :: Name
_OpExpr = (String -> Name
Core.Name String
"hydra/util/codetree/ast.OpExpr")

_OpExpr_op :: FieldName
_OpExpr_op = (String -> FieldName
Core.FieldName String
"op")

_OpExpr_lhs :: FieldName
_OpExpr_lhs = (String -> FieldName
Core.FieldName String
"lhs")

_OpExpr_rhs :: FieldName
_OpExpr_rhs = (String -> FieldName
Core.FieldName String
"rhs")

-- | Left and right padding for an operator
data Padding = 
  Padding {
    Padding -> Ws
paddingLeft :: Ws,
    Padding -> Ws
paddingRight :: Ws}
  deriving (Padding -> Padding -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Padding -> Padding -> Bool
$c/= :: Padding -> Padding -> Bool
== :: Padding -> Padding -> Bool
$c== :: Padding -> Padding -> Bool
Eq, Eq Padding
Padding -> Padding -> Bool
Padding -> Padding -> Ordering
Padding -> Padding -> Padding
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Padding -> Padding -> Padding
$cmin :: Padding -> Padding -> Padding
max :: Padding -> Padding -> Padding
$cmax :: Padding -> Padding -> Padding
>= :: Padding -> Padding -> Bool
$c>= :: Padding -> Padding -> Bool
> :: Padding -> Padding -> Bool
$c> :: Padding -> Padding -> Bool
<= :: Padding -> Padding -> Bool
$c<= :: Padding -> Padding -> Bool
< :: Padding -> Padding -> Bool
$c< :: Padding -> Padding -> Bool
compare :: Padding -> Padding -> Ordering
$ccompare :: Padding -> Padding -> Ordering
Ord, ReadPrec [Padding]
ReadPrec Padding
Int -> ReadS Padding
ReadS [Padding]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Padding]
$creadListPrec :: ReadPrec [Padding]
readPrec :: ReadPrec Padding
$creadPrec :: ReadPrec Padding
readList :: ReadS [Padding]
$creadList :: ReadS [Padding]
readsPrec :: Int -> ReadS Padding
$creadsPrec :: Int -> ReadS Padding
Read, Int -> Padding -> ShowS
[Padding] -> ShowS
Padding -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Padding] -> ShowS
$cshowList :: [Padding] -> ShowS
show :: Padding -> String
$cshow :: Padding -> String
showsPrec :: Int -> Padding -> ShowS
$cshowsPrec :: Int -> Padding -> ShowS
Show)

_Padding :: Name
_Padding = (String -> Name
Core.Name String
"hydra/util/codetree/ast.Padding")

_Padding_left :: FieldName
_Padding_left = (String -> FieldName
Core.FieldName String
"left")

_Padding_right :: FieldName
_Padding_right = (String -> FieldName
Core.FieldName String
"right")

-- | Operator precedence
newtype Precedence = 
  Precedence {
    -- | Operator precedence
    Precedence -> Int
unPrecedence :: Int}
  deriving (Precedence -> Precedence -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Precedence -> Precedence -> Bool
$c/= :: Precedence -> Precedence -> Bool
== :: Precedence -> Precedence -> Bool
$c== :: Precedence -> Precedence -> Bool
Eq, Eq Precedence
Precedence -> Precedence -> Bool
Precedence -> Precedence -> Ordering
Precedence -> Precedence -> Precedence
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Precedence -> Precedence -> Precedence
$cmin :: Precedence -> Precedence -> Precedence
max :: Precedence -> Precedence -> Precedence
$cmax :: Precedence -> Precedence -> Precedence
>= :: Precedence -> Precedence -> Bool
$c>= :: Precedence -> Precedence -> Bool
> :: Precedence -> Precedence -> Bool
$c> :: Precedence -> Precedence -> Bool
<= :: Precedence -> Precedence -> Bool
$c<= :: Precedence -> Precedence -> Bool
< :: Precedence -> Precedence -> Bool
$c< :: Precedence -> Precedence -> Bool
compare :: Precedence -> Precedence -> Ordering
$ccompare :: Precedence -> Precedence -> Ordering
Ord, ReadPrec [Precedence]
ReadPrec Precedence
Int -> ReadS Precedence
ReadS [Precedence]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Precedence]
$creadListPrec :: ReadPrec [Precedence]
readPrec :: ReadPrec Precedence
$creadPrec :: ReadPrec Precedence
readList :: ReadS [Precedence]
$creadList :: ReadS [Precedence]
readsPrec :: Int -> ReadS Precedence
$creadsPrec :: Int -> ReadS Precedence
Read, Int -> Precedence -> ShowS
[Precedence] -> ShowS
Precedence -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Precedence] -> ShowS
$cshowList :: [Precedence] -> ShowS
show :: Precedence -> String
$cshow :: Precedence -> String
showsPrec :: Int -> Precedence -> ShowS
$cshowsPrec :: Int -> Precedence -> ShowS
Show)

_Precedence :: Name
_Precedence = (String -> Name
Core.Name String
"hydra/util/codetree/ast.Precedence")

-- | Any symbol
newtype Symbol = 
  Symbol {
    -- | Any symbol
    Symbol -> String
unSymbol :: String}
  deriving (Symbol -> Symbol -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Symbol -> Symbol -> Bool
$c/= :: Symbol -> Symbol -> Bool
== :: Symbol -> Symbol -> Bool
$c== :: Symbol -> Symbol -> Bool
Eq, Eq Symbol
Symbol -> Symbol -> Bool
Symbol -> Symbol -> Ordering
Symbol -> Symbol -> Symbol
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Symbol -> Symbol -> Symbol
$cmin :: Symbol -> Symbol -> Symbol
max :: Symbol -> Symbol -> Symbol
$cmax :: Symbol -> Symbol -> Symbol
>= :: Symbol -> Symbol -> Bool
$c>= :: Symbol -> Symbol -> Bool
> :: Symbol -> Symbol -> Bool
$c> :: Symbol -> Symbol -> Bool
<= :: Symbol -> Symbol -> Bool
$c<= :: Symbol -> Symbol -> Bool
< :: Symbol -> Symbol -> Bool
$c< :: Symbol -> Symbol -> Bool
compare :: Symbol -> Symbol -> Ordering
$ccompare :: Symbol -> Symbol -> Ordering
Ord, ReadPrec [Symbol]
ReadPrec Symbol
Int -> ReadS Symbol
ReadS [Symbol]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Symbol]
$creadListPrec :: ReadPrec [Symbol]
readPrec :: ReadPrec Symbol
$creadPrec :: ReadPrec Symbol
readList :: ReadS [Symbol]
$creadList :: ReadS [Symbol]
readsPrec :: Int -> ReadS Symbol
$creadsPrec :: Int -> ReadS Symbol
Read, Int -> Symbol -> ShowS
[Symbol] -> ShowS
Symbol -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Symbol] -> ShowS
$cshowList :: [Symbol] -> ShowS
show :: Symbol -> String
$cshow :: Symbol -> String
showsPrec :: Int -> Symbol -> ShowS
$cshowsPrec :: Int -> Symbol -> ShowS
Show)

_Symbol :: Name
_Symbol = (String -> Name
Core.Name String
"hydra/util/codetree/ast.Symbol")

-- | One of several classes of whitespace
data Ws = 
  WsNone  |
  WsSpace  |
  WsBreak  |
  WsBreakAndIndent  |
  WsDoubleBreak 
  deriving (Ws -> Ws -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Ws -> Ws -> Bool
$c/= :: Ws -> Ws -> Bool
== :: Ws -> Ws -> Bool
$c== :: Ws -> Ws -> Bool
Eq, Eq Ws
Ws -> Ws -> Bool
Ws -> Ws -> Ordering
Ws -> Ws -> Ws
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Ws -> Ws -> Ws
$cmin :: Ws -> Ws -> Ws
max :: Ws -> Ws -> Ws
$cmax :: Ws -> Ws -> Ws
>= :: Ws -> Ws -> Bool
$c>= :: Ws -> Ws -> Bool
> :: Ws -> Ws -> Bool
$c> :: Ws -> Ws -> Bool
<= :: Ws -> Ws -> Bool
$c<= :: Ws -> Ws -> Bool
< :: Ws -> Ws -> Bool
$c< :: Ws -> Ws -> Bool
compare :: Ws -> Ws -> Ordering
$ccompare :: Ws -> Ws -> Ordering
Ord, ReadPrec [Ws]
ReadPrec Ws
Int -> ReadS Ws
ReadS [Ws]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Ws]
$creadListPrec :: ReadPrec [Ws]
readPrec :: ReadPrec Ws
$creadPrec :: ReadPrec Ws
readList :: ReadS [Ws]
$creadList :: ReadS [Ws]
readsPrec :: Int -> ReadS Ws
$creadsPrec :: Int -> ReadS Ws
Read, Int -> Ws -> ShowS
[Ws] -> ShowS
Ws -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Ws] -> ShowS
$cshowList :: [Ws] -> ShowS
show :: Ws -> String
$cshow :: Ws -> String
showsPrec :: Int -> Ws -> ShowS
$cshowsPrec :: Int -> Ws -> ShowS
Show)

_Ws :: Name
_Ws = (String -> Name
Core.Name String
"hydra/util/codetree/ast.Ws")

_Ws_none :: FieldName
_Ws_none = (String -> FieldName
Core.FieldName String
"none")

_Ws_space :: FieldName
_Ws_space = (String -> FieldName
Core.FieldName String
"space")

_Ws_break :: FieldName
_Ws_break = (String -> FieldName
Core.FieldName String
"break")

_Ws_breakAndIndent :: FieldName
_Ws_breakAndIndent = (String -> FieldName
Core.FieldName String
"breakAndIndent")

_Ws_doubleBreak :: FieldName
_Ws_doubleBreak = (String -> FieldName
Core.FieldName String
"doubleBreak")