Application design around sum types. #478
Closed
amano-kenji
started this conversation in
Ideas
Replies: 1 comment
-
I'm going to elevate it to an issue. |
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 have a code like this
nestEventM'
results in two lines. I came up withzoomOut
which compresses two lines into one line.With
zoomOut
, the code looks like this. This actually works.Now, I can use zoom and zoomOut together, and there is one less line for sum types.
My problem was that
nestEventM'
involved a bit of boilerplate for sum types. I haven't really looked into convertingState
into a product type that contains all application modes simultaneously. I'm reasonably satisfied withzoomOut
in my application.What do you think is the right way or the best practice? What is the problem in this case? I think this codebase is small enough to understand the problem immediately. My whole codebase looks like this.
mode
is shared among all modes.UIState
describes application modes. I'm open to a better way to do things if you can show me a broad picture.Beta Was this translation helpful? Give feedback.
All reactions