Safe Haskell | None |
---|---|
Language | Haskell2010 |
Gotyno.Helpers
Synopsis
- newtype LiteralString = LiteralString Text
- newtype StringEncodedInteger = StringEncodedInteger Integer
- checkEqualTo :: (Eq a, Show a) => a -> a -> Parser a
Documentation
newtype LiteralString Source #
Used for a more explicit style in toJSON
instances. It also means we don't have to add type
annotations after the value.
Constructors
LiteralString Text |
Instances
Eq LiteralString Source # | |
Defined in Gotyno.Helpers Methods (==) :: LiteralString -> LiteralString -> Bool # (/=) :: LiteralString -> LiteralString -> Bool # | |
Show LiteralString Source # | |
Defined in Gotyno.Helpers Methods showsPrec :: Int -> LiteralString -> ShowS # show :: LiteralString -> String # showList :: [LiteralString] -> ShowS # | |
ToJSON LiteralString Source # | |
Defined in Gotyno.Helpers Methods toJSON :: LiteralString -> Value # toEncoding :: LiteralString -> Encoding # toJSONList :: [LiteralString] -> Value # toEncodingList :: [LiteralString] -> Encoding # |
newtype StringEncodedInteger Source #
Used to encode Integer
({I,U}{64,128}) values, because there are ecosystems where these
cannot be decoded properly without having them come in as strings in transit.
Constructors
StringEncodedInteger Integer |
Instances
Eq StringEncodedInteger Source # | |
Defined in Gotyno.Helpers Methods (==) :: StringEncodedInteger -> StringEncodedInteger -> Bool # (/=) :: StringEncodedInteger -> StringEncodedInteger -> Bool # | |
Show StringEncodedInteger Source # | |
Defined in Gotyno.Helpers Methods showsPrec :: Int -> StringEncodedInteger -> ShowS # show :: StringEncodedInteger -> String # showList :: [StringEncodedInteger] -> ShowS # | |
ToJSON StringEncodedInteger Source # | |
Defined in Gotyno.Helpers Methods toJSON :: StringEncodedInteger -> Value # toEncoding :: StringEncodedInteger -> Encoding # toJSONList :: [StringEncodedInteger] -> Value # toEncodingList :: [StringEncodedInteger] -> Encoding # | |
FromJSON StringEncodedInteger Source # | |
Defined in Gotyno.Helpers Methods parseJSON :: Value -> Parser StringEncodedInteger # parseJSONList :: Value -> Parser [StringEncodedInteger] # |