In my book 'Gramática de uso del Español C1-C2', unit 71 is dedicated to
infinitivo, and there are two sentences using
¿No queréis ir? Haberlo pensado antes.
¿Que estás cansado? Haber descansado cuando pudiste antes.
To me, it seems it is used to express something which should have happened/been done in the past, but hasn't. What is this form and where can I read more about it? I tried to search for it but as I don't know the grammatical term, I couldn't find anything.