miss-0: A Haskell git implimentation

Safe HaskellNone
LanguageHaskell2010

Data.Git.Hash

Description

Pretty much everything in git works by SHA1 hashes. The Sha1 type represents a 20-byte "binary" hash. The Sha1Hex type is for the 40-byte hex representation of a hash.

Synopsis

Documentation

newtype Sha1 Source #

A 20-byte "binary" SHA1 hash.

Constructors

Sha1 

Fields

Instances
Eq Sha1 Source # 
Instance details

Defined in Data.Git.Hash

Methods

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

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

Ord Sha1 Source # 
Instance details

Defined in Data.Git.Hash

Methods

compare :: Sha1 -> Sha1 -> Ordering #

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

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

(>) :: Sha1 -> Sha1 -> Bool #

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

max :: Sha1 -> Sha1 -> Sha1 #

min :: Sha1 -> Sha1 -> Sha1 #

Show Sha1 Source # 
Instance details

Defined in Data.Git.Hash

Methods

showsPrec :: Int -> Sha1 -> ShowS #

show :: Sha1 -> String #

showList :: [Sha1] -> ShowS #

validSha1 :: Sha1 -> Bool Source #

Ensure a Sha1 is valid (that is, is 20 bytes long).

newtype Sha1Hex Source #

A 40-byte hex representation of a SHA1 hash.

Constructors

Sha1Hex 
Instances
Eq Sha1Hex Source # 
Instance details

Defined in Data.Git.Hash

Methods

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

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

Ord Sha1Hex Source # 
Instance details

Defined in Data.Git.Hash

Show Sha1Hex Source # 
Instance details

Defined in Data.Git.Hash

IsString Sha1Hex Source #

This isn't checked; buyer beware.

Instance details

Defined in Data.Git.Hash

Methods

fromString :: String -> Sha1Hex #

validSha1Hex :: Sha1Hex -> Bool Source #

Ensure a Sha1Hex is valid (that is, is 40 bytes long and consists only of hex characters).

class HasSha1 a where Source #

A Hashable-alike for Sha1s.

Methods

sha1 :: a -> Sha1 Source #

Instances
HasSha1 ByteString Source #

Direct SHA1 of a lazy bytestring.

Instance details

Defined in Data.Git.Hash

Methods

sha1 :: ByteString -> Sha1 Source #

HasSha1 ByteString Source #

Direct SHA1 of a bytestring.

Instance details

Defined in Data.Git.Hash

Methods

sha1 :: ByteString -> Sha1 Source #

HasSha1 Tag Source # 
Instance details

Defined in Data.Git.Internal.Object

Methods

sha1 :: Tag -> Sha1 Source #

HasSha1 Object Source # 
Instance details

Defined in Data.Git.Internal.Object

Methods

sha1 :: Object -> Sha1 Source #

HasSha1 Commit Source # 
Instance details

Defined in Data.Git.Internal.Object

Methods

sha1 :: Commit -> Sha1 Source #

HasSha1 Tree Source # 
Instance details

Defined in Data.Git.Internal.Object

Methods

sha1 :: Tree -> Sha1 Source #

HasSha1 Blob Source # 
Instance details

Defined in Data.Git.Internal.Object

Methods

sha1 :: Blob -> Sha1 Source #

sha1hex :: HasSha1 a => a -> Sha1Hex Source #

Hash something to a Sha1Hex

fromHex :: Sha1Hex -> Sha1 Source #

Convert a Sha1Hex into a Sha1

toHex :: Sha1 -> Sha1Hex Source #

Convert a Sha1 to a Sha1Hex