Creating a Scientific Pitch Notation Type using template literal types
Gotta love TypeScript
Read more [madewithlove.com]
Posts tagged with types
Gotta love TypeScript
Read more [madewithlove.com]
The usage of phantom types is a simple type level trick which can help with this in practical settings, without requiring complicated features or making your code too abstract and less readable.
Read more [marcosh.github.io]
Join 9,500+ smart developers
Get my monthly newsletter with what I learn from running Spatie, building Oh Dear, and maintaining 300+ open source packages. Practical takes on Laravel, PHP, and AI that you can actually use.
No spam. Unsubscribe anytime. You can also follow me on X.
"Always fresh, useful tips and articles. Carefully selected community content. My favorite newsletter, which I look forward to every time."
– medium.com - submitted by Pavol Perdik
In this article Pavol Perdik writes about the native PostgreSQL type daterange and how to easily use it in Laravel.
Read more [medium.com]
My colleague Brent wrote another excellent blog post, this time on tests and types.
So while strong types can help us to ensure program correctness, some tests will always be a necessity to ensure business correctness. It's a matter of "both and", not "either or".
Read more [stitcher.io]
In an older but still relevant blogpost, Ondřej Mirtes, the author of PHPStan, explains the difference between union types and intersection types.
One of the headlining features of PHPStan 0.9 is the introduction of intersection types. Since this is a very useful feature that helps us understand the code much better, but the terminology is largely unknown and mysterious to the PHP community, I decided to write up and compare these two kinds of compound types.
Read more [medium.com]
My colleague Brent shares some interesting thoughts on which direction PHP could go forward.
Let's take, for example, the debate about strong types in PHP. A lot of people, including myself, would like a better type system. Strong types in PHP would definitely have an impact on my daily work. Not just strong types, I also want generics, better variance and variable types. Improvements to PHP's type system in general would have quite the impact on my programming life. So what's stopping us from reaching a solution?
https://www.stitcher.io/blog/what-php-can-be
Steven Vandevelde wrote a beautifully illustrated post on some cool functional concepts.
This is a more visual approach to the topic of purely-typed functional programming. What does it mean to have a “functional” programming language? What are types? What makes a functional-programming language “pure”? These are the questions we will answer here, with a focus on simplicity.
https://icidasset.com/writings/building-blocks/