Skip to content

Commit

Permalink
Adding Hashable instance for custom S3 types
Browse files Browse the repository at this point in the history
  • Loading branch information
brendanhay committed Mar 20, 2016
1 parent 4d0f410 commit 85f8a08
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions amazonka-s3/src/Network/AWS/S3/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ newtype BucketName = BucketName Text
, ToLog
)

instance Hashable BucketName

-- FIXME: Add the difference between weak + strong ETags and their respective
-- equalities if necessary, see: https://github.com/brendanhay/amazonka/issues/76
newtype ETag = ETag ByteString
Expand All @@ -84,6 +86,8 @@ newtype ETag = ETag ByteString
, ToLog
)

instance Hashable ETag

newtype ObjectVersionId = ObjectVersionId Text
deriving
( Eq
Expand All @@ -103,6 +107,8 @@ newtype ObjectVersionId = ObjectVersionId Text
, ToLog
)

instance Hashable ObjectVersionId

newtype LocationConstraint = LocationConstraint { constraintRegion :: Region }
deriving
( Eq
Expand All @@ -120,6 +126,8 @@ newtype LocationConstraint = LocationConstraint { constraintRegion :: Region }
_LocationConstraint :: Iso' LocationConstraint Region
_LocationConstraint = iso constraintRegion LocationConstraint

instance Hashable LocationConstraint

instance FromText LocationConstraint where
parser = LocationConstraint <$> (parser <|> go)
where
Expand Down Expand Up @@ -159,6 +167,8 @@ newtype ObjectKey = ObjectKey Text
, ToLog
)

instance Hashable ObjectKey

type Delimiter = Char

_ObjectKey :: Iso' ObjectKey Text
Expand Down

0 comments on commit 85f8a08

Please sign in to comment.