Closed SimonMeskens closed 6 years ago
Added playground link with types, you can also find the sample under 'examples/pattern-matching/list.ts'
@masaeedu, I haven't seen you reply anything, so I'm going to assume this sample is typed correctly and close this. Feel free to ask me to open again if I'm wrong. I know this could potentially use a more generic definition for the nil/cons/match construct that is compatible with the other samples, but I couldn't figure out a way.
Sorry, been busy with other stuff. AFAICT the results look good, it's producing number
and number[]
as it should. I'm afraid I can't be too much help with verifying the correctness of the other stuff.
That's good enough for now then. I might look into a more generic ADT pattern matcher type later. Just wanted to do some housekeeping :)
@masaeedu
Playground: With TypeProps