{-# LANGUAGE DerivingVia #-}
module Text.Interpolation.Nyan.Core.Internal.Base where
import Data.Monoid (Endo (..))
import Data.Text (Text)
import Language.Haskell.TH (ExpQ)
data IntData = IntData
{ IntData -> Text
idMode :: Text
, IntData -> Text
idCode :: Text
} deriving stock (Int -> IntData -> ShowS
[IntData] -> ShowS
IntData -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IntData] -> ShowS
$cshowList :: [IntData] -> ShowS
show :: IntData -> String
$cshow :: IntData -> String
showsPrec :: Int -> IntData -> ShowS
$cshowsPrec :: Int -> IntData -> ShowS
Show, IntData -> IntData -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IntData -> IntData -> Bool
$c/= :: IntData -> IntData -> Bool
== :: IntData -> IntData -> Bool
$c== :: IntData -> IntData -> Bool
Eq)
data ParsedIntPiece
= PipString Text
| PipNewline Text
| PipLeadingWs Word
| PipEmptyLine
| PipInt IntData
deriving stock (Int -> ParsedIntPiece -> ShowS
[ParsedIntPiece] -> ShowS
ParsedIntPiece -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ParsedIntPiece] -> ShowS
$cshowList :: [ParsedIntPiece] -> ShowS
show :: ParsedIntPiece -> String
$cshow :: ParsedIntPiece -> String
showsPrec :: Int -> ParsedIntPiece -> ShowS
$cshowsPrec :: Int -> ParsedIntPiece -> ShowS
Show, ParsedIntPiece -> ParsedIntPiece -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ParsedIntPiece -> ParsedIntPiece -> Bool
$c/= :: ParsedIntPiece -> ParsedIntPiece -> Bool
== :: ParsedIntPiece -> ParsedIntPiece -> Bool
$c== :: ParsedIntPiece -> ParsedIntPiece -> Bool
Eq)
type ParsedInterpolatedString = [ParsedIntPiece]
data IntPiece
= IpString Text
| IpInt IntData
deriving stock (Int -> IntPiece -> ShowS
[IntPiece] -> ShowS
IntPiece -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IntPiece] -> ShowS
$cshowList :: [IntPiece] -> ShowS
show :: IntPiece -> String
$cshow :: IntPiece -> String
showsPrec :: Int -> IntPiece -> ShowS
$cshowsPrec :: Int -> IntPiece -> ShowS
Show, IntPiece -> IntPiece -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IntPiece -> IntPiece -> Bool
$c/= :: IntPiece -> IntPiece -> Bool
== :: IntPiece -> IntPiece -> Bool
$c== :: IntPiece -> IntPiece -> Bool
Eq)
type InterpolatedString = [IntPiece]
data ReturnType
= AnyFromBuilder
| ConcreteText
| ConcreteLText
| ConcreteBuilder
deriving stock (Int -> ReturnType -> ShowS
[ReturnType] -> ShowS
ReturnType -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReturnType] -> ShowS
$cshowList :: [ReturnType] -> ShowS
show :: ReturnType -> String
$cshow :: ReturnType -> String
showsPrec :: Int -> ReturnType -> ShowS
$cshowsPrec :: Int -> ReturnType -> ShowS
Show, ReturnType -> ReturnType -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReturnType -> ReturnType -> Bool
$c/= :: ReturnType -> ReturnType -> Bool
== :: ReturnType -> ReturnType -> Bool
$c== :: ReturnType -> ReturnType -> Bool
Eq)
data PreviewLevel
= PreviewNone
| PreviewExact
| PreviewInvisible
deriving stock (Int -> PreviewLevel -> ShowS
[PreviewLevel] -> ShowS
PreviewLevel -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PreviewLevel] -> ShowS
$cshowList :: [PreviewLevel] -> ShowS
show :: PreviewLevel -> String
$cshow :: PreviewLevel -> String
showsPrec :: Int -> PreviewLevel -> ShowS
$cshowsPrec :: Int -> PreviewLevel -> ShowS
Show, PreviewLevel -> PreviewLevel -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PreviewLevel -> PreviewLevel -> Bool
$c/= :: PreviewLevel -> PreviewLevel -> Bool
== :: PreviewLevel -> PreviewLevel -> Bool
$c== :: PreviewLevel -> PreviewLevel -> Bool
Eq, Int -> PreviewLevel
PreviewLevel -> Int
PreviewLevel -> [PreviewLevel]
PreviewLevel -> PreviewLevel
PreviewLevel -> PreviewLevel -> [PreviewLevel]
PreviewLevel -> PreviewLevel -> PreviewLevel -> [PreviewLevel]
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
enumFromThenTo :: PreviewLevel -> PreviewLevel -> PreviewLevel -> [PreviewLevel]
$cenumFromThenTo :: PreviewLevel -> PreviewLevel -> PreviewLevel -> [PreviewLevel]
enumFromTo :: PreviewLevel -> PreviewLevel -> [PreviewLevel]
$cenumFromTo :: PreviewLevel -> PreviewLevel -> [PreviewLevel]
enumFromThen :: PreviewLevel -> PreviewLevel -> [PreviewLevel]
$cenumFromThen :: PreviewLevel -> PreviewLevel -> [PreviewLevel]
enumFrom :: PreviewLevel -> [PreviewLevel]
$cenumFrom :: PreviewLevel -> [PreviewLevel]
fromEnum :: PreviewLevel -> Int
$cfromEnum :: PreviewLevel -> Int
toEnum :: Int -> PreviewLevel
$ctoEnum :: Int -> PreviewLevel
pred :: PreviewLevel -> PreviewLevel
$cpred :: PreviewLevel -> PreviewLevel
succ :: PreviewLevel -> PreviewLevel
$csucc :: PreviewLevel -> PreviewLevel
Enum, PreviewLevel
forall a. a -> a -> Bounded a
maxBound :: PreviewLevel
$cmaxBound :: PreviewLevel
minBound :: PreviewLevel
$cminBound :: PreviewLevel
Bounded)
data SwitchesOptions = SwitchesOptions
{ SwitchesOptions -> Bool
spacesTrimming :: Bool
, SwitchesOptions -> Bool
indentationStripping :: Bool
, SwitchesOptions -> Bool
leadingNewlineStripping :: Bool
, SwitchesOptions -> Bool
trailingSpacesStripping :: Bool
, SwitchesOptions -> ReturnType
returnType :: ReturnType
, SwitchesOptions -> Bool
reducedNewlines :: Bool
, SwitchesOptions -> Bool
monadic :: Bool
, SwitchesOptions -> PreviewLevel
previewLevel :: PreviewLevel
} deriving stock (Int -> SwitchesOptions -> ShowS
[SwitchesOptions] -> ShowS
SwitchesOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SwitchesOptions] -> ShowS
$cshowList :: [SwitchesOptions] -> ShowS
show :: SwitchesOptions -> String
$cshow :: SwitchesOptions -> String
showsPrec :: Int -> SwitchesOptions -> ShowS
$cshowsPrec :: Int -> SwitchesOptions -> ShowS
Show, SwitchesOptions -> SwitchesOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SwitchesOptions -> SwitchesOptions -> Bool
$c/= :: SwitchesOptions -> SwitchesOptions -> Bool
== :: SwitchesOptions -> SwitchesOptions -> Bool
$c== :: SwitchesOptions -> SwitchesOptions -> Bool
Eq)
data DefaultSwitchesOptions = DefaultSwitchesOptions
{ DefaultSwitchesOptions -> Maybe Bool
defSpacesTrimming :: Maybe Bool
, DefaultSwitchesOptions -> Maybe Bool
defIndentationStripping :: Maybe Bool
, DefaultSwitchesOptions -> Maybe Bool
defLeadingNewlineStripping :: Maybe Bool
, DefaultSwitchesOptions -> Maybe Bool
defTrailingSpacesStripping :: Maybe Bool
, DefaultSwitchesOptions -> Maybe Bool
defReducedNewlines :: Maybe Bool
, DefaultSwitchesOptions -> Maybe ReturnType
defReturnType :: Maybe ReturnType
, DefaultSwitchesOptions -> Maybe Bool
defMonadic :: Maybe Bool
} deriving stock (Int -> DefaultSwitchesOptions -> ShowS
[DefaultSwitchesOptions] -> ShowS
DefaultSwitchesOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DefaultSwitchesOptions] -> ShowS
$cshowList :: [DefaultSwitchesOptions] -> ShowS
show :: DefaultSwitchesOptions -> String
$cshow :: DefaultSwitchesOptions -> String
showsPrec :: Int -> DefaultSwitchesOptions -> ShowS
$cshowsPrec :: Int -> DefaultSwitchesOptions -> ShowS
Show)
basicDefaultSwitchesOptions :: DefaultSwitchesOptions
basicDefaultSwitchesOptions :: DefaultSwitchesOptions
basicDefaultSwitchesOptions = DefaultSwitchesOptions
{ defSpacesTrimming :: Maybe Bool
defSpacesTrimming = forall a. a -> Maybe a
Just Bool
False
, defIndentationStripping :: Maybe Bool
defIndentationStripping = forall a. a -> Maybe a
Just Bool
False
, defLeadingNewlineStripping :: Maybe Bool
defLeadingNewlineStripping = forall a. a -> Maybe a
Just Bool
False
, defTrailingSpacesStripping :: Maybe Bool
defTrailingSpacesStripping = forall a. a -> Maybe a
Just Bool
False
, defReturnType :: Maybe ReturnType
defReturnType = forall a. a -> Maybe a
Just ReturnType
AnyFromBuilder
, defReducedNewlines :: Maybe Bool
defReducedNewlines = forall a. a -> Maybe a
Just Bool
False
, defMonadic :: Maybe Bool
defMonadic = forall a. a -> Maybe a
Just Bool
False
}
recommendedDefaultSwitchesOptions :: DefaultSwitchesOptions
recommendedDefaultSwitchesOptions :: DefaultSwitchesOptions
recommendedDefaultSwitchesOptions = DefaultSwitchesOptions
{ defSpacesTrimming :: Maybe Bool
defSpacesTrimming = forall a. a -> Maybe a
Just Bool
False
, defIndentationStripping :: Maybe Bool
defIndentationStripping = forall a. a -> Maybe a
Just Bool
True
, defLeadingNewlineStripping :: Maybe Bool
defLeadingNewlineStripping = forall a. a -> Maybe a
Just Bool
True
, defTrailingSpacesStripping :: Maybe Bool
defTrailingSpacesStripping = forall a. a -> Maybe a
Just Bool
True
, defReturnType :: Maybe ReturnType
defReturnType = forall a. a -> Maybe a
Just ReturnType
AnyFromBuilder
, defReducedNewlines :: Maybe Bool
defReducedNewlines = forall a. a -> Maybe a
Just Bool
False
, defMonadic :: Maybe Bool
defMonadic = forall a. a -> Maybe a
Just Bool
False
}
newtype ValueInterpolator = ValueInterpolator
{ ValueInterpolator -> Text -> ExpQ
runValueInterpolator :: Text -> ExpQ
}
newtype InvisibleCharsPreview = InvisibleCharsPreview
{ InvisibleCharsPreview -> ShowS
replaceInvisibleChars :: String -> String
} deriving NonEmpty InvisibleCharsPreview -> InvisibleCharsPreview
InvisibleCharsPreview
-> InvisibleCharsPreview -> InvisibleCharsPreview
forall b.
Integral b =>
b -> InvisibleCharsPreview -> InvisibleCharsPreview
forall a.
(a -> a -> a)
-> (NonEmpty a -> a)
-> (forall b. Integral b => b -> a -> a)
-> Semigroup a
stimes :: forall b.
Integral b =>
b -> InvisibleCharsPreview -> InvisibleCharsPreview
$cstimes :: forall b.
Integral b =>
b -> InvisibleCharsPreview -> InvisibleCharsPreview
sconcat :: NonEmpty InvisibleCharsPreview -> InvisibleCharsPreview
$csconcat :: NonEmpty InvisibleCharsPreview -> InvisibleCharsPreview
<> :: InvisibleCharsPreview
-> InvisibleCharsPreview -> InvisibleCharsPreview
$c<> :: InvisibleCharsPreview
-> InvisibleCharsPreview -> InvisibleCharsPreview
Semigroup via (Endo String)
deriving Semigroup InvisibleCharsPreview
InvisibleCharsPreview
[InvisibleCharsPreview] -> InvisibleCharsPreview
InvisibleCharsPreview
-> InvisibleCharsPreview -> InvisibleCharsPreview
forall a.
Semigroup a -> a -> (a -> a -> a) -> ([a] -> a) -> Monoid a
mconcat :: [InvisibleCharsPreview] -> InvisibleCharsPreview
$cmconcat :: [InvisibleCharsPreview] -> InvisibleCharsPreview
mappend :: InvisibleCharsPreview
-> InvisibleCharsPreview -> InvisibleCharsPreview
$cmappend :: InvisibleCharsPreview
-> InvisibleCharsPreview -> InvisibleCharsPreview
mempty :: InvisibleCharsPreview
$cmempty :: InvisibleCharsPreview
Monoid via (Endo String)
data InterpolatorOptions = InterpolatorOptions
{ InterpolatorOptions -> DefaultSwitchesOptions
defaultSwitchesOptions :: DefaultSwitchesOptions
, InterpolatorOptions -> ValueInterpolator
valueInterpolator :: ValueInterpolator
, InterpolatorOptions -> InvisibleCharsPreview
invisibleCharsPreview :: InvisibleCharsPreview
}