Created
May 3, 2020 09:48
-
-
Save supermanue/9e970484773f042010c4f8c275a00ad0 to your computer and use it in GitHub Desktop.
refined_6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def updateVersion(input: UserInput): Either[String, UserInput] = | |
for { | |
name <- refineV[NameRestrictions](input.name) | |
namespace <- refineV[NamespaceRestrictions](input.namespace) | |
version = getLatestVersion(name, namespace) | |
updatedVersion <- refineV[VersionRestrictions](version.value +1) | |
result = store(Schema(name, namespace, version)) | |
} yield (UserInput(schema.name.value, schema.namespace.value)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment