Skip to content

Commit a7c73aa

Browse files
committed
Remove attempted re-export of Prim.Row.Cons
It is currently possible to attempt to re-export both a class and a type of the same name from different modules. It is not currently possible to define both a class and a type of the same name in the same module. What actually happens is that the order of exports defines which things are really exported. In the case of `Type.Row`, the re-export of `Prim.Row` comes first, and the re-export of `Prim.RowList` comes after it. This ordering means that the `Prim.Row.Cons` class is not re-exported, but the `Prim.RowList.Cons` type is re-exported. From the perspective of anyone importing `Type.Row`, we've always only re-exported `Prim.RowList.Cons`. We make that explicit by removing `Prim.Row.Cons` from the export list.
1 parent 1e4a623 commit a7c73aa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Type/Row.purs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ module Type.Row
1212
, type (+)
1313
) where
1414

15-
import Prim.Row (class Lacks, class Nub, class Cons, class Union)
15+
import Prim.Row (class Lacks, class Nub, class Union)
16+
import Prim.Row as Row
1617
import Prim.RowList (kind RowList, Cons, Nil, class RowToList)
1718
import Type.Equality (class TypeEquals)
1819
import Type.Data.Symbol as Symbol
@@ -33,7 +34,7 @@ instance listToRowNil
3334

3435
instance listToCons
3536
:: ( ListToRow tail tailRow
36-
, Cons label ty tailRow row )
37+
, Row.Cons label ty tailRow row )
3738
=> ListToRow (Cons label ty tail) row
3839

3940
-- | Remove all occurences of a given label from a RowList

0 commit comments

Comments
 (0)