Replies: 1 comment
-
It's going to be difficult. Pattern matching without built-in language support is going to be very limited in general. Your solutions are alright. Maybe there's a better one, but I'm not sure |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am spoiled by Kotlin's sealed classes/interfaces which allow for state compositions like:
Ignoring the parent
Failure
interface, is there a way to modelCase1
andCase2
using Freezed?I have tried two approaches:
1 defines duplicate cases and does not support inheritance.
2, while more accurate, is more verbose and also does not support inheritance.
Is there a better way to model this use case?
Beta Was this translation helpful? Give feedback.
All reactions