graphql-engine/server/src-lib/Data/Text/Extended.hs
Vamshi Surabhi ec8b2c80b5
refactor to remove warnings especially with orphan instances (#1163)
* remove phase one/two distinction and hdbquery typeclass

* move extensions to default-extensions

* switch to LazyTx which only acquires a connection if needed

* move defns from TH module into Ops module

* remove tojson orphan instance for http exception

* remove orphan instance for dmlp1

* getTopLevelNodes will not throw any exceptions
2018-12-13 12:56:15 +05:30

29 lines
590 B
Haskell

module Data.Text.Extended
( module DT
, squote
, dquote
, paren
, (<->)
) where
import Hasura.Prelude
import Data.Text as DT
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 (<->) #-}