instance FromCompact and ToCompact