There's no "silly mnemonics" involved at all, and no arbitrary choices. Left a because a is on the left in Either a b, Right b as it's on the right.
Conversation
So what happens when you need to write a function to find and print the errors? Now ok and error are flipped.
1
That's definitely an issue. That's why I'd suggest having a wrapper with instances biased to the error. It's the less common case.
1
Can't say I agree with wrappers. Pointless and tiresome.
1
1
I think here you're confusing one specific use case with a simple, general type. It's "monads are not burritos, monads are not containers, ..." all over again.
1
Cool, I'm understanding your point better now.
1
This is kind of the problem with Haskell's nominal datatypes, canonical typeclass instances, and biased type and value abstraction in general. Pros and cons. Personally I'm a fan of just going with it an giving things meaningful names in lieu of anonymous unions.
2
1
I feel like there is work still to be done here - how to maintain the lovely compositional feeling of currying while also eliminating the need to settle on arbitrary biasing - in data structures, arguments, and instances. A non-trivial problem to solve.
1
1
I think you'd want something like row polymorphism for type parameters... has anyone actually implemented or studied that before?
1
1
Not sure. There was github.com/bitonic/tog/wi which highlights some issues with Agda's implicit arguments, which is an interesting, but related thing. The suggested alternative is quite complicated though.
1
I'm actually thinking maybe trying rows everywhere, even for function params. You can partially apply a few parameters, then pass it down the line for the next application. Might be too cumbersome in practice though. Not sure how similar that is to OCaml's labeled args…
Well yeah, I was assuming you already "have" row polymorphism for term-level function args in the language, and the hard question is how to do it for type args... and in a dependently typed language (or 1ML) there's presumably only 1 question, as hard as the second one.
1
1
(...though for all I know it _could_, conceivably, be "as simple as" lifting everything up a level and then you have a kind for rows of type arguments and that's it, in which case flattening-levels for DT might be harder...)


