Skip to content

Commit

Permalink
Add FromText instances for Int64, String and Seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
tmortiboy authored and brendanhay committed Sep 6, 2018
1 parent 248f7b2 commit c0bdafc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/src/Network/AWS/Data/Text.hs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ class FromText a where
instance FromText Text where
parser = A.takeText

instance FromText String where
parser = Text.unpack <$> A.takeText

instance FromText ByteString where
parser = Text.encodeUtf8 <$> A.takeText

Expand All @@ -84,6 +87,9 @@ instance FromText Char where
instance FromText Int where
parser = A.signed A.decimal <* A.endOfInput

instance FromText Int64 where
parser = A.signed A.decimal <* A.endOfInput

instance FromText Integer where
parser = A.signed A.decimal <* A.endOfInput

Expand Down
1 change: 1 addition & 0 deletions core/src/Network/AWS/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,7 @@ newtype Seconds = Seconds Int
, ToQuery
, ToByteString
, ToText
, FromText
)

instance Hashable Seconds
Expand Down

0 comments on commit c0bdafc

Please sign in to comment.