⟨/⟩ AT Protocol Record Source
at://did:plc:pi6woz4d47bkuws673w2il2r/site.standard.document/3mnkvmok4hms2
← Back to post
{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreigxdxbzoytyt4fp5zylutnhhggkmavw56e6zspe36ep5wi6qg2eyq",
    "uri": "at://did:plc:pi6woz4d47bkuws673w2il2r/app.bsky.feed.post/3mnkvmok4gis2"
  },
  "path": "/t/is-there-a-way-to-get-a-oschar-literal-more-conveniently-than-osp-head/14206#post_6",
  "publishedAt": "2026-06-05T19:38:12.000Z",
  "site": "https://discourse.haskell.org",
  "tags": [
    "Add `OsChar` conversions by tfausak · Pull Request #158 · tfausak/witch · GitHub",
    "Allow lifting `OsChar` · Issue #44 · haskell/os-string · GitHub",
    "@OsChar"
  ],
  "textContent": "I added `OsChar` conversions to Witch: Add `OsChar` conversions by tfausak · Pull Request #158 · tfausak/witch · GitHub\n\nNormally you could use `liftedFrom` to check values at compile time, like `$$(liftedInto @OsChar ‘x’)`. But unfortunately that won’t work because of a missing `Lift` instance: Allow lifting `OsChar` · Issue #44 · haskell/os-string · GitHub\n\nAlso note that going through `OsString` probably won’t do what you want for non-ASCII characters. For example:\n\n\n    ghci> uncons [osstr|λ|]\n    Just (206,\"\\187\")\n\n\nYou would get `'\\206’` (U+00CE, LATIN CAPITAL LETTER I WITH CIRCUMFLEX) rather than `'\\955’` (U+03BB, GREEK SMALL LETTER LAMDA).",
  "title": "Is there a way to get a OsChar literal more conveniently than osp + head"
}