Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
samhh
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
13 ms
·
91.
▲
by
samhh
6y ago
Sum types and newtypes behind smart constructors are better ways of accomplishing what you'd usually use union types for, I think?
92.
▲
by
samhh
6y ago
Ha, similar. Try encouraging your team to adopt the likes of fp-ts and newtype-ts piecemeal, it's certainly not as good as the likes of PureScript but it can at least enable you to utilise composition, Option et al, etc.
93.
▲
by
samhh
7y ago
Firstly, there's a nuance here that readability is heavily dependent upon the language. A language where recursion is the recommended approach to these sorts of problems will have far better syntax for doing so, such as in Haskell. Sec
94.
▲
by
samhh
7y ago
On the other hand, you can pretty much just learn Haskell to learn PureScript. All of the differences fit onto a single small docs page: https://github.com/purescript/documentation/blob/master/lang...
95.
▲
by
samhh
7y ago
I think it's unfair to categorise TypeScript as the easiest for interop if you've asserted that static type safety is important to you. If the typings aren't already available you'll need to create a type declaration for
96.
▲
by
samhh
7y ago
I have a side project called Bukubrow. It's a WebExtension that plugs into Buku, a CLI bookmark manager. I'm currently rewriting it in PureScript. It's hard to get pure functional programming's foot in the door at work -
97.
▲
by
samhh
7y ago
It's not very strongly typed at all, and it absolutely doesn't force you into the OOP paradigm. Why don't I consider it strongly typed?: Structurally subtyped as opposed to nominal typing, the pervasiveness of any, allowance
98.
▲
by
samhh
7y ago
If the strings are static you can define a type that's a union of string literals, create a tuple containing them all, and then a type guard function that simply checks the argument against the array. If the strings are dynamic then yo
99.
▲
by
samhh
7y ago
There is both null and undefined in JavaScript. Additionally, an empty array coerces to true because it's an object and objects are always truthy. Personally I'd prefer that not even null/undefined coerced to false, or could
100.
▲
by
samhh
7y ago
Mainland Europe. Come on, it was obvious what I meant.
101.
▲
by
samhh
7y ago
I agree, and I grew up in a country where they're very rare (UK) and still don't have one. I love holidaying in Europe. Bidets, bidets everywhere.
102.
▲
by
samhh
7y ago
I began working from home and essentially opted out of it. I feel more and more like Larry David in Curb every day.
103.
▲
by
samhh
7y ago
I dislike the apparent inability to label groups of changes with `git stash`, so instead before leaving a branch with in-progress changes I'll commit them all as "WIP". Then, when I return to the branch, I'll check if th
104.
▲
by
samhh
7y ago
This new API is additive and not a breaking change, much like React's addition of hooks.
105.
▲
by
samhh
7y ago
> with no real gain Did you read the linked motivations?
106.
▲
by
samhh
7y ago
"[TypeScript] seems to encourage complex types instead of simpler contracts." Having refactored a few different codebases across two different businesses and my own personal projects, I must say subjectively that this is the oppos
107.
▲
by
samhh
7y ago
You should never have unexpected exceptions if you embrace static typing and one of the many libraries that take this idea and do it better, for example `purify-ts`. It also comes with methods included for statements that might throw such a
108.
▲
by
samhh
7y ago
Yes, there are both manual whitelists and blacklists. There are also easily accessible options for disabling the adblocker permanently or temporarily, in the latter case on a timer of your choosing e.g. for 5 minutes.
109.
▲
by
samhh
7y ago
I was put in touch with a business by a recruiter. I stated my salary expectations, received the typical "that's a little high..." from the recruiter; as per usual, the offers I received justified my stance. They offered me 1
110.
▲
by
samhh
8y ago
I chose to rewrite my portfolio site in Gatsby and deploy it to Netlify with my custom domain pointed to it. It's a big improvement in ease of use versus how I used to do it with a Node server hosted on DigitalOcean, as good as I found