agent: adds post to welcome

This commit is contained in:
Aaron Greenspan
2021-01-14 17:17:35 -07:00
committed by Aiden McClelland
parent 070835c40e
commit ad92660c76
4 changed files with 16 additions and 7 deletions

View File

@@ -57,7 +57,9 @@ instance Show Version where
instance IsString Version where
fromString s = either error id $ Atto.parseOnly parseVersion (T.pack s)
instance Read Version where
readsPrec i =
readsPrec _ s = case Atto.parseOnly parseVersion (T.pack s) of
Left _ -> []
Right a -> [(a, "")]
-- | A change in the value found at 'major' implies a breaking change in the API that this version number describes
major :: Version -> Word

View File

@@ -32,17 +32,19 @@ instance FromJSON VersionRange where
instance PersistField Version where
toPersistValue = toPersistValue @Text . show
fromPersistValue = first T.pack . Atto.parseOnly parseVersion <=< fromPersistValue
instance PersistFieldSql Version where
sqlType _ = SqlString
instance FromHttpApiData Version where
parseUrlPiece = first toS . Atto.parseOnly parseVersion
instance ToHttpApiData Version where
toUrlPiece = show
instance PathPiece Version where
toPathPiece = show
fromPathPiece = hush . Atto.parseOnly parseVersion
instance PathPiece VersionRange where
toPathPiece = show
fromPathPiece = hush . Atto.parseOnly parseRange
instance FromHttpApiData Version where
parseUrlPiece = first toS . Atto.parseOnly parseVersion
instance PathPiece Version where
toPathPiece = show
fromPathPiece = hush . Atto.parseOnly parseVersion