type-level-show 0.2.0 → 0.2.1
raw patch · 4 files changed
+14/−2 lines, 4 filesdep ~basedep ~singleraeh
Dependency ranges changed: base, singleraeh
Files
- CHANGELOG.md +4/−0
- src/TypeLevelShow/Doc.hs +5/−0
- src/TypeLevelShow/Utils.hs +3/−0
- type-level-show.cabal +2/−2
CHANGELOG.md view
@@ -1,3 +1,7 @@+## 0.2.1 (2024-05-25)+* add `Demotable Doc` instance+* single `ShowChar`+ ## 0.2.0 (2024-05-21) * add singleton versions of various types, functions
src/TypeLevelShow/Doc.hs view
@@ -21,6 +21,7 @@ import GHC.TypeLits qualified as TE -- TE = TypeError import GHC.TypeLits hiding ( ErrorMessage(..) )+import Singleraeh.Demote -- | Simple pretty document ADT. --@@ -94,6 +95,10 @@ SText s -> Text $ fromSSymbol s l :$<>: r -> demoteDoc l :<>: demoteDoc r l :$$$: r -> demoteDoc l :$$: demoteDoc r++instance Demotable SDoc where+ type Demote SDoc = Doc String+ demote = demoteDoc -- | Reify a promoted 'Doc' to the corresponding term-level one. reifyDoc :: forall (doc :: PDoc). SingDoc doc => Doc String
src/TypeLevelShow/Utils.hs view
@@ -3,6 +3,7 @@ module TypeLevelShow.Utils where import GHC.TypeLits+import Singleraeh.Symbol ( sConsSymbol ) -- | Surround the given 'Symbol' with parentheses when the 'Bool' parameter is -- 'True'.@@ -24,6 +25,8 @@ OrderingGT GT = True type ShowChar ch = ConsSymbol ch ""+sShowChar :: SChar ch -> SSymbol (ShowChar ch)+sShowChar ch = sConsSymbol ch symbolSing type l ++ r = AppendSymbol l r type l > r = OrderingGT (CmpNat l r)
type-level-show.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: type-level-show-version: 0.2.0+version: 0.2.1 synopsis: Utilities for writing Show-like type families description: Please see README.md. category: Types, Data@@ -52,5 +52,5 @@ build-depends: base >=4.16 && <5 , defun-core ==0.1.*- , singleraeh ==0.1.*+ , singleraeh ==0.2.* default-language: GHC2021