sequor-0.7.2: A sequence labeler based on Collins's sequence perceptron.

Portabilityportable
Stabilityprovisional
Safe HaskellNone

Hashable

Description

Hashable class for hashable types, with instances for basic types. The only function of this class is

   hash :: (Bits b, Hashable h) => h -> b

Adapted from Milan Straka's code by Grzegorz Chrupala: Removed FFI and C dependency Use Bits b instead of hardcoded Int as a result type of hash

Synopsis

Documentation

class Hashable a whereSource

The class containing a function hash which computes the hash values of given value.

Methods

hash :: (Num b, Bits b) => a -> bSource

The computed hash value should be as collision-free as possible, the probability of hash a == hash b should ideally be 1 over the number of representable values in the result type.

Instances

Hashable Bool 
Hashable Char 
Hashable Int 
Hashable Int8 
Hashable Int16 
Hashable Int32 
Hashable Int64 
Hashable Word 
Hashable Word8 
Hashable Word16 
Hashable Word32 
Hashable Word64 
Hashable () 
Hashable ByteString 
Hashable ByteString 
Hashable Txt 
Hashable a => Hashable [a] 
Hashable a => Hashable (Maybe a) 
(Hashable a1, Hashable a2) => Hashable (a1, a2) 
(Hashable a1, Hashable a2, Hashable a3) => Hashable (a1, a2, a3) 
(Hashable a1, Hashable a2, Hashable a3, Hashable a4) => Hashable (a1, a2, a3, a4) 
(Hashable a1, Hashable a2, Hashable a3, Hashable a4, Hashable a5) => Hashable (a1, a2, a3, a4, a5) 
(Hashable a1, Hashable a2, Hashable a3, Hashable a4, Hashable a5, Hashable a6) => Hashable (a1, a2, a3, a4, a5, a6) 
(Hashable a1, Hashable a2, Hashable a3, Hashable a4, Hashable a5, Hashable a6, Hashable a7) => Hashable (a1, a2, a3, a4, a5, a6, a7) 

combine :: (Num b, Bits b) => b -> b -> bSource

Combines two given hash values.