packages feed

ttc 1.2.0.0 → 1.2.1.0

raw patch · 5 files changed

+112/−66 lines, 5 filesdep ~bytestringdep ~tastydep ~tasty-hunitPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: bytestring, tasty, tasty-hunit, text

API changes (from Hackage documentation)

- Data.TTC: instance Data.TTC.ParseDefault GHC.Integer.Type.Integer
- Data.TTC: instance Data.TTC.RenderDefault GHC.Integer.Type.Integer
+ Data.TTC: instance Data.TTC.ParseDefault GHC.Num.Integer.Integer
+ Data.TTC: instance Data.TTC.RenderDefault GHC.Num.Integer.Integer
- Data.TTC: valid :: (Parse a, Lift a) => String -> Q (TExp a)
+ Data.TTC: valid :: (MonadFail m, Quote m, Parse a, Lift a) => String -> Code m a
- Data.TTC: validOf :: Parse a => Proxy a -> String -> Q (TExp a)
+ Data.TTC: validOf :: (MonadFail m, Quote m, Parse a) => Proxy a -> String -> Code m a

Files

CHANGELOG.md view
@@ -24,6 +24,13 @@  [KaC]: <https://keepachangelog.com/en/1.0.0/> +## 1.2.1.0 (2023-03-21)++### Non-Breaking++* Bump `template-haskell` dependency version upper bound+* Adjust dependency constraints to match tested versions+ ## 1.2.0.0 (2022-03-18)  ### Breaking
LICENSE view
@@ -1,6 +1,6 @@ The MIT License -Copyright (c) 2019-2022 Travis Cardwell+Copyright (c) 2019-2023 Travis Cardwell  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal
README.md view
@@ -189,51 +189,58 @@  ### Rendering and Parsing -The [relude](https://hackage.haskell.org/package/relude) library has-polymorphic versions of `show` and `readEither` in `Relude.String.Conversion`,-as well as various type classes for converting between string types.  This-does not encourage using `Show` and `Read` instances with syntactically valid-Haskell syntax, and it encourages the using of the `String` data type.+The [relude][] library has polymorphic versions of `show` and `readEither` in+`Relude.String.Conversion`, as well as various type classes for converting+between string types.  This does not encourage using `Show` and `Read`+instances with syntactically valid Haskell syntax, and it encourages the using+of the `String` data type. -The [rio](https://hackage.haskell.org/package/rio) library has a `Display`-type class with a similar goal as `TTC.Render`.  Since the library encourages-a uniform usage of textual data types, `Display` only provides functions for-rendering to `Text` and a builder format.  It does not have a type class-similar to `TTC.Parse`.+The [rio][] library has a `Display` type class with a similar goal as+`TTC.Render`.  Since the library encourages a uniform usage of textual data+types, `Display` only provides functions for rendering to `Text` and a builder+format.  It does not have a type class similar to `TTC.Parse`. -The [text-display](https://hackage.haskell.org/package/text-display) library-defines a `Display` type class intended to render user-facing text.  It uses a-`Builder` type internally and renders to a `Text` value.+The [text-display][] library defines a `Display` type class intended to render+user-facing text.  It uses a `Builder` type internally and renders to a `Text`+value.  Harry Garrood has an interesting series of blog posts about type classes and `Show`: -* [Down with Show! Part 1: Rules of thumb for when to use a type class](https://harry.garrood.me/blog/down-with-show-part-1/)-* [Down with Show! Part 2: What's wrong with the Show type class](https://harry.garrood.me/blog/down-with-show-part-2/)-* [Down with Show! Part 3: A replacement for Show](https://harry.garrood.me/blog/down-with-show-part-3/)+* [Down with Show! Part 1: Rules of thumb for when to use a type class][]+* [Down with Show! Part 2: What's wrong with the Show type class][]+* [Down with Show! Part 3: A replacement for Show][] +[relude]: <https://hackage.haskell.org/package/relude>+[rio]: <https://hackage.haskell.org/package/rio>+[text-display]: <https://hackage.haskell.org/package/text-display>+[Down with Show! Part 1: Rules of thumb for when to use a type class]: <https://harry.garrood.me/blog/down-with-show-part-1/>+[Down with Show! Part 2: What's wrong with the Show type class]: <https://harry.garrood.me/blog/down-with-show-part-2/>+[Down with Show! Part 3: A replacement for Show]: <https://harry.garrood.me/blog/down-with-show-part-3/>+ ### Validating Constants -The [qq-literals](https://hackage.haskell.org/package/qq-literals) library-creates a `QuasiQuoter` from a parse function of type-`String -> Either String a`.  The functionality is similar to TTC's+The [qq-literals][] library creates a `QuasiQuoter` from a parse function of+type `String -> Either String a`.  The functionality is similar to TTC's `mkUntypedValidQQ` function.  The `mkUntypedValidQQ` function allows the user to choose the name of the `QuasiQuoter` because a name like `valid` is preferred when used via a qualified import while a name like `username` may be preferred when not using qualified imports.  Note that `mkUntypedValidQQ` also splices in an explicit type signature. -The-[validated-literals](https://hackage.haskell.org/package/validated-literals)-library has a `Validate` type class that is similar to `TTC.Parse` but-supports conversion between arbitrary types, not just from textual data types.-Template Haskell functions are provided to perform validation at compile-time.-Result types must either have `Lift` instances or equivalent implementations.+The [validated-literals][] library has a `Validate` type class that is similar+to `TTC.Parse` but supports conversion between arbitrary types, not just from+textual data types.  Template Haskell functions are provided to perform+validation at compile-time.  Result types must either have `Lift` instances or+equivalent implementations. -Chris Done posted-[a gist](https://gist.github.com/chrisdone/809296b769ee36d352ae4f8dbe89a364)-about implementing statically checked overloaded strings.+Chris Done posted [a gist][] about implementing statically checked overloaded+strings. +[qq-literals]: <https://hackage.haskell.org/package/qq-literals>+[validated-literals]: <https://hackage.haskell.org/package/validated-literals>+[a gist]: <https://gist.github.com/chrisdone/809296b769ee36d352ae4f8dbe89a364>+ ### String Type Conversion  There are a number of libraries that simplify conversion between string types.@@ -244,55 +251,83 @@ `Parse` using such a type class would have to be done via a fixed type, resulting in unnecessary conversion when using other types. -* [string-conv](https://hackage.haskell.org/package/string-conv)-* [string-conversions](https://hackage.haskell.org/package/string-conversions)+* [string-conv][]+* [string-conversions][]  The following library provide type classes with a single type variable, but conversion is done via a fixed type. -* [hxt-regex-xmlschema](https://hackage.haskell.org/package/hxt-regex-xmlschema)-  has a `StringLike` type class and does conversion via the `String` type-* [ListLike](https://hackage.haskell.org/package/ListLike) has a `StringLike`-  type class and does conversion via the `String` type-* [monoid-subclasses](https://hackage.haskell.org/package/monoid-subclasses)-  provides a `TextualMonoid` type class that provides an abstract API over-  textual types, using `String` as the underlying type-* [stringlike](https://hackage.haskell.org/package/stringlike) converts via-  the `Text` type-* [tagsoup](https://hackage.haskell.org/package/tagsoup) has a `StringLike`-  type class that provides an abstract API over textual types and a-  `castString` function that converts via the `String` type-* [text-conversions](https://hackage.haskell.org/package/text-conversions)-  converts via the `Text` type-* [textual](https://hackage.haskell.org/package/textual) (deprecated)-  converts via the `String` type+* [hxt-regex-xmlschema][] has a `StringLike` type class and does conversion+  via the `String` type+* [ListLike][] has a `StringLike` type class and does conversion via the+  `String` type+* [monoid-subclasses][] provides a `TextualMonoid` type class that provides an+  abstract API over textual types, using `String` as the underlying type+* [stringlike][] converts via the `Text` type+* [tagsoup][] has a `StringLike` type class that provides an abstract API over+  textual types and a `castString` function that converts via the `String`+  type+* [text-conversions][] converts via the `Text` type+* [textual][] (deprecated) converts via the `String` type +[string-conv]: <https://hackage.haskell.org/package/string-conv>+[string-conversions]: <https://hackage.haskell.org/package/string-conversions>+[hxt-regex-xmlschema]: <https://hackage.haskell.org/package/hxt-regex-xmlschema>+[ListLike]: <https://hackage.haskell.org/package/ListLike>+[monoid-subclasses]: <https://hackage.haskell.org/package/monoid-subclasses>+[stringlike]: <https://hackage.haskell.org/package/stringlike>+[tagsoup]: <https://hackage.haskell.org/package/tagsoup>+[text-conversions]: <https://hackage.haskell.org/package/text-conversions>+[textual]: <https://hackage.haskell.org/package/textual>+ ### Arbitrary Type Conversion  There are also a number of libraries that provide type classes for conversion between arbitrary types, including string types. -* [basement](https://hackage.haskell.org/package/basement) provides type-  classes for conversion that may fail as well as conversion that cannot fail-* [convertible](https://hackage.haskell.org/package/convertible)-* [witch](https://hackage.haskell.org/package/witch) provides type classes for-  conversion that may fail as well as conversion that cannot fail+* [basement][] provides type classes for conversion that may fail as well as+  conversion that cannot fail+* [convertible][]+* [witch][] provides type classes for conversion that may fail as well as+  conversion that cannot fail +[basement]: <https://hackage.haskell.org/package/basement>+[convertible]: <https://hackage.haskell.org/package/convertible>+[witch]: <https://hackage.haskell.org/package/witch>+ ## Project  ### Links  * Hackage: <https://hackage.haskell.org/package/ttc> * Stackage: <https://stackage.org/package/ttc>+* Flora: <https://flora.pm/packages/@hackage/ttc> * GitHub: <https://github.com/ExtremaIS/ttc-haskell> * GitHub Actions CI: <https://github.com/ExtremaIS/ttc-haskell/actions> +### Branches++The `main` branch is reserved for releases.  It may be considered stable, and+`HEAD` is always the latest release.++The `develop` branch is the primary development branch.  It contains changes+that have not yet been released, and it is not necessarily stable.++[Hackage revisions][] are made for metadata changes, such as relaxation of+constraints when new versions of dependencies are released.  The `ttc.cabal`+metadata in the `main` branch may therefore not match that of Hackage.  The+`ttc.cabal` metadata in the `develop` branch may match, *unless* work is being+done on a new release that contains other changes.++[Hackage revisions]: <https://github.com/haskell-infra/hackage-trustees/blob/master/revisions-information.md#hackage-metadata-revisions--what-they-are-how-they-work>+ ### Tags  All releases are tagged in the `main` branch.  Release tags are signed using-the-[`security@extrema.is` GPG key](http://keys.gnupg.net/pks/lookup?op=vindex&fingerprint=on&search=0x1D484E4B4705FADF).+the [`security@extrema.is` GPG key][]. +[`security@extrema.is` GPG key]: <https://keyserver.ubuntu.com/pks/lookup?search=0x1D484E4B4705FADF&fingerprint=on&op=index>+ ### Contribution  Issues and feature requests are tracked on GitHub:@@ -302,6 +337,8 @@  ### License -This project is released under the-[MIT License](https://opensource.org/licenses/MIT) as specified in the-[`LICENSE`](LICENSE) file.+This project is released under the [MIT License][] as specified in the+[`LICENSE`][] file.++[MIT License]: <https://opensource.org/licenses/MIT>+[`LICENSE`]: <LICENSE>
src/Data/TTC.hs view
@@ -2,7 +2,7 @@ -- | -- Module      : Data.TTC -- Description : textual type classes--- Copyright   : Copyright (c) 2019-2022 Travis Cardwell+-- Copyright   : Copyright (c) 2019-2023 Travis Cardwell -- License     : MIT -- -- TTC, an initialism of /Textual Type Classes/, is a library that provides
ttc.cabal view
@@ -1,5 +1,5 @@ name:           ttc-version:        1.2.0.0+version:        1.2.1.0 category:       Data, Text synopsis:       Textual Type Classes description:@@ -11,7 +11,7 @@ bug-reports:    https://github.com/ExtremaIS/ttc-haskell/issues author:         Travis Cardwell <travis.cardwell@extrema.is> maintainer:     Travis Cardwell <travis.cardwell@extrema.is>-copyright:      Copyright (c) 2019-2022 Travis Cardwell+copyright:      Copyright (c) 2019-2023 Travis Cardwell license:        MIT license-file:   LICENSE @@ -24,7 +24,9 @@    || ==8.8.4    || ==8.10.7    || ==9.0.2-   || ==9.2.1+   || ==9.2.7+   || ==9.4.4+   || ==9.6.1  extra-source-files:   CHANGELOG.md@@ -43,10 +45,10 @@   exposed-modules:       Data.TTC   build-depends:-      base >=4.7 && <5+      base >=4.10.1 && <4.19     , bytestring >=0.10.8 && <0.12-    , template-haskell >=2.12 && <2.19-    , text >=1.2.3 && <2.1+    , template-haskell >=2.12 && <2.21+    , text >=1.2.2 && <2.1   default-language: Haskell2010   default-extensions:       OverloadedStrings@@ -65,8 +67,8 @@   build-depends:       base     , bytestring-    , tasty >=1.0 && <1.5-    , tasty-hunit >=0.10 && <0.11+    , tasty >=0.11 && <1.5+    , tasty-hunit >=0.8 && <0.11     , template-haskell     , text     , ttc