Skip to content
vic

kowainik/type-errors-pretty

๐Ÿ’„๐Ÿž Combinators for writing pretty type errors easily

kowainik/type-errors-pretty.json
{
"createdAt": "2019-07-13T10:15:56Z",
"defaultBranch": "main",
"description": "๐Ÿ’„๐Ÿž Combinators for writing pretty type errors easily",
"fullName": "kowainik/type-errors-pretty",
"homepage": "",
"language": "Haskell",
"name": "type-errors-pretty",
"pushedAt": "2022-03-07T18:30:31Z",
"stargazersCount": 56,
"topics": [
"compile-time",
"hacktoberfest",
"haskell",
"pretty",
"type-errors",
"type-level"
],
"updatedAt": "2025-04-16T18:54:31Z",
"url": "https://github.com/kowainik/type-errors-pretty"
}

pretty-bug

GitHub CI Hackage [MPL-2.0 license]!(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

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