Ticket #5877 (closed feature request: fixed)
Make StringPrimL take [Word8]
| Reported by: | reinerp | Owned by: | igloo |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.6.1 |
| Component: | Template Haskell | Version: | 7.4.1 |
| Keywords: | Cc: | pho@… | |
| Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
| Type of failure: | None/Unknown | Difficulty: | Unknown |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: | 5218 |
Description
This is a follow-up of PHO's comment on #5218:
What concerns me is that there seems no means of creating primitive byte-array literals with TH. That is, the Lit type currently only has a constructor StringPrimL String which represents an Addr# literal encoded in UTF-8, thus unsafePackAddressLen 3 "\NUL\NUL\NUL"# works but unsafePackAddressLen 3 $(litE $ StringPrimL "\NUL\NUL\NUL") doesn't. So we probably need to make a change to the type of StringPrimL:
data Lit = CharL Char
| StringL String
| ...
| StringPrimL [Word8] -- Raw, non-encoded "..."# literal.
I attach patches which implement this change.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

