Live data from Hacker News

Solving `Passport Application` with Haskell

jameshaydon.github.io

91–100 of 131 posts

Re: Solving `Passport Application` with Haskell

#91

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

> all the tooling around Haskell is just really bad. No it isn’t. This is a stupid meme that people just dogmatically perpetuate.

No, this was from first hand experience. I guess Visual Studio and PyCharm have spoiled me.

Re: Solving `Passport Application` with Haskell

#92
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…

> practical Haskell needs on the order of 2x as many operators as practical JavaScript, not 10x. Yeah but the JavaScript operators are almost all universally understood. There are some exceptions and mistakes, like `===` which shouldn't exist, and `.?` which is new but fairly standard. But most of the operators are just standard maths stuff, normal array/field accesses, etc. Haskell has normal operators plus a bunch…

I still don't understand equality in JavaScript. ;-)

Re: Solving `Passport Application` with Haskell

#93

Earlier quoted context omitted.

> all the tooling around Haskell is just really bad. No it isn’t. This is a stupid meme that people just dogmatically perpetuate.

No, this was from first hand experience. I guess Visual Studio and PyCharm have spoiled me.

I wasn’t expecting your gripe to be about text editors. What exactly do you think is missing in Haskell? You can write Haskell in VSCode.

Re: Solving `Passport Application` with Haskell

#94
post #80

Earlier quoted context omitted.

I think that’s true as far as it goes, but there are further reasons why Haskell is more difficult. Here is one: In Haskell, the lack of parentheses for function calls plus currying means that to read a function call, you need to already know how many arguments the function takes, which I feel adds a new level of difficulty over languages where you can often guess what a function does based on its name, without looki…

> the lack of parentheses for function calls plus currying means that to read a function call, you need to already know how many arguments the function takes While I agree with the general sentiment of what you are saying, note that the syntax has nothing to do with it, it is purely about Haskell using currying excessively. The syntactic translation between Haskell and JS is straight-forward and 1-1: f x y z -> f(x)(…

Yes, you could write the same thing, but defaults and language conventions matter. Writing curried functions in JavaScript is awkward enough that nobody does it by default. If you did, people would ask why in a review.

Re: Solving `Passport Application` with Haskell

#95

Earlier quoted context omitted.

Renewed recently which was my first time using the online system. The entire process was exceptionally fast. I got the passport back in less than 2 weeks from California. In comparison my Canadian passport renewal (damaged after 3 years) from California took 4 months. Was entirely paper based and had ridiculous requirements such as requiring a reference and a photograph stamped by photographer. I know there's a digit…

I need to renew my Belgian passport soon, and I live in the United States. Even though the consulate has my biometric data, I need to visit them in person. My only saving grace is that they sometimes visit my city., and I can register there. But that registration is only valid for 1 year, and they don't visit every year... And that is still 2h+ one way of travel for me, for something they already have.

> Even though the consulate has my biometric data, I need to visit them in person.

don't they need to re-record them after X years? I thought that was the whole point of renewing an identity document/passport.

Re: Solving `Passport Application` with Haskell

#96

I've worked on a variety of large UK government systems for the past ten years. This blog encapsulates the problem of writing government services/software, which often results in strange outcomes. Writing software for government is essentially the codification of centuries worth of Acts of Parliament. Now imagine building the HMPO passport system, and then some underlying Law/Act is changed or repealed etc. Now someo…

Is there an opportunity for reusable OSS rule systems? It seems that every government at every level could use an expressive system for defining and versioning them.

I suspect part of the gap here is, as you note, everything technical is outsourced and so there is not enough institutional capacity to envision and execute what would be a quite revolutionary re-architecture.

I find it extremely frustrating that the government is able to spend tens of millions on contractors for an IT project, but can’t pay market rate for in-house engineers, even if those would be cheaper in the long run.

Re: Solving `Passport Application` with Haskell

#97

> What are the base cases? A base case is an ancestor whose Britishness does not depend on a parent, e.g. someone who was naturalised, or born in the UK before 1983 (which makes one unconditionally british regardless of parents). That's right, further into the future we get from 1983, the taller these call-stacks can get. This is insane to me, coming from a country that simply has a central database of all citizens a…

> citizenship check is probably something like a single SELECT on an SQL table

I am willing to bet, with extremely unfavorable odds to me, that is not true

Re: Solving `Passport Application` with Haskell

#98
post #65

Earlier quoted context omitted.

Yes and in the British system names can be fluid, changed at will with no declarations being made. That’s how my mother was able to register my birth with the surname of her mother’s third (!) marriage. Birth certificates are also immutable in certain ways but not entirely everything on it is immutable. Not to mention the passport office has forgotten previous decisions for my own passport where this sort of surname…

Similarly for us, siblings each required different treatment. Even when part of the same application. All born in the same UK hospital to the same parents and having the same home address. Fun. It was interesting to speculate what exactly the one child whose passport came months later had done that warranted the Examiner's extra scrutiny. Something to do with reincarnation I expect.

That's absurd! I hope it's all sorted out now. Personally hoping my kids won't have trouble when they turn 18 and have to interview.

Re: Solving `Passport Application` with Haskell

#99

> What are the base cases? A base case is an ancestor whose Britishness does not depend on a parent, e.g. someone who was naturalised, or born in the UK before 1983 (which makes one unconditionally british regardless of parents). That's right, further into the future we get from 1983, the taller these call-stacks can get. This is insane to me, coming from a country that simply has a central database of all citizens a…

Many countries simply have no way of knowing who their citizens are.

People born abroad are often citizens.

The British have had an insane number of changes in territory that affect citizenship.

Some of their current citizens have citizenship because they were born in Bombay (Mumbai). Others because they were born in Hong Kong.

Maintaining a reliable list of citizens requires regular registration, and loosing citizenship if you don’t register.

Re: Solving `Passport Application` with Haskell

#100
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…

You make it seem much simpler than it is in reality. I accept the process for renewals has been streamlined with considerable success but, as someone who recently helped a friend apply for his first passport a couple of years ago, I can attest the process is drawn out and tedious. An in-person interview is required, as is a signature from a 'responsible person' that many people do not have access to (Doctors are not accepted, for instance).
Post reply on HN