g is equivalent to the dfn {⌈/(⍺⊢⍵)~(⍺|⍵)} but of course (⍺⊢⍵) is just ⍵, so you have {⌈/⍵~⍺|⍵} but remember that ⍵ here is f ⍵, so really you have your original code.
@Sherlock9 So trains are sequences of functions without any data on the far right. It can either be because the statement ends, or because there is a right-parenthesis.