You can have inheritance via polymorphic variants: see Garrigue's `Code reuse through polymorphic variants`.