Top all-time · #2561
Giulio Canti
Personal blog · gcanti.github.ioprogrammingweb
Giulio Canti's personal blog at gcanti.github.io covers programming and web. Since 2014, 33 different Hacker News readers have linked it 63 times, most often “Typed Functional Programming in TypeScript”. The last post was in 2015, but the archive is still widely read.
Most-linked posts?
- Typed Functional Programming in TypeScript8 people · 8 mentions · first linked 2019-04-01
- /io-ts/6 people · 6 mentions · first linked 2020-02-18
- /fp-ts/modules/3 people · 4 mentions · first linked 2019-06-19
- Understanding React and reimplementing it from scratch3 people · 4 mentions · first linked 2014-10-29
- Show HN: Tcomb.js – JavaScript types and combinators2 people · 2 mentions · first linked 2014-08-04
- /fp-ts/modules/Either.ts.html2 people · 2 mentions · first linked 2023-03-16
- Replacing propTypes with type annotations in React 0.132 people · 2 mentions · first linked 2015-02-03
- /fp-ts/modules/function.ts.html2 people · 2 mentions · first linked 2022-08-07
What Hacker News says?
fp-ts [0] and the accompanying io-ts [1] are very well designed and neatly implemented. I'd consider them the reference for all things FP in Typescript. In practice though I find that they don't mesh well with the language and ecosystem at large. Using them in a React/Vue/Whatever app will catch you at every step, as neither the language nor the frameworks have these principles at their core. It takes a lot of effor…
Comment linking /io-ts/
on “Learn how to unleash the full potential of the type system of TypeScript”Submitted What if your domain model could validate the UI for free? as a story · 27 points
HN discussionI think it’s great that functional programming is making its way into traditional imperative languages - even JavaScript (I recently came across https://gcanti.github.io/fp-ts/ as a pretty extreme example) Elixir/Erlang has function-level pattern matching, which I really like. I’ve yet to see it anywhere else, though my understanding is it came from Prolog.
Comment linking /fp-ts/
on “From a lorry driver to Ruby on rails developer at 38”Submitted Six reasons to define JavaScript constructors with only one argument as a story · 11 points
HN discussionSerious question, not dismissing any of your work but why implement it yourself when there's plenty of such implementations in TS land already. fp-ts has an Either type e.g. but there's plenty of such libraries. https://gcanti.github.io/fp-ts/modules/Either.ts.html
Comment linking /fp-ts/modules/Either.ts.html
on “Ask HN: What are you working on? (September 2025)”Submitted JSON Api deserialization into an object model with tcomb.js as a story · 6 points
HN discussionThe Python community just doesn't have good tools to type dictionaries. In JavaScript, you can use a tool like tcomb[1] that lets you specify the structure of your data and add functionality onto that data. Throwing raw dictionaries around in your program isn't maintainable, but if you adopt the Clojure ethos that functions operate on data that meets a set of requirements, you'll have maintainable code without a typ…
Comment linking /tcomb/
on “Records: Python library for making raw SQL queries to Postgres databases”Submitted Show HN: Tcomb-form – React.js UI library for developing forms writing less code as a story · 5 points
HN discussionTypescript has a hole type too implemented in fp-ts and effect-ts. Super useful for when you don't know what are you missing and get a type signature for it. It's mostly useful for when you declare some `const foo: (bar: Bar) => Whatever` and in the midst of your implementation you don't know what you're missing. Requires an advanced level in TS to be used to the max. https://gcanti.github.io/fp-ts/modules/function.…
Comment linking /fp-ts/modules/function.ts.html
on “Hazel: A live functional programming environment featuring typed holes”Submitted Understanding React and reimplementing it from scratch as a story · 5 points
HN discussion> One reason for this change is to make it possible to use object literals or record syntax where that is more appropriate than function calls I think this will be the most revolutionary aspect in the next months, both for development and tests. I wrote an article explaining why I have this opinion: https://gcanti.github.io/2014/10/29/understanding-react-and-...
Comment linking /2014/10/29/understanding-react-and-reimplementing-it-from-scratch-part-1.html
on “React v0.12”Submitted Introduction to set theory with JavaScript as a story · 5 points
HN discussionInstead of the "deep path properties" syntax, you might want to take the opportunity to learn about functional lenses with monocle-ts https://gcanti.github.io/monocle-ts/
Comment linking /monocle-ts/
on “Deep cloning objects in JavaScript”Submitted An alternative syntax for React propTypes as a story · 5 points
HN discussionThis looks pretty cool: http://gcanti.github.io/resources/tcomb-react-bootstrap/play...
Comment linking /resources/tcomb-react-bootstrap/playground/playground.html
on “React Components”Submitted Typed Functional Programming in TypeScript as a story · 2 points
HN discussionSeveral comments here are along the lines of "I haven't done much monadic error handling but here's why it's bad." That's silly because the benefits of this type of programming can't be grokked until you use it on real projects.. it's honest-to-goodness not enough to look at small examples and judge whether it's worthwhile or not. There's a lot of this realization going around actually - for example Rust's main rais…
Comment linking /fp-ts/modules/
on “Elegant Error Handling with the JavaScript “Either” Monad”Submitted Understanding React and reimplementing it from scratch as a story · 2 points
HN discussionIt doesn't use json schema but you might be interested in something like this: https://gcanti.github.io/io-ts/ (You can define runtime encoder/decoders which produce typed values.)
Comment linking /io-ts/
on “Parsix: Parse Don't Validate”Submitted Show HN: A compact, flexible, skinnable form library for React.js as a story · 2 points
HN discussionI've never seen runtypes, but I've seen io-ts [1]. Are you aware of the pros/cons between them? [1] https://gcanti.github.io/io-ts/
Comment linking /io-ts/
on “JSON Schema bundling formalised”Submitted Replacing propTypes with type annotations in React 0.13 as a story · 2 points
HN discussionI agree. This is what fp-ts's pipe[1] function does. It also has flow[2], which is basically a reversed compose. [1]: https://gcanti.github.io/fp-ts/modules/function.ts.html#pipe [2]: https://gcanti.github.io/fp-ts/modules/function.ts.html#flow
Comment linking /fp-ts/modules/function.ts.html
on “A generically typed pipe function in TypeScript”Submitted JavaScript, Types and Sets (Part II) and a Side Note on React.js as a story · 2 points
HN discussionThis is great, thanks for sharing. I'm currently using @arrows/composition https://caderek.github.io/arrows/packages/composition/#pipe because of the light way library approach, which you seem to share. I also try fp-ts https://github.com/gcanti/fp-ts but is a bit an academic style, so difficult to introduce in everyday work. Implementation of pipe: https://gcanti.github.io/fp-ts/modules/function.ts.html#pipe I stil…
Comment linking /fp-ts/modules/function.ts.html
on “A generically typed pipe function in TypeScript”Submitted JSON API Part 2: validation in Node.js with type combinators as a story · 2 points
HN discussionYou might be interested in `fp-ts` (and the related `io-ts`). https://gcanti.github.io/fp-ts/ https://gcanti.github.io/io-ts/
Comment linking /io-ts/
on “The problem with new URL(), and how URL.parse() fixes that”Submitted A JavaScript validation library based on type combinators as a story · 2 points
HN discussionIt's not that easy to fall to unsafe code if you know what you're doing, do not have typescript skill issues and use the right libraries, such as fp-ts or effect-ts (an evolution of Scala's ZIO on TypeScript). Those ecosystems are huge by the way, effect is still very niche-y due to its usage of functional programming and effect systems, niche in a sense, it gets more downloads than Angular. [1] https://gcanti.githu…
Comment linking /fp-ts/modules/
on “Experiment: Making TypeScript immutable-by-default”Submitted Show HN: A playground for react-bootstrap with debugging support as a story · 2 points
HN discussion