unison-hash-0.0.0
Safe HaskellNone
LanguageHaskell2010

Unison.Hash

Synopsis

Documentation

newtype Hash Source #

A hash.

Constructors

Hash ShortByteString 

Instances

Instances details
Generic Hash Source # 
Instance details

Defined in Unison.Hash

Associated Types

type Rep Hash :: Type -> Type #

Methods

from :: Hash -> Rep Hash x #

to :: Rep Hash x -> Hash #

Show Hash Source # 
Instance details

Defined in Unison.Hash

Methods

showsPrec :: Int -> Hash -> ShowS #

show :: Hash -> String #

showList :: [Hash] -> ShowS #

Eq Hash Source # 
Instance details

Defined in Unison.Hash

Methods

(==) :: Hash -> Hash -> Bool #

(/=) :: Hash -> Hash -> Bool #

Ord Hash Source # 
Instance details

Defined in Unison.Hash

Methods

compare :: Hash -> Hash -> Ordering #

(<) :: Hash -> Hash -> Bool #

(<=) :: Hash -> Hash -> Bool #

(>) :: Hash -> Hash -> Bool #

(>=) :: Hash -> Hash -> Bool #

max :: Hash -> Hash -> Hash #

min :: Hash -> Hash -> Hash #

From Hash Text Source # 
Instance details

Defined in Unison.Hash

Methods

from :: Hash -> Text #

From Hash Hash32 Source # 
Instance details

Defined in Unison.Hash32

Methods

from :: Hash -> Hash32 #

From Hash32 Hash Source # 
Instance details

Defined in Unison.Hash32

Methods

from :: Hash32 -> Hash #

type Rep Hash Source # 
Instance details

Defined in Unison.Hash

type Rep Hash = D1 ('MetaData "Hash" "Unison.Hash" "unison-hash-0.0.0-89xUPcq1YDX4TbDWy6AuPS" 'True) (C1 ('MetaCons "Hash" 'PrefixI 'True) (S1 ('MetaSel ('Just "toShort") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ShortByteString)))

newtype HashFor t Source #

A hash tagged with the type it's a hash of, useful for maintaining type safety guarantees.

Constructors

HashFor 

Fields

Instances

Instances details
Generic (HashFor t) Source # 
Instance details

Defined in Unison.Hash

Associated Types

type Rep (HashFor t) :: Type -> Type #

Methods

from :: HashFor t -> Rep (HashFor t) x #

to :: Rep (HashFor t) x -> HashFor t #

Show (HashFor t) Source # 
Instance details

Defined in Unison.Hash

Methods

showsPrec :: Int -> HashFor t -> ShowS #

show :: HashFor t -> String #

showList :: [HashFor t] -> ShowS #

Eq (HashFor t) Source # 
Instance details

Defined in Unison.Hash

Methods

(==) :: HashFor t -> HashFor t -> Bool #

(/=) :: HashFor t -> HashFor t -> Bool #

Ord (HashFor t) Source # 
Instance details

Defined in Unison.Hash

Methods

compare :: HashFor t -> HashFor t -> Ordering #

(<) :: HashFor t -> HashFor t -> Bool #

(<=) :: HashFor t -> HashFor t -> Bool #

(>) :: HashFor t -> HashFor t -> Bool #

(>=) :: HashFor t -> HashFor t -> Bool #

max :: HashFor t -> HashFor t -> HashFor t #

min :: HashFor t -> HashFor t -> HashFor t #

type Rep (HashFor t) Source # 
Instance details

Defined in Unison.Hash

type Rep (HashFor t) = Rep Hash

ShortByteString conversions

ByteString conversions

fromByteString :: ByteString -> Hash Source #

Convert a byte string to a hash.

toByteString :: Hash -> ByteString Source #

Convert a hash to a byte string.

Base32Hex conversions

fromBase32Hex :: Base32Hex -> Hash Source #

Convert base32 hex to a hash.

toBase32Hex :: Hash -> Base32Hex Source #

Convert a hash to base32 hex.

Base32Hex Text conversions

fromBase32HexText :: Text -> Maybe Hash Source #

Produce a Hash from a base32hex-encoded version of its binary representation

unsafeFromBase32HexText :: Text -> Hash Source #

Convert a hash from base32 hex without any validation.

toBase32HexText :: Hash -> Text Source #

Return the lowercase unpadded base32Hex encoding of this Hash. Multibase prefix would be v, see https://github.com/multiformats/multibase