{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE UndecidableInstances #-}
{-# OPTIONS_GHC -fno-warn-missing-methods #-}
{-# OPTIONS_GHC -w #-}
module Uniform.Strings.Infix where
import GHC.Exts (IsString (..))
import Uniform.Strings.Conversion ( Text )
import Uniform.Strings.Utilities ( CharChains(append) )
(<:>) :: Text -> Text -> Text
Text
a <:> :: Text -> Text -> Text
<:> Text
b = Text
a Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
":" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
b
(<+>) :: Text -> Text -> Text
Text
a <+> :: Text -> Text -> Text
<+> Text
b = Text
a Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"+" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
b
(<->) :: Text -> Text -> Text
Text
a <-> :: Text -> Text -> Text
<-> Text
b = Text
a Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"-" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
b
(</>) :: Text -> Text -> Text
Text
a </> :: Text -> Text -> Text
</> Text
b = Text
a Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"/" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
b
(<.>) :: Text -> Text -> Text
Text
a <.> :: Text -> Text -> Text
<.> Text
b = Text
a Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"." Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
b
(<#>) :: Text -> Text -> Text
Text
a <#> :: Text -> Text -> Text
<#> Text
b = Text
a Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"#" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
b
(<|>) :: Text -> Text -> Text
Text
a <|> :: Text -> Text -> Text
<|> Text
x = Text
a Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
" " Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
x
wrapInSpitz :: Text -> Text
wrapInSpitz :: Text -> Text
wrapInSpitz Text
a = Text
"<" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
a Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
">"
wrapInDoubleQuotes :: Text -> Text
wrapInDoubleQuotes :: Text -> Text
wrapInDoubleQuotes Text
a = Text
"\"" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
a Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"\""
wrapInBraces :: Text -> Text
wrapInBraces :: Text -> Text
wrapInBraces Text
a = Text
"{" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
a Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"}"
addXatEnd :: (IsString s, CharChains s) => s -> s -> s
addXatEnd :: s -> s -> s
addXatEnd = (s -> s -> s) -> s -> s -> s
forall a b c. (a -> b -> c) -> b -> a -> c
flip s -> s -> s
forall a. CharChains a => a -> a -> a
append