Usingparadigm/codata it is possible specify protocols in a rather natural way, adding a state-token to every type returned from the class representing the session.