unordered-containers

Haskell: Data.HashSet (from unordered-container) Performance for Large Sets

妖精的绣舞 提交于 2019-12-23 08:14:22
问题 The data First of all, let's generate some input so we have concrete data to talk about: python -c 'for f in xrange(4000000): print f' > input.txt this will generate a file input.txt containing the numbers from 0 to 3999999, each on its own line. That means we should have a file with 4,000,000 lines, adding up to 30,888,890 bytes, roughly 29 MiB. Everything as a list Right, let's load everything into memory as a [Text] : import Data.Conduit import Data.Text (Text) import Control.Monad.Trans

Haskell: Data.HashSet (from unordered-container) Performance for Large Sets

不打扰是莪最后的温柔 提交于 2019-12-23 08:13:36
问题 The data First of all, let's generate some input so we have concrete data to talk about: python -c 'for f in xrange(4000000): print f' > input.txt this will generate a file input.txt containing the numbers from 0 to 3999999, each on its own line. That means we should have a file with 4,000,000 lines, adding up to 30,888,890 bytes, roughly 29 MiB. Everything as a list Right, let's load everything into memory as a [Text] : import Data.Conduit import Data.Text (Text) import Control.Monad.Trans

Haskell: Data.HashSet (from unordered-container) Performance for Large Sets

被刻印的时光 ゝ 提交于 2019-12-23 08:13:07
问题 The data First of all, let's generate some input so we have concrete data to talk about: python -c 'for f in xrange(4000000): print f' > input.txt this will generate a file input.txt containing the numbers from 0 to 3999999, each on its own line. That means we should have a file with 4,000,000 lines, adding up to 30,888,890 bytes, roughly 29 MiB. Everything as a list Right, let's load everything into memory as a [Text] : import Data.Conduit import Data.Text (Text) import Control.Monad.Trans

M.Map sudden expected type error

柔情痞子 提交于 2019-12-18 09:08:32
问题 Everything was working great up until about a month or so ago... Suddenly I'm getting berkson.github.io/source/blog.hs: 333, 42 • Couldn't match type ‘unordered-containers-0.2.7.1:Data.HashMap.Base.HashMap text-1.2.2.1:Data.Text.Internal.Text aeson-0.11.2.0:Data.Aeson.Types.Internal.Value’ with ‘M.Map [Char] [Char]’ Expected type: M.Map [Char] [Char] Actual type: Metadata • In the first argument of ‘(M.!)’, namely ‘md’ In the first argument of ‘(++)’, namely ‘(md M.! "author")’ In the second