{-# LANGUAGE StrictData #-}
module Galley.Data.Scope where
import Cassandra hiding (Value)
import Imports
data Scope = ReusableCode
deriving (Scope -> Scope -> Bool
(Scope -> Scope -> Bool) -> (Scope -> Scope -> Bool) -> Eq Scope
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Scope -> Scope -> Bool
== :: Scope -> Scope -> Bool
$c/= :: Scope -> Scope -> Bool
/= :: Scope -> Scope -> Bool
Eq, Int -> Scope -> ShowS
[Scope] -> ShowS
Scope -> String
(Int -> Scope -> ShowS)
-> (Scope -> String) -> ([Scope] -> ShowS) -> Show Scope
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Scope -> ShowS
showsPrec :: Int -> Scope -> ShowS
$cshow :: Scope -> String
show :: Scope -> String
$cshowList :: [Scope] -> ShowS
showList :: [Scope] -> ShowS
Show, (forall x. Scope -> Rep Scope x)
-> (forall x. Rep Scope x -> Scope) -> Generic Scope
forall x. Rep Scope x -> Scope
forall x. Scope -> Rep Scope x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Scope -> Rep Scope x
from :: forall x. Scope -> Rep Scope x
$cto :: forall x. Rep Scope x -> Scope
to :: forall x. Rep Scope x -> Scope
Generic)
instance Cql Scope where
ctype :: Tagged Scope ColumnType
ctype = ColumnType -> Tagged Scope ColumnType
forall a b. b -> Tagged a b
Tagged ColumnType
IntColumn
toCql :: Scope -> Value
toCql Scope
ReusableCode = Int32 -> Value
CqlInt Int32
1
fromCql :: Value -> Either String Scope
fromCql (CqlInt Int32
1) = Scope -> Either String Scope
forall a. a -> Either String a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Scope
ReusableCode
fromCql Value
_ = String -> Either String Scope
forall a b. a -> Either a b
Left String
"unknown Scope"