Skip to content
💄 🐞 Combinators for writing pretty type errors easily
Haskell Nix
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/Type/Errors Implement pretty type errors (#2) Jul 14, 2019
test Implement pretty type errors (#2) Jul 14, 2019
.gitignore Add Nix support (#4) Aug 20, 2019
.stylish-haskell.yaml
.travis.yml Add Nix support (#4) Aug 20, 2019
CHANGELOG.md Update metadata Jul 15, 2019
LICENSE Create the project Jul 13, 2019
README.md Update metadata Jul 15, 2019
default.nix
stack.yaml Create the project Jul 13, 2019
type-errors-pretty.cabal Update metadata Jul 15, 2019

README.md

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.

You can’t perform that action at this time.