3 import Data.Aeson (FromJSON (parseJSON), withText)
4 import Data.Text qualified as Text
14 deriving (Bounded, Show, Enum, Eq)
16 langText :: IsString a => Lang -> a
23 parseLang :: Text -> Maybe Lang
31 instance FromJSON Lang where
34 maybe (fail "expected a Lang") pure
37 textOfLang :: Lang -> Text
38 textOfLang = Text.drop 4 . Text.toLower . show