Werewoof wrote:
Okay, this sounds right! I do see some patterns now. One case, as I was suspecting, is that "raibh" seems to be used in clauses that would equate to English's "that" clauses.
Tá mé sásta go bhfuil tú ann. Bhí mé sásta go raibh tú ann - I am happy (
that) you are here. I was happy (
that) you were here.[/i]
I'm sure there's more, but it's much clearer now.

Thanks for this!
To be more explicit, because it comes up again in several of the other irregular verbs (
déan, téigh in the past,
faigh in the future; more in the dialects)
raibh is what's known as the 'dependent form' of the verb. It's used when the verb 'depends' on something else. So here, it is
ní or
an or
go and the proper mutations apply (lenite, eclipse, eclipse respectively;
raibh doesn't change because r neither lenites nor eclipses). The exact same thing happens with
tá and its dependent forms. There, the dependent verb form is
fuil, which can still be seen in
an bhfuil, with the eclipse caused by
an. It's a bit harder to see in
níl, until you look at the etymology: it comes from
ní fhuil, but because fh is silent, it was pronounced as
níl. Some older texts will have it written as
ní'l to show it still.
So if you see dependent forms of the verb mentioned, it's those that appear after
an and
ní. For most verbs, it's the same, but some of the irregular ones do have different forms still. I hope I didn't confuse you!