MIT licensed by Ben Orchard
Maintained by Ben Orchard
This version can be pinned in stack with:type-level-show-0.3.0@sha256:f25bf80769a14d8de79698c7155f09831bc60019df4d6e76e64a9b48dc26a7b3,1385

Module documentation for 0.3.0

Used by 2 packages in nightly-2024-11-21(full list with versions):

type-level-show

Utilities for writing Show-like type families i.e. instead of showsPrec :: Int -> a -> ShowS, we have ShowsPrec :: Natural -> k -> Symbol.

Requires at least GHC 9.6 for the builtin SChar etc. singletons.

Why?

refined fills out error messages using TypeReps. My rewrite rerefined allows you to use Typeable to fill out a predicate name, or you can do it yourself. But TypeRep is a pain to use, and it seems strange to do runtime work on type representations. Why can’t we just do it on the type level?

We could, but the problem is nice formatting. Show instances handle precedence, and the base library provides a bunch of handy utilities such as showParen :: Bool -> ShowS -> ShowS. Worse, I couldn’t find a ShowNat :: Natural -> Symbol type family on Hoogle, which is a very simple type family that should certainly be lying around.

This library intends to provide such utilities, so that rerefined can avoid Typeable altogether.

Unsure if I’ll provide a ShowType. Lower priority than the plain utilities.

License

Provided under the MIT license. See LICENSE for license text.

Changes

0.3.0 (2024-06-01)

  • update singleraeh

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

0.1.1 (2024-05-16)

  • add Doc type for ErrorMessage-like errors, except term level also

0.1.0 (2024-05-07)

Initial release.

  • some simple type-level printy helpers