You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While investigating #358, I uncovered an oddity in the way promoteType is implemented. In particular, there's some dubious special-casing for String here:
This case is very unlikely to ever be reached in practice. That's because singletons is quite eager to expand type synonyms when possible, which means that you'll usually pass types to promoteType which mention [Char] instead of String.
Even if this case were reached, what is it doing here? We certainly don't have any special case that turns, say, Natural into Nat, so it feels odd to turn String into Symbol. (And for that matter, shouldn't it be that we turn Text into Symbol instead?)
I can think of two possible options here:
Remove this special case entirely.
Fix the special case to turn Text into Symbol, and add a corresponding case for turning Natural into Nat.
The text was updated successfully, but these errors were encountered:
That code likely predates Natural and quite possibly singletons's attempts at synonym expansion. I'm not wedded to it -- remove the line if it's getting in your way.
While investigating #358, I uncovered an oddity in the way
promoteType
is implemented. In particular, there's some dubious special-casing forString
here:singletons/src/Data/Singletons/Promote/Type.hs
Lines 43 to 45 in c776637
Here is what is dubious about it:
singletons
is quite eager to expand type synonyms when possible, which means that you'll usually pass types topromoteType
which mention[Char]
instead ofString
.Natural
intoNat
, so it feels odd to turnString
intoSymbol
. (And for that matter, shouldn't it be that we turnText
intoSymbol
instead?)I can think of two possible options here:
Text
intoSymbol
, and add a corresponding case for turningNatural
intoNat
.The text was updated successfully, but these errors were encountered: