Skip to content

Does the pipe type need to be recursive? #16

@mindplay-dk

Description

@mindplay-dk

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions