#would be nicer if there was a way to auto-reassociate sum types
Explore tagged Tumblr posts
Text
checked errors expressed via sum-types is so good, especially if there's some species of inheritance for easy sum-type composition. I don't have to know what the hell any of the names mean but my coworkers can assign personal meaning to them, if I want to know what behavior triggers it I can just. yanno. ripgrep for throw @Error {whatever structured logging needs}
#would be nicer if there was a way to auto-reassociate sum types#the same way that safe coerce is basically 'fuk u u know what type i mean'#proposal for row types in haskell iirc is mostly a combination of not wanting to kill yourself when writing apis for 'idiomatic duck-typed'#json microservices where it can give you an int a string an undefined OR a null on error. and they all mean different things.#and also so you can write partial error handlers and you get good composition so as long as you handle all cases it typechecks
0 notes