packages feed

type-level-bytestrings 0.1.0 → 0.2.0

raw patch · 5 files changed

+25/−19 lines, 5 filesdep +defun-coredep ~base

Dependencies added: defun-core

Dependency ranges changed: base

Files

CHANGELOG.md view
@@ -1,3 +1,10 @@+## 0.2.0 (2024-05-07)+* remove `Symbol` parsing; see+  [symbol-parser](https://hackage.haskell.org/package/symbol-parser) for+  complete `Symbol` parser combinator library+* various cleanup; now a very small library, just `Natural`-byte reification and+  `Symbol` UTF8 conversion+ ## 0.1.0 (2024-04-13) Initial release. 
README.md view
@@ -1,6 +1,8 @@ # type-level-bytestrings-Need to reify types to bytestrings? This library provides a few primitives that-should get you started.+Assorted utilities concerning type-level bytestrings:++* reifying type-level `Natural`s to bytes+* converting type-level `Symbol`s to UTF8  Doesn't work on GHC 9.2 due to some issue with `TypeError`. 
src/Data/Type/Symbol/Utf8.hs view
@@ -9,7 +9,7 @@   ) where  import GHC.TypeLits-import Raehik.Data.Type.Common ( type IfNatLte, type (++) )+import Data.Type.Ord ( OrdCond )  -- | Convert a type-level symbol to UTF-8. --@@ -51,3 +51,11 @@ type UCP42 n = 0b10000000 + ((n `Div` (2^12)) `Mod` (2^12)) type UCP43 n = 0b10000000 + ((n `Div` (2^6)) `Mod` (2^6)) type UCP44 n = 0b10000000 + (n `Mod` (2^6))++-- | Simplified common type-level conditional.+type IfNatLte n m fThen fElse = OrdCond (CmpNat n m) fThen fThen fElse++-- | Concatenate two type-level lists. (gosh this really should get into base)+type family l ++ r where+    (a ': l) ++ r = a ': l ++ r+    '[] ++ r = r
− src/Raehik/Data/Type/Common.hs
@@ -1,12 +0,0 @@-module Raehik.Data.Type.Common where--import GHC.TypeLits-import Data.Type.Ord ( OrdCond )---- | Simplified common type-level conditional.-type IfNatLte n m fThen fElse = OrdCond (CmpNat n m) fThen fThen fElse---- | Append two type-level lists.-type family l ++ r where-    (a ': l) ++ r = a ': l ++ r-    '[] ++ r = r
type-level-bytestrings.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack  name:           type-level-bytestrings-version:        0.1.0+version:        0.2.0 synopsis:       Tools for manipulating type-level bytes and bytestrings description:    Please see README.md. category:       Types, Data, ByteString@@ -32,7 +32,6 @@   exposed-modules:       Data.Type.Byte       Data.Type.Symbol.Utf8-      Raehik.Data.Type.Common   other-modules:       Paths_type_level_bytestrings   hs-source-dirs:@@ -50,7 +49,8 @@       MagicHash   ghc-options: -Wall   build-depends:-      base >=4.14 && <5+      base >=4.17 && <5+    , defun-core ==0.1.*   default-language: GHC2021  test-suite spec@@ -73,7 +73,8 @@       MagicHash   ghc-options: -Wall   build-depends:-      base >=4.14 && <5+      base >=4.17 && <5+    , defun-core ==0.1.*     , type-level-bytestrings     , type-spec >=0.4.0.0 && <0.5   default-language: GHC2021