@@ 12,6 12,7 @@ import Data.CSS.Syntax.Tokens
-- TODO do performance tests to decide beside between strict/lazy,
-- or is another Map implementation better?
import Data.HashMap.Strict
+import qualified Data.HashMap.Lazy as HML
import Data.Text (unpack, pack, isPrefixOf)
-- | Defines how to parse CSS properties into an output "style" format.
@@ 63,12 64,12 @@ query self el = Prelude.foldr yield empty $ lookupRules self el
-- parsed to a value of the same `PropertyParser` type passed in & inheriting from it.
cascade :: PropertyParser p => [StyleRule'] -> Props -> p -> p
cascade styles overrides base =
- construct base $ toList $ cascadeRules (getVars base ++ overrides) styles
+ construct base $ HML.toList $ cascadeRules (getVars base ++ overrides) styles
cascadeRules :: Props -> [StyleRule'] -> HashMap Text [Token]
cascadeRules overrides rules = cascadeProperties overrides $ concat $ Prelude.map properties rules
cascadeProperties :: Props -> Props -> HashMap Text [Token]
-cascadeProperties overrides props = fromList (props ++ overrides)
+cascadeProperties overrides props = HML.fromList (props ++ overrides)
construct :: PropertyParser p => p -> Props -> p
construct base props = dispatch base child props