module Generic.Data.Rep.Error where
import GHC.TypeLits ( ErrorMessage(Text) )
wrapE :: String -> String -> String
wrapE :: String -> String -> String
wrapE String
msgGot String
msgWhyBad =
String
"Generic.Data.Rep.Error:\n"
forall a. Semigroup a => a -> a -> a
<> String
"Attempted to use an invalid generic instance: \n"
forall a. Semigroup a => a -> a -> a
<> String
"got: "forall a. Semigroup a => a -> a -> a
<>String
msgGotforall a. Semigroup a => a -> a -> a
<>String
"\n"
forall a. Semigroup a => a -> a -> a
<> String
"but: "forall a. Semigroup a => a -> a -> a
<>String
msgWhyBadforall a. Semigroup a => a -> a -> a
<>String
"\n"
forall a. Semigroup a => a -> a -> a
<> String
"You can likely catch such errors during compilation.\n"
forall a. Semigroup a => a -> a -> a
<> String
"See the generic-data-functions package on Hackage."
type ENoEmpty = 'Text "Requested generic instance disallows empty data type"
eNoEmpty :: String
eNoEmpty :: String
eNoEmpty = String -> String -> String
wrapE String
"empty data type" String
"disallowed"
type EUnexpectedSum =
'Text "Cannot derive non-sum generic instance for sum data type"
eNoSum :: String
eNoSum :: String
eNoSum = String -> String -> String
wrapE String
"sum data type" String
"cannot use non-sum generics"
type EUnexpectedNonSum =
'Text "Refusing to derive sum generic instance for non-sum data type"
eNeedSum :: String
eNeedSum :: String
eNeedSum = String -> String -> String
wrapE String
"non-sum data type" String
"cannot use sum-only generics"