Skip to content(if available)orjump to list(if available)

Solving `Passport Application` with Haskell

behnamoh

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/operators/

tikhonj

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.

dmead

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.

theLiminator

> it is intuitive after someone explains it to me, but not intuitive much before the explanation

Isn't that pretty close to what something being intuitive means? Ie. something being intuitive means that it's easily understood or learned without requiring prior knowledge or instruction.

the_af

Most of the operators in that link are bog standard, and among the least interesting things to say about Haskell.

If I didn't know programming and picked at random some Java program, I wouldn't understand much either. If I didn't take a single math course and I tried to read a math formula, I wouldn't understand the operators or anything either.

The standard should be: how much can you understand once you learn the basics and do a couple of tutorials?

munchler

I love this. It starts as a parody, then slowly morphs into a serious and elegant solution to the "game". By the end, I almost wish I could play it myself. Bravo.

new299

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 translation.

Certificate of acceptance of notification of birth, original and translation.

Original Marriage certificate and translation.

Colour photocopy of every page of my childs Japanese passport.

Copy photocopy of the passport of an American or British citizen who confirms that child is mine.

The process is pretty unclear, and in general you seem to have to just keep submitting documents until they are satisfied.

d1sxeyes

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).

jameshh

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

crooked-v

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

lmm

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).

Cyph0n

> Colour photocopy of every page of my childs Japanese passport.

But why?

davchana

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.

Cyph0n

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?

mcsniff

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 the lulz, but my experience was extremely efficient, fast, and straight-forward.

digianarchist

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 digital pilot that's ongoing. That should be rolled out ASAP.

kalleboo

Just being able to do it via mail sounds like luxury, to renew a Swedish passport you need to visit an embassy in person. And then in 2 weeks go back in person to pick it up. Really fun when the embassy is on the other side of the country and it means expensive plane trips. This was even more of a problem during COVID when borders were closed, since Sweden doesn't have embassies in every single country.

And they expire in 5 years, not 10 like many other countries.

OptionOfT

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.

null

[deleted]

tanh

I just went through hell this with one of my daughters. She was born in Japan and I had a hard time getting my mother’s surname matching what was on my birth certificate.

Long story short, I demonstrated I was born in England and that I have citizenship (a passport) so no matter the possibility, it must be something that can be passed on. That doesn’t match the guidelines of documents required but it’s much less of a pain I reckon.

phillipseamore

Great read, best laugh of the day!

franciscop

I have noticed in Japan the crazy bureaucratization of document applications in the 7-8 years I've been living here. I've had 2 Japanese documents expire, "MyNumber" and "Driving License" in these years, and when trying to re-obtain them the process has become MUCH more complex. I'm bad at remembering all these processes in detail, but these are from memory:

- For the mynumber, first time, it was a simple application, and maybe a trip or two to the City Hall. This was at a moment where Japan was trying everyone to have/use the mynumber system so that might've made it easier on purpose.

- The second time I needed to book an appointment to request the application forms, which were (snail)mailed to me so then I could apply for the card. Yes, that sentence is as bad as it reads.

Now the crazier one is the driving license (conversion process):

- The first time I needed to get a translation, I went to JAL, showed my documents and paid, then received the translation. Took that and 2-3 documents, went to the driving license center, and gave the documents and passports and IDs. Waited few hours and had it done. Oh, I also got the Motorbike license for free.

- The second time I am applying now: need to get the translation, first register online for the translation, for which you need to create an account and a 8-step process. Hard, but still doable [1]. Then you need to book a meeting for the driving license center. But it's very hard to do so, in fact I couldn't find the link at all. I went in person and they showed me a QR code for the booking, I suspect this is hard to find on purpose. Every place is full and cannot be booked, except for 1 of them, 2 months later. Okay, I try to apply. First basic questions, sure, then asks for travel history on my passport that I need to input manually. Note that dates in one part of the form are on the shape of `YYYYMMDD` and in other they are 3 fields of "YYYY", "MM", "DD" (3 different inputs), having to write a dozen of them is maddening. Oh wait, but if I want the motorbike one, which was automatic before, I now need a document from the Spanish embassy as well, another side quest. I'm hoping they can at least provide it in Japanese. I guess I'm halfway that process now, got a meeting booked 2 months later.

[1] https://english.jaf.or.jp/driving-in-japan/drive-in-japan/ab...

ggm-at-algebras

It's not "quite expensive" if you compare it to the Australian passport which is 2x as expensive and so notoriously badly bound, holders joke Australian Border Protection forces test for forgeries by checking if the blue cover curls: if not, it's a fake.

yen223

The Australian passport curl was so disappointing. I have a decade-old passport from my third-world country of origin, and that was in far better shape than my new Australian passport that was freshly delivered.

null

[deleted]

UltraSane

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

chii

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).

agnishom

The sarcasm here is off the charts.

My First Reaction: Given that the game can be read as a deconstruction of the concept of Nation States and Citizenship, why would the UK government run such a thing?

After a few minutes: Oh wait a minute...