Live data from Hacker News

Solving `Passport Application` with Haskell

jameshaydon.github.io

31–40 of 131 posts

Re: Solving `Passport Application` with Haskell

#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 JavaScript, not 10x.

Haskell has some up-front incidental complexity, but it's a difference of degree not kind from popular starting languages. It's easy to underestimate how much you had to learn about Algol-style languages that you've just internalized so well that you don't even realize. I've taught some complete programming beginners (high or middle schoolers) Java and Python and, especially one-on-one, I've seen how they get confused by things I did not even remember required explanation!

For example, in Python, people put : in the wrong place and don't understand how = works. "Basic" syntax like : and = are far more complex than we realize, we've just learned the basics so well that it's second nature. It's similar to how native English speakers don't even realize we have rules for adjective order ("big red ball" vs "red big ball"), while language learners run into it like a brick wall.

Re: Solving `Passport Application` with Haskell

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

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.

Re: Solving `Passport Application` with Haskell

#33
post #6

Earlier quoted context omitted.

> I think the author may also be born outside the UK which may require other/more documents In fact `applicant's father` (me) was born in the UK in this case, but `applicant's father's father` was not, the cause of the extra complications.

I have to wonder how they would handle cases where a person doesn't have a legal father at all.

If you don't have a legal father then you can't claim British citizenship through your father. That's all pretty straightforward. (Although there's a fun case where you can claim citizenship by double descent because your ancestor wasn't able to claim citizenship because of sexist historical laws).

Re: Solving `Passport Application` with Haskell

#34
post #4

For the benefit of anyone else doing this in Japan, these are the documents I had to submit. It will be different depending on circumstance, in particular I think the author may also be born outside the UK which may require other/more documents. Anyway I had to submit: Certified copy of my birth certificate, order from the UK general register office. Original (not photocopy) of Japanese family register and translatio…

That’s interesting, no requirement for parental birth certificates?

I was asked to provide (I am British, wife is Hungarian, living in Hungary) both parents’ birth certificates and all four grandparents’ birth certificates.

My wife is not in touch with her father, so we had to submit a cover letter explaining the situation, which was accepted (although I don’t really see why it was relevant anyway, my son’s Britishness is derived from my Britishness, her nationality and the nationality of her parents is essentially irrelevant).

We also didn’t have to copy the passport of anyone else, but we did have to have a family friend do the confirmation online (family friend is a lawyer in the UK, so was on the list of approved jobs for this).

Re: Solving `Passport Application` with Haskell

#35

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

i think the tooling improves with popularity, so it's a bit of a chicken/egg problem.

But with the recent LSP decoupling of the IDE to the compiler, it is quite possible to make good tooling that is independent of any particular editor. It's just that the language's popularity is what induces contributors (as most are realistically after "fame" and "portfilio" when doing contributions).

Re: Solving `Passport Application` with Haskell

#36

>written in arcane language, in various texts called "acts of parliament". >British passports are issued to those who have a claim to British nationality under the British Nationality Act 1981. Has the British language really evolved that much in the last 50 years?

Arcane does not mean the same as archaic.

Re: Solving `Passport Application` with Haskell

#37
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.

Combinators (in the Haskell sense) have nothing to do with whether you write your functions with letters or with comic book swearing.

Re: Solving `Passport Application` with Haskell

#38
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 someone has to find and change everything that the Law/Act affected in all systems.

Now consider that the government frequently outsources this work to expensive consultancies who are motivated to elongate contracts and extract maximum value from the client... And ideally become entrenched.

All whilst building systems of varying quality and inflexibility so that the next time that a Law/Act is changed then this whole process repeats.

There is no central decision making authority to wrangle this problem (there used to be Spend Controls), which is why Government services delivery is so expensive.

Re: Solving `Passport Application` with Haskell

#39
post #4

For the benefit of anyone else doing this in Japan, these are the documents I had to submit. It will be different depending on circumstance, in particular I think the author may also be born outside the UK which may require other/more documents. Anyway I had to submit: Certified copy of my birth certificate, order from the UK general register office. Original (not photocopy) of Japanese family register and translatio…

That’s interesting, no requirement for parental birth certificates? I was asked to provide (I am British, wife is Hungarian, living in Hungary) both parents’ birth certificates and all four grandparents’ birth certificates. My wife is not in touch with her father, so we had to submit a cover letter explaining the situation, which was accepted (although I don’t really see why it was relevant anyway, my son’s Britishne…

> although I don’t really see why it was relevant anyway, my son’s Britishness is derived from my Britishness, her nationality and the nationality of her parents is essentially irrelevant

This is essentially happened to me, the "75% of the initial doc requests turned out to be irrelevant" was referring to this sort of thing.

Re: Solving `Passport Application` with Haskell

#40
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.

err, no

the perl6 guys ended up inventing the new perl (now renamed raku)

https://rakujourney.wordpress.com/2024/10/12/raku-burritos/

the first perl6 parser (pugs) was written in Haskell btw

Post reply on HN