Skip to content

Commit

Permalink
Explicit Prelude import for elem.
Browse files Browse the repository at this point in the history
- Resolves ambiguities around elem re-exports in newer GHCs.
  • Loading branch information
dmjio committed Feb 20, 2025
1 parent 4eb261b commit ac16074
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Miso/Html/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ import JavaScript.Object.Internal (Object(Object))
import qualified Lucid as L
import qualified Lucid.Base as L
import Prelude hiding (null)
import qualified Prelude as P
import Servant.API (Get, HasLink(MkLink, toLink))
import Text.HTML.TagSoup.Tree (parseTree, TagTree(..))
import Text.HTML.TagSoup (Tag(..))
Expand Down Expand Up @@ -131,7 +132,7 @@ instance L.ToHtml (View action) where
where
noEnd = ["img", "input", "br", "hr", "meta"]
tag = toTag $ fromMisoString vType
ele = if tag `elem` noEnd
ele = if tag `P.elem` noEnd
then L.makeElementNoEnd tag
else L.makeElement tag kids
classes = T.intercalate " " [ v | P "class" (A.String v) <- attrs ]
Expand All @@ -145,11 +146,11 @@ instance L.ToHtml (View action) where
xs = if not (T.null classes)
then M.insert "class" (A.String classes) propClass
else propClass
lattrs = [ L.makeAttribute k' (if k `elem` exceptions && v == A.Bool True then k' else v')
lattrs = [ L.makeAttribute k' (if k `P.elem` exceptions && v == A.Bool True then k' else v')
| (k,v) <- M.toList xs
, let k' = fromMisoString k
, let v' = toHtmlFromJSON v
, not (k `elem` exceptions && v == A.Bool False)
, not (k `P.elem` exceptions && v == A.Bool False)
]
exceptions = [ "checked"
, "disabled"
Expand Down

0 comments on commit ac16074

Please sign in to comment.