@Carols10cents So, I'm reading your book and I am struggling with enums.
You say they are algebraic, but i can't do math with them.
And I am trying to figure out why I should use them (except option)
what am I missing (3rd iteration re-reading this chapter)
-
-
Replying to @EmmettBray
Hi! In this context, "algebraic" is a type theory term: https://en.wikipedia.org/wiki/Algebraic_data_type … (enums are a sum type, specifically). They're useful in cases when you have this OR that OR another thing and nothing else.
2 replies 0 retweets 1 like
Replying to @Carols10cents @EmmettBray
So for example, on the website in your bio, the menu could be represented by an enum: enum Menu { Home, Web, Articles, Pictures, } and every page you have would be in one of those 4 categories. Does that help?
12:01 PM - 18 Jul 2019
0 replies
0 retweets
1 like
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.