TIL that Prolog has a notion of a functor! https://www.cse.unsw.edu.au/~billw/dictionaries/prolog/functor.html In true PL style it has a different meaning from the Haskell, OCaml and C++ terminology.