Created
January 5, 2017 22:20
-
-
Save zeryx/aea033daee81115f215028bbd8e74293 to your computer and use it in GitHub Desktop.
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
object Input { | |
implicit def inputCodec: CodecJson[Input] = { | |
val encoder = { | |
case train: Train => Train.trainCodec.encode(train) | |
case predict: Predict => Predict.predictCodec.encode(predict) | |
} | |
val decoder = (json: HCursor) => Predict.predictCodec.decode(json) orElse Train.trainCodec.decode(json) | |
CodecJson[Input](encoder, decoder) | |
} | |
} |
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
Error:(38, 19) missing parameter type for expanded function | |
The argument types of an anonymous function must be fully known. (SLS 8.5) | |
Expected type was: ? | |
val encoder = { | |
Error:(42, 72) value orElse is not a member of argonaut.DecodeResult[algorithmia.TechSupport.Predict] | |
val decoder = (json: HCursor) => Predict.predictCodec.decode(json) orElse Train.trainCodec.decode(json) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment