type-errors-pretty

Combinators for writing pretty type errors easily

https://github.com/chshersh/type-errors-pretty

Version on this page:0.0.1.0
LTS Haskell 19.33:0.0.1.2
Stackage Nightly 2022-03-17:0.0.1.2
Latest on Hackage:0.0.1.2

See all snapshots type-errors-pretty appears in

MPL-2.0 licensed by Dmitrii Kovanikov
Maintained by Dmitrii Kovanikov
This version can be pinned in stack with:type-errors-pretty-0.0.1.0@sha256:be1e7849514ec5378a03a75dfa5c645c1c6cfa5d986b0566a85340683213ce45,2472

Module documentation for 0.0.1.0

Depends on 1 package(full list with versions):
Used by 1 package in lts-14.13(full list with versions):

type-errors-pretty

pretty-bug Build status Hackage Stackage Lts Stackage Nightly MPL-2.0 license

“It is important that we forgive ourselves for making mistakes. We need to learn from our errors and move on.”

― Steve Maraboli, Life, the Truth, and Being Free

Combinators for writing pretty type errors easily. The word pretty here doesn’t mean that the resulting type errors will be pretty (though, I believe they will be awesome), but the way the type errors are defined in your code is pretty.

If you’re interested in motivation behind using type errors at first place, you can read the following blog post:

The type-errors-pretty library allows you to write the text of custom compile-time error messages with less effort in the following way:

import Type.Errors.Pretty (type (<>), type (%))


type MessageText (e1 :: k) (e2 :: k) (es :: [k])
    = "You require the following two effects from your computation:"
    % ""
    % "    '" <> e1 <> "' and '" <> e2 <> "'"
    % ""
    % "However, your monad is capable of performing only the following effects:"
    % ""
    % "    " <> es

Acknowledgement

Icons made by Freepik from www.flaticon.com is licensed by CC 3.0 BY.

Changes

Changelog

type-errors-pretty uses PVP Versioning. The changelog is available on GitHub.

0.0.1.0 — Oct 15, 2019

0.0.0.0 — Jul 15, 2019

  • Initially created.