Skip to content
Discussion options

You must be logged in to vote

This is a common misconception. The type of parameters specifies the "maximum" effect type of functions that can be passed in. Because the overall effect includes console, the function passed as a parameter can also use the console effect.

When you pass in a function without the console effect Koka automatically "opens" the effect type before checking it against the parameter type. It is sort of a subtyping relation.

So you are not "forcing" the passed function to have the console effect. You are just saying that if a function needs fewer effects, and it is running in a context that has access to more effects, then it will still work since it will only use the effects it needs, and all of…

Replies: 2 comments 10 replies

Comment options

You must be logged in to vote
1 reply
@ZMan1345
Comment options

Answer selected by ZMan1345
Comment options

You must be logged in to vote
9 replies
@osa1
Comment options

@TimWhiting
Comment options

@TimWhiting
Comment options

@osa1
Comment options

@TimWhiting
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
3 participants