{"id":32159974,"url":"https://github.com/sheyll/pretty-types","last_synced_at":"2026-02-18T22:01:47.890Z","repository":{"id":56304757,"uuid":"65435325","full_name":"sheyll/pretty-types","owner":"sheyll","description":"A small pretty printing DSL for complex types.","archived":false,"fork":false,"pushed_at":"2021-02-04T12:28:09.000Z","size":40,"stargazers_count":8,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-21T13:38:35.469Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sheyll.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-11T03:26:15.000Z","updated_at":"2021-02-04T12:28:11.000Z","dependencies_parsed_at":"2022-08-15T16:20:34.658Z","dependency_job_id":null,"html_url":"https://github.com/sheyll/pretty-types","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/sheyll/pretty-types","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sheyll%2Fpretty-types","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sheyll%2Fpretty-types/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sheyll%2Fpretty-types/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sheyll%2Fpretty-types/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sheyll","download_url":"https://codeload.github.com/sheyll/pretty-types/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sheyll%2Fpretty-types/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29596329,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T20:59:56.587Z","status":"ssl_error","status_checked_at":"2026-02-18T20:58:41.434Z","response_time":162,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-21T13:30:51.759Z","updated_at":"2026-02-18T22:01:47.874Z","avatar_url":"https://github.com/sheyll.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Results](https://github.com/sheyll/pretty-types/workflows/Test/badge.svg?branch=main)](https://github.com/sheyll/pretty-types/actions)\n[![Hackage](https://img.shields.io/badge/hackage-prettytypes-green.svg?style=flat)](http://hackage.haskell.org/package/pretty-types)\n\n# Type Pretty Printing\n\nA tiny eDSL, not unlike `ErrorMessage` for `TypeError`s to pretty print types,\nespecially uninhabited types.\n\nThis Example will render this table:\n\n    +-------+-----+------------+\n    |  col 1|col 2|       col 3|\n    +-------+-----+------------+\n    |   2423|  451|       21234|\n    | 242322|   42|         n/a|\n    |      0| 4351|      623562|\n    |   4351|  n/a|         n/a|\n    |      0| 4351|      623562|\n    +-------+-----+------------+\n\nFrom this code:\n\n    module Main (main) where\n\n    import Data.Type.Pretty\n    import GHC.TypeLits\n    import Data.Kind\n    import Data.Proxy\n\n    main :: IO ()\n    main = putStrLn $ showPretty (Proxy :: Proxy TestTable)\n\n    type TestTable =\n      'MyTable         '[MyCol \"col 1\" 7, MyCol \"col 2\" 5, MyCol \"col 3\" 12]\n              '[ MyRow '[2423           ,451             ,21234]\n               , MyRow '[242322         ,42]\n               , MyRow '[0              ,4351            ,623562]\n               , MyRow '[4351]\n               , MyRow '[0              ,4351            ,623562]\n               ]\n\n    data MyTable = MyTable [Type] [Type]\n    data MyCol :: Symbol -\u003e Nat -\u003e Type\n    data MyRow :: [Nat] -\u003e Type\n\n\n    type instance ToPretty ('MyTable cols rows) =\n               PrettyManyIn (PutStr \"+\") (RowSepLine cols)\n          \u003c$$\u003e PrettyManyIn (PutStr \"|\") (TableHeading cols)\n          \u003c$$\u003e PrettyManyIn (PutStr \"+\") (RowSepLine cols)\n          \u003c$$\u003e PrettyHigh   (TableRows cols rows)\n          \u003c$$\u003e PrettyManyIn (PutStr \"+\") (RowSepLine cols)\n\n    type family TableHeading (cols :: [Type]) :: [PrettyType]\n    type instance TableHeading '[] = '[]\n    type instance TableHeading (MyCol title width ': r) =\n      PutStrW width title  ': TableHeading  r\n\n    type family\n       RowSepLine (cols :: [Type]) :: [PrettyType] where\n       RowSepLine '[] = '[]\n       RowSepLine (MyCol title width ': r) =\n         PrettyOften width (PutStr \"-\") ': RowSepLine  r\n\n    type family\n      TableRows (cols :: [Type]) (rows :: [Type]) :: [PrettyType] where\n      TableRows cols '[] = '[]\n      TableRows cols (MyRow cells ': rest ) =\n        PrettyManyIn (PutStr \"|\") (TableCells cols cells) ': TableRows cols rest\n\n    type family\n      TableCells (cols :: [Type]) (cells :: [Nat]) :: [PrettyType] where\n      TableCells '[] cells = '[]\n      TableCells (MyCol title width ': cols) (value ': cells) =\n        PutNatW width value ':  TableCells cols cells\n      TableCells (MyCol title width ': cols) '[] =\n        PutStrW width \"n/a\" ':  TableCells cols '[]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsheyll%2Fpretty-types","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsheyll%2Fpretty-types","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsheyll%2Fpretty-types/lists"}