Skip to content

Drop support for curried type lambdas #3089

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

Closed
smarter opened this issue Sep 8, 2017 · 6 comments
Closed

Drop support for curried type lambdas #3089

smarter opened this issue Sep 8, 2017 · 6 comments

Comments

@smarter
Copy link
Member

smarter commented Sep 8, 2017

It's not clear at all how they should interact with higher-kinded type parameter inference, in any case they are likely to make it harder to abstract over type lambdas, and to require some uncurry and curry type functions. Their main use-case is reduced verbosity, but this can also be achieved by having some form of inline syntax for type lambdas like https://github.com/non/kind-projector#inline-syntax (related discussion: #2041)

@ghost
Copy link

ghost commented Sep 9, 2017

Hi, like discussed in the gitter channel, I am likely to vote pro, with the restriction that mixing curried and uncurried versions is restricted (the scope of this restriction should somehow be defined).

You can always explicitly curry or uncurry as I did for the state transformer
type CurriedState = [S] => [>-->[- _, + _]] => State[S, >-->]

@ghost
Copy link

ghost commented Sep 9, 2017

I would even argue to be able to define

type Curried = [M[_, _[- _, + _]]] => [S] => [>-->[- _, + _]] => M[S, >-->]
and
type CurriedState = Curried[State]

but that does not seem to work (yet (?))

@odersky
Copy link
Contributor

odersky commented Sep 13, 2017

In the interest of regularity I'd tend to leave them in.

@smarter
Copy link
Member Author

smarter commented Sep 13, 2017

Leaving them in will require work to make them function correctly, for example in #3061 we assume in various places that AppliedTypes are not higher-kinded.

@ghost
Copy link

ghost commented Sep 13, 2017

Martin,

maybe, like I said before,only a limited amount of mixing should be supported (not sure)

in my GitHub project https://github.com/LucDupAtGitHub/Feature-Based-Functional-Programming-with-Dotty I encounter a situation:

class StateComputationTransformer[S, M[+ _]: Computation]
    extends KleisliStateProgramType[S, M]
    with Computation[StateTransformed[S, M]]
    with State[S, Kleisli[StateTransformed[S, M]]] {

that works, but using a curried StateTransformed and State

class StateComputationTransformer[S, M[+ _]: Computation]
    extends KleisliStateProgramType[S, M]
    with Computation[StateTransformed[S][M]]
    with State[S][Kleisli[StateTransformed[S][M]]] {

it does not

well: should it work [ maybe this kind of mixing is one step to far (?)

Anyway, I did not really need the curried version because I could explicitly use

type CurriedState = [S] => [>-->[- _, + _]] => State[S, >-->]

and

class RandomPrograms[>-->[- _, + _]: Program: CurriedState[Seed]]

where needed

@odersky
Copy link
Contributor

odersky commented Apr 5, 2022

Since they have been in for a while now I think we can close this

@odersky odersky closed this as completed Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants