3 ms·
Pretty sure it's standard practice to always do "t[space]:[space]T" with equidistant spaces between the colon. In spite of Type Theory generally being an incons
by dvt 3y ago
Pretty sure it's standard practice to always do "t[space]:[space]T" with equidistant spaces between the colon. In spite of Type Theory generally being an inconsistent mess, this is a rare case where everyone seems to be fairly consistent. I was actually curious how I did it in undergrad, and even I had the common-sense of making it look nicely symmetrical[1] :)
[1] https://dvt.name/logic/horse2.pdf https://dvt.name/logic/horse2.pdf
- agalunar 3y agoAh, I should've been more explicit that I was referring to programming language syntax. For example, this is unfortunately not the convention in Python, Rust, Swift, or TypeScript.
- dvt 3y agoAh gotcha, I actually 100% agree here. I think both the parser (and my brain) would probably be better served by space on both sides of a variable : type (or type : variable) declaration.
- chrisweekly 3y agoFor my part, while I have some mixed feelings about introducing whitespace signifigance, I sympathize w the OP and in TypeScript projects, have sometimes wished for more intuitive disambiguation. As for conventions, I might prefer key: value (trailing space for eg JS props), vs foo :type (leading space for types)
- EarthLaunch 3y agoI try to do this at home [eg 0] and it flabbergasted some coworkers when one such notation accidentally slipped into a day job PR last year. I didn't try to argue for it- but I like it personally, mainly for making control flow easier to skim. 0: https://github.com/Suncapped/babs/blob/prod/src/shared/SharedZone.ts https://github.com/Suncapped/babs/blob/prod/src/shared/Share...