Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Lennart Augustsson <lennart <at> augustsson.net>
Subject: ANN: typehash version 1.3
Newsgroups: gmane.comp.lang.haskell.cafe
Date: Sunday 14th December 2008 23:47:25 UTC (over 8 years ago)
The typehash library allows you to produce a unique identifier (a
cryptographic hash) for a type.
This is useful if you save values of some type to a file (text,
binary, whatever format you wish)
and then when you read it back in again you want to verify that the
type you want to read is the
one you actually wrote.
The type hash takes into account both the actual name of the type and
the structure of the type.
The type hash is a compact value that only allows comparing for equality.

The library also supports type codes.  A type code encodes the
complete structure of a type and
can be used for finer comparison than just equality, e.g., will the
read function be able to read
what show produced (in this case renaming types and adding
constructors is allowed).

The library is on hackage, of course.

  -- Lennart
 
CD: 3ms