Worth noting that in a language with dependent types this sort of thing is almost trivial. Generalizing a heterogenous list get’s you 90% of the way there.
For validation he uses a type called Result e a, but doesn’t say where he gets it from. I tried looking around on Hoogle and Hackage but can’t really find where he gets it from? Anyone knows?
It’s in Data.Vinyl.Idiom.Validation now. It’s just Either with no Monad instance that allows it to have a different Applicative instance—one which accumulates error values as a monoid.
Vinyl is really neat.
Worth noting that in a language with dependent types this sort of thing is almost trivial. Generalizing a heterogenous list get’s you 90% of the way there.
Yes, indeed.
I spoke about Vinyl 0.4, and its denotation in Type Theory, at BayHac this weekend.
Slides (PDF link): https://github.com/VinylRecords/BayHac2014-Talk/blob/master/Talk.pdf Recording of slides w/ voice: https://vimeo.com/95694918
For validation he uses a type called
Result e a, but doesn’t say where he gets it from. I tried looking around on Hoogle and Hackage but can’t really find where he gets it from? Anyone knows?It’s in
Data.Vinyl.Idiom.Validationnow. It’s justEitherwith no Monad instance that allows it to have a differentApplicativeinstance—one which accumulates error values as a monoid.