The recommended way, currently, is just to use a separate function:
{-# LANGUAGE RequiredTypeArguments, AllowAmbiguousTypes #-}
import Data.Kind (Type)
class Storable (a :: Type) where
_sizeOf :: Int
instance Storable Int where
_sizeOf = 8
sizeOf :: forall a -> Storable a => Int
sizeOf a = _sizeOf @a
Source: https://github.com/ghc-proposals/ghc-proposals/pull/267#issuecomment-528449235