You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I always have different operations on different ChromoField(name: String, dataType: DataType, rules: List[Rule]) based on their dataType value.
This brings me to pattern match on fields every time I have a function like f(field: ChromoField) just to be sure I'm working on a field typed as I expect.
Solution
I would be nice to find a way to pass no more ChromoField, but passing something like StringTyped ChromField or Int Typed ChromoField to reduce the verbosity of code and to gain type safety in codebase functions.
Problem Statement
I always have different operations on different
ChromoField(name: String, dataType: DataType, rules: List[Rule])
based on their dataType value.This brings me to pattern match on fields every time I have a function like
f(field: ChromoField)
just to be sure I'm working on a field typed as I expect.Solution
I would be nice to find a way to pass no more ChromoField, but passing something like
StringTyped ChromField
orInt Typed ChromoField
to reduce the verbosity of code and to gain type safety in codebase functions.References
https://github.com/fthomas/refined
The text was updated successfully, but these errors were encountered: