Skip to content

Lazy variant of Hashed? #155

Open
Open
@mikeplus64

Description

This would be useful for me for a type (living in a TVar) that:

  • updates frequently
  • has an expensive hash function
  • needs to check hashes infrequently

The implementation should be exactly the same as 'Hashed' without the {-# UNPACK #-} !Int. Maybe have a typeclass:

class Hashable1 h => CacheableHashable h where
  hashed :: Hashable a => a -> h a
  unhashed :: h a -> a

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions