Use Data.Map on streaming side as well
This commit is contained in:
parent
87f6eb00f6
commit
e189f87dd7
@ -17,7 +17,7 @@ import System.IO
|
||||
|
||||
import qualified Data.Foldable as F
|
||||
|
||||
import qualified Data.Trie as Trie
|
||||
import qualified Data.Map.Strict as Map
|
||||
|
||||
import Data.Maybe
|
||||
(fromMaybe)
|
||||
@ -36,7 +36,7 @@ run = do
|
||||
datDir <- fromMaybe "./" <$> lookupEnv "HOME"
|
||||
runResourceT $ do
|
||||
x <- runConduit stream
|
||||
runConduit (CL.sourceList (Trie.keys x) .| C.map (<> "\n") .| CB.sinkFileCautious (datDir </> ".addressbook.dat"))
|
||||
runConduit (CL.sourceList (Map.keys x) .| C.map (<> "\n") .| CB.sinkFileCautious (datDir </> ".addressbook.dat"))
|
||||
where
|
||||
separate = \case
|
||||
From x -> [x]
|
||||
@ -49,4 +49,4 @@ run = do
|
||||
.| combine
|
||||
.| C.concatMap separate
|
||||
.| CT.encode CT.utf8
|
||||
.| C.foldMap (`Trie.singleton` ())
|
||||
.| C.foldMap (`Map.singleton` ())
|
||||
|
Loading…
Reference in New Issue
Block a user