froebel icon indicating copy to clipboard operation
froebel copied to clipboard

Does the `pipe` type need to be recursive?

Open mindplay-dk opened this issue 2 years ago • 0 comments
trafficstars

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?

mindplay-dk avatar Mar 09 '23 08:03 mindplay-dk