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
We're using a neat hack to create default temporary structures when we don't have enough information to create a filled one.
For example, have a look at code in lib/zhr_devs/submissions/aggregates/submission.ex:57
It's not a good design. If something doesn't make sense to have a default value of type a, then either that field of the thing has to be Nothing or Just a, or, sometimes, the whole thing should be Maybe (Thing a)
How
Tweak Maybe in Algae so that it preserves the underlying type information (see Uptight.Result.sum(e, a)). Ensure backwards-compatibility.
Replace structures and field with Maybes in zhr_devs
The text was updated successfully, but these errors were encountered:
Why?
We're using a neat hack to create default temporary structures when we don't have enough information to create a filled one.
For example, have a look at code in lib/zhr_devs/submissions/aggregates/submission.ex:57
It's not a good design. If something doesn't make sense to have a default value of type
a
, then either that field of the thing has to beNothing
orJust a
, or, sometimes, the whole thing should beMaybe (Thing a)
How
Maybe
in Algae so that it preserves the underlying type information (seeUptight.Result.sum(e, a)
). Ensure backwards-compatibility.The text was updated successfully, but these errors were encountered: