module Derive.Flags where
import qualified Control.DeepSeq as DeepSeq
import qualified Data.Set as Set
import Global
type Flags = Set Flag
newtype Flag = Flag Text
deriving (Flag -> Flag -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Flag -> Flag -> Bool
$c/= :: Flag -> Flag -> Bool
== :: Flag -> Flag -> Bool
$c== :: Flag -> Flag -> Bool
Eq, Eq Flag
Flag -> Flag -> Bool
Flag -> Flag -> Ordering
Flag -> Flag -> Flag
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Flag -> Flag -> Flag
$cmin :: Flag -> Flag -> Flag
max :: Flag -> Flag -> Flag
$cmax :: Flag -> Flag -> Flag
>= :: Flag -> Flag -> Bool
$c>= :: Flag -> Flag -> Bool
> :: Flag -> Flag -> Bool
$c> :: Flag -> Flag -> Bool
<= :: Flag -> Flag -> Bool
$c<= :: Flag -> Flag -> Bool
< :: Flag -> Flag -> Bool
$c< :: Flag -> Flag -> Bool
compare :: Flag -> Flag -> Ordering
$ccompare :: Flag -> Flag -> Ordering
Ord, Int -> Flag -> ShowS
[Flag] -> ShowS
Flag -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Flag] -> ShowS
$cshowList :: [Flag] -> ShowS
show :: Flag -> String
$cshow :: Flag -> String
showsPrec :: Int -> Flag -> ShowS
$cshowsPrec :: Int -> Flag -> ShowS
Show, Flag -> ()
forall a. (a -> ()) -> NFData a
rnf :: Flag -> ()
$crnf :: Flag -> ()
DeepSeq.NFData)
instance Pretty Flag where pretty :: Flag -> Text
pretty (Flag Text
t) = Text
t
flag :: Text -> Flags
flag :: Text -> Flags
flag = forall a. a -> Set a
Set.singleton forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Flag
Flag
has :: Flags -> Flags -> Bool
has :: Flags -> Flags -> Bool
has = forall a b c. (a -> b -> c) -> b -> a -> c
flip forall a. Ord a => Set a -> Set a -> Bool
Set.isSubsetOf
infer_duration :: Flags
infer_duration :: Flags
infer_duration = Text -> Flags
flag Text
"infer-duration"
weak :: Flags
weak :: Flags
weak = Text -> Flags
flag Text
"weak"
strong :: Flags
strong :: Flags
strong = Text -> Flags
flag Text
"strong"
ly_code :: Flags
ly_code :: Flags
ly_code = Text -> Flags
flag Text
"ly-code"