[GHC] #12162: Concatenation of type level symbols missing
GHC
ghc-devs at haskell.org
Mon Oct 24 13:01:52 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 RyanGlScott):
I'm indifferent about what to name `(<>)`, but the fact that someone has
objected to it means it might be worth starting a thread on the
[https://mail.haskell.org/pipermail/libraries/ libraries mailing list] to
figure out the community's opinion. I've heard convincing arguments for
both `(<>)` and `(++)`. Or `(+++)`, which is what the
[https://github.com/konn/ghc-typelits-
symbols/blob/cd812f4cfc2e6816a18283a6a0e9bb2d9ea2905e/src/GHC/TypeLits/Symbols/Internal.hs#L6-L8
ghc-typelits-symbols] GHC plugin library has taken to calling this
operation. Or `AppendSymbol`, if we really want to explore all options.
If you wish to add tests for this feature, there is a portion of the GHC
test suite located in `base`
[http://git.haskell.org/ghc.git/tree/HEAD:/libraries/base/tests here].
And you're absolutely correct in observing that the `Symbol` API is quite
feature-poor at the moment. OtToMH, there are only three useful operations
over `Symbol`s in `base`:
* You can check whether two symbols are equal (either through type-level
equality or through [http://hackage.haskell.org/package/base-4.9.0.0/docs
/GHC-TypeLits.html#v:sameSymbol sameSymbol]).
* You can compare two symbols lexicographically with
[http://hackage.haskell.org/package/base-4.9.0.0/docs/GHC-
TypeLits.html#t:CmpSymbol CmpSymbol].
* You can convert a `KnownSymbol` to a `String` value with
[http://hackage.haskell.org/package/base-4.9.0.0/docs/GHC-
TypeLits.html#v:symbolVal symbolVal].
And that's about it. While it'd be nice to have promoted lists of `Char`s
and just promote all operations over lists, that's much more work, and
`Symbol`'s all we've got for now, so we might as well work with it.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12162#comment:11>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list