summaryrefslogtreecommitdiff
path: root/provider/posts
diff options
context:
space:
mode:
Diffstat (limited to 'provider/posts')
-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)).