Deriving fails for empty data types
When trying to compile a program like
data A
the compiler fails with the following error message.
pakcs-frontend: Prelude.head: empty list
This is most likely due to the current way of generating the equations for binary operations (in this case the generation of the equations of the Data
class; for all other classes the DeriveCheck should throw an error that classes can't be derived for abstract data types). The obvious solution would be to add an additional check in the DeriveTransformation (see hasDataInstance
) to rule out abstract data types.
Edited by Finn Teegen