summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2015-08-12 14:26:36 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2015-08-12 14:26:36 +0200
commita568e0ccde5a9914512e3d3f5af850b4a652e47f (patch)
tree4bac262a3ac9eedc15ff9b777fc532712e46c289
parenta986d02401388cd0c89a816a3307496d40d4c8bf (diff)
downloaddirty-haskell.org-a568e0ccde5a9914512e3d3f5af850b4a652e47f.tar
dirty-haskell.org-a568e0ccde5a9914512e3d3f5af850b4a652e47f.tar.gz
dirty-haskell.org-a568e0ccde5a9914512e3d3f5af850b4a652e47f.tar.bz2
dirty-haskell.org-a568e0ccde5a9914512e3d3f5af850b4a652e47f.tar.xz
dirty-haskell.org-a568e0ccde5a9914512e3d3f5af850b4a652e47f.zip
beuteltier-3.md
-rw-r--r--provider/posts/beuteltier-3.md19
1 files changed, 19 insertions, 0 deletions
diff --git a/provider/posts/beuteltier-3.md b/provider/posts/beuteltier-3.md
new file mode 100644
index 0000000..79e105a
--- /dev/null
+++ b/provider/posts/beuteltier-3.md
@@ -0,0 +1,19 @@
1---
2title: An Update to the Type Level Utilities of an Overly Complicated Feedreader
3published: 2015-08-12
4tags: Beuteltier
5---
6
7I commited a change to `beuteltier/Beuteltier/Types/Util.hs` ("[…] Hashable update"). I
8replaced the `Hashable` instances for `Object` and `MetaData` with a single, better
9optimized function:
10
11~~~ {.haskell .numberLines}
12objHash :: Applicative f => ObjectGen f -> f Int
13-- ^ Two 'ObjectGen's hashes are a first indication of whether they are 'Equivalent'
14objHash o = fmap hash $ (,) <$> (Set.toList . (^. mTags) <$> o ^. oMeta) <*> (Map.keys <$> o ^. oContent)
15~~~
16
17The new implementation allows computation of hashes without calling `generateObject` (that
18function is evil — it makes sure the entire `Object` is "in RAM" (it isn´t actually, of
19course (because haskell is lazy)—but I have no guarantee of that)).