wwt / SwiftCurrent

A library for managing complex workflows in Swift
https://wwt.github.io/SwiftCurrent/
Apache License 2.0
308 stars 19 forks source link

Extreme type safety! #9

Closed Tyler-Keith-Thompson closed 3 years ago

Tyler-Keith-Thompson commented 3 years ago

Is your feature request related to a problem? Please describe.

Workflow has some sort of type safety at the moment and that's very helpful. We can take it much, much farther with the notion that compile-time errors are preferred.

Describe the solution you'd like

For example every FlowRepresentable can declare both an Input and Output, then when you create a workflow you can enforce (with a fluent API) that the next thing being presented has the same kind of Input that the last thing outputs.

Describe alternatives you've considered

We could not have type safety and just make everyone deal with "Any" for the rest of their lives, but that seems cruel.

Additional context

It's already done.....mostly.