Live data from Hacker News

Solving `Passport Application` with Haskell

jameshaydon.github.io

41–50 of 131 posts

Re: Solving `Passport Application` with Haskell

#42

Haskell itself is an amazing language once it "clicks". But all the tooling around Haskell is just really bad.

That was definitely true many years ago. Nowadays Haskell has some really good tooling.

It has a feature-rich LSP, code formatter, package manager, dead-code checker, configurable linter, thread debugger, memory debugger, vulnerabilities checker, and much more.

That’s just what is provided by external tooling. Then, it also has everything the compiler has to offer, which is bit more than what most languages do. For example, you can now compile to JavaScript or WASM.

Re: Solving `Passport Application` with Haskell

#43
post #21

Earlier quoted context omitted.

Don't know in this case, but some other countries ask for it to deduce your travel history (any current passport itself goes to them, with color copies of every page of old passports). Qatar wanted it because I shared name with somebody born 40 years before me.

Interesting. Just out of curiosity: did you naturalize as a Qatari (didn’t even know it was possible!), or was it a visa-related thing?

No, I can't ever. I was an immigrant worker there, and Qatar Immigration wanted all this before they give me work visa aka residence permit.

Re: Solving `Passport Application` with Haskell

#45
post #31
post #9

Haskell has an interesting syntax: it is intuitive after someone explains it to me, but not intuitive much before the explanation. I don't think it's because I'm used to Algol-based languages (C, Python, etc.). Every Haskell code I've seen is plagued with a plethora of operators which aim to make the code concise but it's not obvious what they do just by looking at them: https://academy.fpblock.com/haskell/tutorial/o…

At some point, I did a rough count, and the number of operators you encounter in "normal" Haskell code—avoiding lens or domain-specific libraries—was pretty close to the number of operators you'd encounter in, say, JavaScript. This was a while ago and I don't want to redo the exercise now, but, even if we're being generous to JavaScript, practical Haskell needs on the order of 2x as many operators as practical JavaSc…

I don't know if you just counted the JavaScript operators but if you count all the instances where some random symbol is used then it's really a ton. There is

    yield*
    function*
    a?.b?.c
    function f(x = 3) {
    x ??= 3
    ...
TypeScript adds even more:

    a!.b
    Type
    type A = B extends C ? D : E
    ...
    
and there are countless ECMA proposals and TypeScript feature request that want to pile on even more. People seem to have zero qualms about cryptic syntax. I think the difference is that this syntax is mostly very ad-hoc. If you know the language already, this just adds a liiiittle bit extra to solve some very specific problem. On the other hand, Haskell operators like , , >>= are extremely general. After years I still learn about new and unexpected ways that you can use them (e.g. what the hell is `fix id`). But paradoxically, because they can be used in so many seemingly unrelated contexts, you have no idea what to use them for at all initially.

Re: Solving `Passport Application` with Haskell

#46
post #32
post #31

Earlier quoted context omitted.

At some point, I did a rough count, and the number of operators you encounter in "normal" Haskell code—avoiding lens or domain-specific libraries—was pretty close to the number of operators you'd encounter in, say, JavaScript. This was a while ago and I don't want to redo the exercise now, but, even if we're being generous to JavaScript, practical Haskell needs on the order of 2x as many operators as practical JavaSc…

Combinator style, while good and well designed and all they only ended up inventing the next perl. #haskell on freenode in the 2000s was a really fun place. I could not for the life of me convince anyone else to use the language.

Oh, I owe a lot to freenode and #haskell and #math in particular. I remember one of them ran a lecture on category theory, live. It was also there I first heard about Martin-Löf type theory.

It was such a great time and place for a young person interested in learning about Haskell.

Re: Solving `Passport Application` with Haskell

#47
post #5

Not only can you complete a UK Passport Application completely online (save for mailing any required documentations to HMPO), you can apply for a brand new passport as a "new" citizen (by adoption, naturalisation, or descent), online, from outside the UK, with just a mobile device without downloading some special app, including taking the photos. Sure, you can play it on "hard mode " and do it with paper and pen for…

I went through the UK online passport renewal system last year, and it is the best website I have used in a very very long time. A real breath of fresh air. It worked perfectly on my old computer and 'ancient' browser. Everything very simple / accessible / clear, colours, text, buttons, fields, requirements. A simple step-by-step navigation and actually friendly.

It is a shame that more businesses dont care about their customers enough to invest in such a well designed website. Well done HMPO.

Re: Solving `Passport Application` with Haskell

#50
post #32
post #31

Earlier quoted context omitted.

At some point, I did a rough count, and the number of operators you encounter in "normal" Haskell code—avoiding lens or domain-specific libraries—was pretty close to the number of operators you'd encounter in, say, JavaScript. This was a while ago and I don't want to redo the exercise now, but, even if we're being generous to JavaScript, practical Haskell needs on the order of 2x as many operators as practical JavaSc…

Combinator style, while good and well designed and all they only ended up inventing the next perl. #haskell on freenode in the 2000s was a really fun place. I could not for the life of me convince anyone else to use the language.

The IRC channel still exists! It's on libera.chat now, though.
Post reply on HN