Added `p` and `f` parameters to the Cons and Snoc classes