Elixir 1.11 brought to us (amongst other very exciting features) is_struct/2 guard. It, by the way, might have been used as an example of more straightforward not backward compatible alternative in my yesterday’s writing, but I avoided it for a reason that will become clear below.