module Stan.Category
(
Category (..)
, prettyShowCategory
, stanCategories
, antiPattern
, infinite
, list
, partial
, spaceLeak
, syntax
, unsafe
) where
import Colourista (formatWith, magentaBg)
import Data.Aeson.Micro (ToJSON)
newtype Category = Category
{ Category -> Text
unCategory :: Text
} deriving newtype (Int -> Category -> ShowS
[Category] -> ShowS
Category -> String
(Int -> Category -> ShowS)
-> (Category -> String) -> ([Category] -> ShowS) -> Show Category
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Category] -> ShowS
$cshowList :: [Category] -> ShowS
show :: Category -> String
$cshow :: Category -> String
showsPrec :: Int -> Category -> ShowS
$cshowsPrec :: Int -> Category -> ShowS
Show, Category -> Category -> Bool
(Category -> Category -> Bool)
-> (Category -> Category -> Bool) -> Eq Category
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Category -> Category -> Bool
$c/= :: Category -> Category -> Bool
== :: Category -> Category -> Bool
$c== :: Category -> Category -> Bool
Eq, Int -> Category -> Int
Category -> Int
(Int -> Category -> Int) -> (Category -> Int) -> Hashable Category
forall a. (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: Category -> Int
$chash :: Category -> Int
hashWithSalt :: Int -> Category -> Int
$chashWithSalt :: Int -> Category -> Int
Hashable, Category -> Value
(Category -> Value) -> ToJSON Category
forall a. (a -> Value) -> ToJSON a
toJSON :: Category -> Value
$ctoJSON :: Category -> Value
ToJSON)
prettyShowCategory :: Category -> Text
prettyShowCategory :: Category -> Text
prettyShowCategory cat :: Category
cat = [Text] -> Text -> Text
forall str. (IsString str, Semigroup str) => [str] -> str -> str
formatWith [Text
forall str. IsString str => str
magentaBg] (Text -> Text) -> Text -> Text
forall a b. (a -> b) -> a -> b
$ "#" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Category -> Text
unCategory Category
cat
list :: Category
list :: Category
list = Text -> Category
Category "List"
partial :: Category
partial :: Category
partial = Text -> Category
Category "Partial"
infinite :: Category
infinite :: Category
infinite = Text -> Category
Category "Infinite"
antiPattern :: Category
antiPattern :: Category
antiPattern = Text -> Category
Category "AntiPattern"
spaceLeak :: Category
spaceLeak :: Category
spaceLeak = Text -> Category
Category "SpaceLeak"
syntax :: Category
syntax :: Category
syntax = Text -> Category
Category "Syntax"
unsafe :: Category
unsafe :: Category
unsafe = Text -> Category
Category "Unsafe"
stanCategories :: [Category]
stanCategories :: [Category]
stanCategories =
[ Category
antiPattern
, Category
infinite
, Category
list
, Category
partial
, Category
spaceLeak
, Category
syntax
, Category
unsafe
]