with-only-class := λ(: tt Type). (: ( (let rt TAny) (match tt ( () ( (TAnd( lt1 rt1 )) ( (let lc (with-only-class lt1)) (if (non-zero lc) (set rt lc) ()) (let rc (with-only-class rt1)) (if (non-zero rc) (set rt rc) ()) )) ( (TGround( tag _ )) ( (if (is-class tag) ( (if (not(is-fragment tag)) ( (set rt tt) ) ()) ) ()) )) ( _ () ) )) rt ) Type);