typeclass -> record with functions