Typescript does a really good job with type aliases.
I hover over a value and get `Parsimmon.Result<any>`. I then import Parsimmon but with the name P, and hover types are now `P.Result<any>`. I'm impressed.
miniblog.
Related Posts
Counter-intuitively, if you're writing a parser for a programming language, you need it to be a total function. As soon as you build IDE tooling, you need ASTs from invalid or incomplete input.
The parser should return (Ast, List<Error>) rather than Result<Ast, Error>.
I've been compilation buffers in Emacs recently and I really appreciate the error and warning counts shown in the modeline.
I've added the equivalent feature to deadgrep: it shows result counts! Really useful when you're doing big refactorings.
Structs are great in Rust, but sometimes I find them a bit heavyweight. There's a little more syntax than e.g. OCaml, for type definitions and usages.
I end up using more structs (records) in OCaml as a result.
rust-analyzer has "convert tuple to named struct", which helps.
