diff options
| author | Gregor Kleen <gkleen@yggdrasil.li> | 2015-08-12 14:26:36 +0200 | 
|---|---|---|
| committer | Gregor Kleen <gkleen@yggdrasil.li> | 2015-08-12 14:26:36 +0200 | 
| commit | a568e0ccde5a9914512e3d3f5af850b4a652e47f (patch) | |
| tree | 4bac262a3ac9eedc15ff9b777fc532712e46c289 /provider/posts | |
| parent | a986d02401388cd0c89a816a3307496d40d4c8bf (diff) | |
| download | dirty-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
Diffstat (limited to 'provider/posts')
| -rw-r--r-- | provider/posts/beuteltier-3.md | 19 | 
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 | --- | ||
| 2 | title: An Update to the Type Level Utilities of an Overly Complicated Feedreader | ||
| 3 | published: 2015-08-12 | ||
| 4 | tags: Beuteltier | ||
| 5 | --- | ||
| 6 | |||
| 7 | I commited a change to `beuteltier/Beuteltier/Types/Util.hs` ("[…] Hashable update"). I | ||
| 8 | replaced the `Hashable` instances for `Object` and `MetaData` with a single, better | ||
| 9 | optimized function: | ||
| 10 | |||
| 11 | ~~~ {.haskell .numberLines} | ||
| 12 | objHash :: Applicative f => ObjectGen f -> f Int | ||
| 13 | -- ^ Two 'ObjectGen's hashes are a first indication of whether they are 'Equivalent' | ||
| 14 | objHash o = fmap hash $ (,) <$> (Set.toList . (^. mTags) <$> o ^. oMeta) <*> (Map.keys <$> o ^. oContent) | ||
| 15 | ~~~ | ||
| 16 | |||
| 17 | The new implementation allows computation of hashes without calling `generateObject` (that | ||
| 18 | function is evil — it makes sure the entire `Object` is "in RAM" (it isn´t actually, of | ||
| 19 | course (because haskell is lazy)—but I have no guarantee of that)). | ||
