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

What is the type signature of apply? #20

Open
AnthonyJacob opened this issue Mar 19, 2017 · 1 comment
Open

What is the type signature of apply? #20

AnthonyJacob opened this issue Mar 19, 2017 · 1 comment
Labels

Comments

@AnthonyJacob
Copy link

Scheme (and possibly racket) has function called apply and list. Will these function also be available in hackett? What about their type signatures?

Note:

Even though apply takes a list as an argument in scheme it would make much more sense to take a tuple as an argument. There should be also a tuple variant of list. Also foo and apply foo . tuple should be equal.

@lexi-lambda
Copy link
Owner

lexi-lambda commented Mar 21, 2017

It’s unlikely that either of these will exist as functions, but it’s quite possible they will exist as forms. The list form is already available as [ square brackets ], but as you mention, homogenous lists probably aren’t what you’re looking for, anyway. Tuples (of arbitrary size) are not currently implemented, but they are planned.

Addressing apply is a little trickier. Implementing it as a macro probably wouldn’t be too hard, but that would restrict higher-order usage. It’s possible that it could be implemented more cleverly, though, with the use of a special Tuple typeclass and some clever macro machinery.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants