graphql-engine/server/src-lib/Data/Text/Extended.hs

34 lines
716 B
Haskell
Raw Normal View History

2018-06-27 16:11:32 +03:00
module Data.Text.Extended
( module DT
2020-08-27 19:36:39 +03:00
, bquote
2018-06-27 16:11:32 +03:00
, squote
, dquote
, paren
, (<->)
) where
import Hasura.Prelude
2020-08-27 19:36:39 +03:00
import Data.Text as DT
bquote :: DT.Text -> DT.Text
bquote t = DT.singleton '`' <> t <> DT.singleton '`'
{-# INLINE bquote #-}
2018-06-27 16:11:32 +03:00
squote :: DT.Text -> DT.Text
squote t = DT.singleton '\'' <> t <> DT.singleton '\''
{-# INLINE squote #-}
dquote :: DT.Text -> DT.Text
dquote t = DT.singleton '"' <> t <> DT.singleton '"'
{-# INLINE dquote #-}
paren :: DT.Text -> DT.Text
paren t = "(" <> t <> ")"
{-# INLINE paren #-}
infixr 6 <->
(<->) :: DT.Text -> DT.Text -> DT.Text
(<->) l r = l <> DT.singleton ' ' <> r
{-# INLINE (<->) #-}