Coalgebraic semantics of self-referential behaviours