{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MonoLocalBinds #-}

module Rel8.Expr.Read
  ( read
  , sread
  )
where

-- base
import Prelude ()

-- rel8
import Rel8.Expr (Expr)
import Rel8.Expr.Opaleye (unsafeCastExpr, sunsafeCastExpr)
import Rel8.Schema.Null (Sql)
import Rel8.Type (DBType)
import Rel8.Type.Name (TypeName)

-- text
import Data.Text (Text)


read :: Sql DBType a => Expr Text -> Expr a
read :: forall a. Sql DBType a => Expr Text -> Expr a
read = Expr Text -> Expr a
forall b a. Sql DBType b => Expr a -> Expr b
unsafeCastExpr


sread :: TypeName -> Expr Text -> Expr a
sread :: forall a. TypeName -> Expr Text -> Expr a
sread = TypeName -> Expr Text -> Expr a
forall a b. TypeName -> Expr a -> Expr b
sunsafeCastExpr