fix: hlint warnings in SchemaOrg module

- Remove unused DeriveGeneric pragma
- Use newtype for SchemaOrgPerson and SchemaOrgImageObject
- Remove redundant brackets around string literal
This commit is contained in:
2026-05-19 22:54:46 -04:00
parent 340b95cf79
commit a70cd86afd
+5 -6
View File
@@ -1,4 +1,3 @@
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE OverloadedStrings #-}
module Roux.SchemaOrg ( module Roux.SchemaOrg (
@@ -50,14 +49,14 @@ data SchemaOrgRecipe = SchemaOrgRecipe
deriving stock (Eq, Show) deriving stock (Eq, Show)
-- | A schema.org Person (recipe author). -- | A schema.org Person (recipe author).
data SchemaOrgPerson = SchemaOrgPerson newtype SchemaOrgPerson = SchemaOrgPerson
{ soPersonName :: !Text { soPersonName :: Text
} }
deriving stock (Eq, Show) deriving stock (Eq, Show)
-- | A schema.org ImageObject (recipe image). -- | A schema.org ImageObject (recipe image).
data SchemaOrgImageObject = SchemaOrgImageObject newtype SchemaOrgImageObject = SchemaOrgImageObject
{ soImageObjectUrl :: !Text { soImageObjectUrl :: Text
} }
deriving stock (Eq, Show) deriving stock (Eq, Show)
@@ -258,7 +257,7 @@ buildIngredientSection :: [Text] -> Section
buildIngredientSection ings buildIngredientSection ings
| null ings = Section Nothing (SecStep (Step []) :| []) | null ings = Section Nothing (SecStep (Step []) :| [])
| otherwise = | otherwise =
let items = concatMap (\t -> [StepText (", "), StepText t]) ings let items = concatMap (\t -> [StepText ", ", StepText t]) ings
step = Step items step = Step items
in Section (Just "Ingredients") (SecStep step :| []) in Section (Just "Ingredients") (SecStep step :| [])