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

Does the pipe type need to be recursive? #16

Open
mindplay-dk opened this issue Mar 9, 2023 · 0 comments
Open

Does the pipe type need to be recursive? #16

mindplay-dk opened this issue Mar 9, 2023 · 0 comments

Comments

@mindplay-dk
Copy link

I saw your post about type-checking a pipe function here and posted a reply:

Does it need to be recursive?

Here's the approach I came up with, before giving up:

playground

My approach was to just take one item off the start of the list, and one item off the end of the list - derive the input arguments and output return types from the two lists, and then see if they're the same.

If we can compute a set of InputTypes and OutputTypes and just check if those match, why do we need the whole recursive thing?

For better error reporting maybe? I guess with my approach, the entire array will be faulted - whereas with your approach, the error will point to the individual argument at fault?

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

No branches or pull requests

1 participant