[GHC] #12162: Concatenation of type level symbols missing

GHC ghc-devs at haskell.org
Mon Oct 24 08:35:04 UTC 2016


#12162: Concatenation of type level symbols missing
-------------------------------------+-------------------------------------
        Reporter:  augustss          |                Owner:  phadej
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D2632
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by phadej):

 * good point about `append` vs. `concat` , append will be definitely
 better

 * As said in the Phab, I mostly copied things from existing magic type
 families. E.g. there are comments like `(a + 5 ~ 8) => (a ~ 3)`, which I
 tried to reproduce for `(<>)`, but I didn't managed to find any tests
 exercising those code paths (I didn't spent too much time looking though).
 1f77a5341cbd6649a6bc2af868002728cd79b9d7 patch added most of the
 `TcTypeNats.hs`, I guess it make sense to add refined parts of commit
 message to the wiki. Will do.

 * I personally think `(<>)` is more appropriate than `(++)`. I had an idea
 to make `(<>)` polykinded `:: forall k. k -> k -> k` with the `Symbol`
 instantiation as a magic one. But it seems to be easier to leave the
 abstracting part to the userland, and have magical monomorphic type. So it
 might make sense to not use any operator name at all, but a name like
 `AppendSymbol`, and define `<>` to work on symbols and lists in `base` or
 some other type-level trickery library.

 * FWIW, I think there aren't any other places with functions over `Symbol`
 than the ones in  `GHC.TypeLits`.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12162#comment:10>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list