Skip to content

Can application state type be a typeclass? #514

Closed Answered by jtdaugherty
amano-kenji asked this question in Q&A
Discussion options

You must be logged in to vote

this is just a way to prevent switching and pattern matching from growing huge

I guess I'm not clear on why you think this is a problem. I don't think it's a problem, so I don't see it as something to be avoided.

Brick wasn't designed to do this with typeclass

That's right; I'm not even sure this makes any sense. At least if a type class was involved, I'm not sure how that would add any benefit. As for or some sort of polymorphism, that's what the s type is for in App. The polymorphism is already there.

One of the big drawbacks of using a type class for, say, existentially quantified types, is that they cause all kinds of trouble when you have to unpack constructors and convince the c…

Replies: 2 comments 12 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
12 replies
@amano-kenji
Comment options

@jtdaugherty
Comment options

@amano-kenji
Comment options

@jtdaugherty
Comment options

Answer selected by jtdaugherty
@amano-kenji
Comment options

@amano-kenji
Comment options

@amano-kenji
Comment options

@amano-kenji
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants