Skip to content

Instantly share code, notes, and snippets.

@sellmair
Created May 10, 2018 16:01
Show Gist options
  • Save sellmair/6258a82ead0099c47af296379e8737dd to your computer and use it in GitHub Desktop.
Save sellmair/6258a82ead0099c47af296379e8737dd to your computer and use it in GitHub Desktop.
Phantom Types in Kotlin: Modelling a Pipeline Stages
interface Stage : ReadMeasureSettings, ReadTimestamp {
interface Pending : Stage, ReadRawImage
interface ShapeDetection : Stage, ReadPreparedImage
interface FeatureDetection : Stage, ReadPreparedImage, ReadShapes
interface PersonDetection : Stage, ReadPreparedImage, ReadFeatures
interface Measurement : Stage, ReadPeople
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment