Skip to content

Commit c4152e5

Browse files
committed
foldl' import
1 parent 79b2367 commit c4152e5

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

src/Web/Atomic/Render.hs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,26 @@
33
module Web.Atomic.Render where
44

55
import Data.ByteString.Lazy qualified as BL
6+
import Data.List qualified as L
67
import Data.Map.Strict (Map)
78
import Data.Map.Strict qualified as M
89
import Data.Maybe (mapMaybe)
910
import Data.String (IsString (..))
1011
import Data.Text (Text, intercalate, pack)
1112
import Data.Text qualified as T
12-
import Data.Text.Lazy qualified as L
13-
import Data.Text.Lazy.Encoding qualified as LE
13+
import Data.Text.Lazy qualified as TL
14+
import Data.Text.Lazy.Encoding qualified as TLE
1415
import HTMLEntities.Text qualified as HE
1516
import Web.Atomic.Html
1617
import Web.Atomic.Types
1718

1819

19-
renderLazyText :: Html () -> L.Text
20-
renderLazyText = L.fromStrict . renderText
20+
renderLazyText :: Html () -> TL.Text
21+
renderLazyText = TL.fromStrict . renderText
2122

2223

2324
renderLazyByteString :: Html () -> BL.ByteString
24-
renderLazyByteString = LE.encodeUtf8 . renderLazyText
25+
renderLazyByteString = TLE.encodeUtf8 . renderLazyText
2526

2627

2728
{- | Renders a 'View' as HTML with embedded CSS class definitions
@@ -178,7 +179,7 @@ addIndent n (Line e ind t) = Line e (ind + n) t
178179

179180
-- | Render lines to text
180181
renderLines :: [Line] -> Text
181-
renderLines = snd . foldl' nextLine (False, "")
182+
renderLines = snd . L.foldl' nextLine (False, "")
182183
where
183184
nextLine :: (Bool, Text) -> Line -> (Bool, Text)
184185
nextLine (newline, t) l = (nextNewline l, t <> currentLine newline l)

src/Web/Atomic/Types/Rule.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ rule cn ds = Rule cn mempty mempty ds
5555

5656

5757
ruleMap :: [Rule] -> Map Selector Rule
58-
ruleMap rs = foldl' (\m r -> M.insert (ruleSelector r) r m) M.empty rs
58+
ruleMap rs = L.foldl' (\m r -> M.insert (ruleSelector r) r m) M.empty rs
5959

6060

6161
{- | Add a property to a class

0 commit comments

Comments
 (0)