Open krame505 opened 3 months ago
Looks good! I'm a tad concerned that TApp
can be misread as type application (like BSC's TAp
), but I'm not sure that I have a better suggestion.
Looks good! I'm a tad concerned that
TApp
can be misread as type application (like BSC'sTAp
), but I'm not sure that I have a better suggestion.
Yeah TApp looks to me like application of some kind. Why not just TAppend
? Unambiguous, and not too long.
I went with TApp
mostly for consistency, the other type-level functions are all abbreviated to 3 letters: TAdd
, TSub
, TMul
, TDiv
, TLog
, TExp
, TMax
, TMin
.
TAppend
is a little more verbose. No strong objection, though.
If we can decide on the name, then this can be merged. As far as consistency, note that the other type constructors are for numeric types. Another option for this one could be, say, TStrApp
(which doesn't save any characters over TAppend
). I have no strong objection to TAppend
, but would feel better getting more opinions -- maybe we can discuss offline next week?
Can you confirm my understanding: This feature came up because it can be used with the other PR for splitting structs, but that PR doesn't include these commits? I get that this feature is generally useful, but I just wanted to understand any relationship/dependency between the PRs.
I was originally planning to do the computation of names for split fields completely at the type level. I forget the exact blocking problem that I ran into with this approach, but I ultimately ended up doing the field name computation in the evaluator with ordinary type class methods instead. So this feature is not currently used by anything, but it seems like a good thing to have, for completeness.
Note that to make type-level string construction useful, we would probably also want to add a type-level primitive NumToStr :: # -> $
.
Meeting consensus: we'll call the primitives TStrCat
and TNumToStr
. We should also add a StrAlias
type class, corresponding to Alias
and NumAlias
. We could have equivalent type classes StrCat
and NumToStr
, I'm not sure how useful these are however, with StrAlias
.
I'll add these when I get around to it, hopefully before our next sync meeting.
This adds a
TApp
type pseudo-constructor likeTAdd
and friends, for appending type-level strings.