Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Design section #36

Merged
merged 6 commits into from
Feb 27, 2023
Merged

Design section #36

merged 6 commits into from
Feb 27, 2023

Conversation

serras
Copy link
Member

@serras serras commented Feb 24, 2023

This PR brings a few articles published (or under publication) from 47's blog into a section about general design. The original sources are credited.

Note: @nomisRev's article about domain modeling was updated to talk about value class instead of inline class.

Copy link
Member

@nomisRev nomisRev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of remarks, but we can address them subsequent PRs.


The signature of `traverse` shows another important part of the monadic style of effects, namely _higher-kinded types_. Since monads are types which take other types as parameters -- like `Option` or `Result` --, to provide utility functions that work over different monads one must have a way to refer to those types. In Scala this is made explicit by the number of underscores after the type name, like `F[_]` above; in Haskell this is not made explicit in the signature, but is still checked by the compiler. Even after decades from their inception, higher-kinded types are still considered an advanced feature, and haven't made their way into mainstream programming languages.

The reason why Kotlin doesn't require higher-kinded types to provide similar abstraction is that the same functions which work over "regular" functions, like `map`, keep working when used in the coroutine world. Kotlin language designers have found, in my opinion, a great point in the design space, in which they can offer the same abilities but without the cost of such a complex feature.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we insert a small example here?

content/learn/design/effects-contexts.md Show resolved Hide resolved
content/learn/design/domain-modeling.md Show resolved Hide resolved
@serras serras merged commit db1cdb9 into main Feb 27, 2023
@serras serras deleted the design-section branch February 27, 2023 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants