TLDR: adding a unit parameter to a function makes the previously-rejected code compile.
Sorry for no minimal example, but as we do some complicated typelevel things in our project, producing such an example would be difficult. Let’s try.
I have a data type
newtype CellRenderer :: Type -> Type -> Symbol -> Type -> Row Type -> Type newtype CellRenderer w i lab a r = CellRenderer ...
lab is a shadow type (some record label). I have defined two smart constructors:
mkNoCellRenderer :: forall w i lab a r. CellRenderer w i lab a r mkNoCellRenderer = CellRenderer ... mkNoCellRenderer' :: forall w i lab a r. Unit -> CellRenderer w i lab a r mkNoCellRenderer' _ = <same code as above>
In some contexts, using the first function gives errors like
Could not match type lab7 with type "entity". However, using the second function (the same code but with additional ignored unit parameter) makes it compile.
Are you aware in which contexts those two functions can be different? Again, sorry for not giving more specific example, but extracting something easy to follow would take some time.