module ServantSerf.Type.Depth where

data Depth
    = Deep
    | Shallow
    deriving (Depth -> Depth -> Bool
(Depth -> Depth -> Bool) -> (Depth -> Depth -> Bool) -> Eq Depth
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Depth -> Depth -> Bool
$c/= :: Depth -> Depth -> Bool
== :: Depth -> Depth -> Bool
$c== :: Depth -> Depth -> Bool
Eq, Int -> Depth -> ShowS
[Depth] -> ShowS
Depth -> String
(Int -> Depth -> ShowS)
-> (Depth -> String) -> ([Depth] -> ShowS) -> Show Depth
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Depth] -> ShowS
$cshowList :: [Depth] -> ShowS
show :: Depth -> String
$cshow :: Depth -> String
showsPrec :: Int -> Depth -> ShowS
$cshowsPrec :: Int -> Depth -> ShowS
Show)

fromString :: String -> Maybe Depth
fromString :: String -> Maybe Depth
fromString String
x = case String
x of
  String
"deep" -> Depth -> Maybe Depth
forall a. a -> Maybe a
Just Depth
Deep
  String
"shallow" -> Depth -> Maybe Depth
forall a. a -> Maybe a
Just Depth
Shallow
  String
_ -> Maybe Depth
forall a. Maybe a
Nothing