
#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 simonpj): Generally the patch looks good to me, thank you. But can we first agree about goals and nomenclature. * Minor: you use the term "concat" in the implementation, but the list `concat` function has type `[[a]] -> [a]` not `[a] -> [a] -> [a]`. We generally use "append" for the latter; e.g. `appendFS`. * In order to do this you have figured out how to add a new type-level operator to GHC. Is that written up on the wiki anywhere? If not it'd be great if you could do so? There are a number of separate things you have to do. [wiki:TypeNats] would be a good place to start, despite its Nat- sounding title. * More significant. You are introducing a type-level operator `(<>) :: Symbol -> Symbol -> Symbol`. Wouldn't `(++)` be more appropriate? It's type is very like `(++)`. The other use of `(<>)` that I know of is in the pretty printing library, where it has type `Doc -> Doc -> Doc` so there is precedent there. I think it partly depends on whether we are regarding `Symbol` as an opaque type; in which case we might want to keep `(++)` for appending type-level lists (or does it exist already?). But #11342 is (I think) arguing for a less opaque representation. * Incidentally I realise that I don't know how to find the Haddock docs for the functions available over `Symbol`.... I'm copying in the core libraries committee, since this is really their territory. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12162#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler