ema-0.8.0.0: src/GHC/TypeLits/Extra.hs
{-# LANGUAGE UndecidableInstances #-}
module GHC.TypeLits.Extra where
import GHC.TypeLits (TypeError)
class Impossible where
impossible :: a
{- | Like TypeError but suitable for use in type-classes to avoid `undefined`
cf. https://stackoverflow.com/a/72783230/55246
-}
type family TypeErr t where
TypeErr t = (TypeError t, Impossible)