{"id":28089082,"url":"https://github.com/blitzcode/hackage-diff","last_synced_at":"2025-05-13T12:53:37.528Z","repository":{"id":18803077,"uuid":"22017270","full_name":"blitzcode/hackage-diff","owner":"blitzcode","description":"Compare the public API of different versions of a Hackage library","archived":false,"fork":false,"pushed_at":"2018-05-02T18:02:46.000Z","size":35,"stargazers_count":63,"open_issues_count":7,"forks_count":6,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-02T14:21:29.215Z","etag":null,"topics":["hackage","haskell","hoogle"],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blitzcode.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2014-07-19T19:07:03.000Z","updated_at":"2024-04-17T21:14:43.000Z","dependencies_parsed_at":"2022-09-25T02:30:16.340Z","dependency_job_id":null,"html_url":"https://github.com/blitzcode/hackage-diff","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blitzcode%2Fhackage-diff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blitzcode%2Fhackage-diff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blitzcode%2Fhackage-diff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blitzcode%2Fhackage-diff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blitzcode","download_url":"https://codeload.github.com/blitzcode/hackage-diff/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253948085,"owners_count":21988951,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["hackage","haskell","hoogle"],"created_at":"2025-05-13T12:53:36.951Z","updated_at":"2025-05-13T12:53:37.511Z","avatar_url":"https://github.com/blitzcode.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hackage-diff\n\nCompare the public API of different versions of a Hackage library. Detect breaking changes before you update or upload a new version.\n\nAlso available on [Hackage](http://hackage.haskell.org/package/hackage-diff).\n\nSample output for `hackage-diff cereal 0.2 0.3.5.2`:\n\n```\nDownloading Hoogle DBs...\nParsing Hoogle DBs...\nComparing Hoogle DBs...\n\n--- Diff for | 0.2 → 0.3.5.2 | ---\n\n+ Data.Serialize.IEEE754\n  + getFloat32be :: Get Float\n  + getFloat32le :: Get Float\n  + getFloat64be :: Get Double\n  + getFloat64le :: Get Double\n  + putFloat32be :: Float -\u003e Put\n  + putFloat32le :: Float -\u003e Put\n  + putFloat64be :: Double -\u003e Put\n  + putFloat64le :: Double -\u003e Put\n× Data.Serialize\n  + instance Serialize a =\u003e GSerialize (K1 i a)\n  + instance GSerialize a =\u003e GSerialize (M1 i c a)\n  + instance (GSerialize a, GSerialize b) =\u003e GSerialize (a :*: b)\n  + instance GSerialize U1\n  + instance GSerialize a =\u003e GetSum (C1 c a)\n  + instance (GetSum a, GetSum b, GSerialize a, GSerialize b) =\u003e GetSum (a :+: b)\n  + instance GSerialize a =\u003e PutSum (C1 c a)\n  + instance (PutSum a, PutSum b, GSerialize a, GSerialize b) =\u003e PutSum (a :+: b)\n  + instance SumSize (C1 c a)\n  + instance (SumSize a, SumSize b) =\u003e SumSize (a :+: b)\n  + decodeLazy :: Serialize a =\u003e ByteString -\u003e Either String a\n  + encodeLazy :: Serialize a =\u003e a -\u003e ByteString\n  - data Get a\n  - type Put = PutM ()\n  - type Putter a = a -\u003e Put\n  - getWord8 :: Get Word8\n  - putWord8 :: Putter Word8\n× Data.Serialize.Get\n  + Done :: r -\u003e ByteString -\u003e Result r\n  + instance Eq More\n  + Fail :: String -\u003e Result r\n  + instance Functor Result\n  + Partial :: (ByteString -\u003e Result r) -\u003e Result r\n  + data Result r\n  + instance Show r =\u003e Show (Result r)\n  + ensure :: Int -\u003e Get ByteString\n  + runGetLazy :: Get a -\u003e ByteString -\u003e Either String a\n  + runGetLazyState :: Get a -\u003e ByteString -\u003e Either String (a, ByteString)\n  + runGetPartial :: Get a -\u003e ByteString -\u003e Result a\n  × New: isolate :: Int -\u003e Get a -\u003e Get a\n    Old: isolate :: String -\u003e Int -\u003e Get a -\u003e Get a\n× Data.Serialize.Put\n  + runPutLazy :: Put -\u003e ByteString\n  + runPutMLazy :: PutM a -\u003e (a, ByteString)\n· Data.Serialize.Builder\n\n[+ Added] [- Removed] [× Modified] [· Unmodified]\n\n6 potential breaking changes found\n```\n\nTerminal output can be colorized.\n\n# Usage\n\n```\nhackage-diff | Compare the public API of different versions of a Hackage library\ngithub.com/blitzcode/hackage-diff | www.blitzcode.net | (C) 2014 Tim C. Schroeder\n\nUsage: hackage-diff [options] \u003cpackage-name\u003e \u003cold-version|path\u003e \u003cnew-version|path\u003e\n      --mode=[downloaddb|builddb|parsehs]  what to download / read, how to compare\n                                             downloaddb - download Hoogle DBs and diff (Default)\n                                             builddb    - download packages, build Hoogle DBs and diff\n                                             parsehs    - download packages, directly diff .hs exports\n  -c  --disable-color                      disable color output\n  -s  --silent                             disable progress output\n\nExamples:\n  hackage-diff mtl 2.1 2.2.1\n  hackage-diff --mode=builddb JuicyPixels 3.1.4.1 3.1.5.2\n  hackage-diff conduit 1.1.5 ~/tmp/conduit-1.1.6/dist/doc/html/conduit/conduit.txt\n  hackage-diff --mode=parsehs QuickCheck 2.6 2.7.6\n  hackage-diff --mode=parsehs -s Cabal ~/tmp/Cabal-1.18.0/ 1.20.0.0\n```\n\nAs the examples hopefully illustrate, you can choose to specify a local package / Hoogle database file instead of a version to be downloaded from Hackage.\n\n# Modes\n\n`hackage-diff` can operate in three different modes which determine how it obtains and parses the information about the packages to be compared.\n\n### downloaddb\n\nDownload the Hoogle databases for both packages from Hackage, then parse and diff them. This is the default and recommended mode of operation. Sometimes Hackage does not have a Hoogle database for a particular version available. In this case, running with `builddb` might be more successful. \n\nAlternatively, you can also specify a path to any local Hoogle database file for one or both versions. The default way to build one is `cabal haddock --hoogle`, outputting to `dist/doc/html/mypackage/mypackage.txt`. This can be used, among other things, to check a package you're working on for breaking API changes relative to what's on Hackage.\n\n### builddb\n\nDownload the package sources from Hackage, setup sandboxes, install dependencies, configure and use Haddock to build the Hoogle databases, parse and diff them.\n\nThis is often very time consuming due to the dependency installation required for the Haddock build. Sometimes Haddock builds will fail, especially for older packages. As with `downloaddb`, a local Hoogle database file can be specified instead of a version.\n\n### parsehs\n\nDownload the package sources from Hackage, parse `.cabal` file for exported modules, pre-process them with `cpphs`, parse them with `haskel-src-exts` and diff their export lists.\n\nThis mode has many downsides. Packages making heavy use of the CPP will often fail to be parsed as the pre-processing done here is not identical to what a Cabal build would do. `haskel-src-exts` sometimes fails to parse code that GHC would accept. We only look at the export lists, so modules without an explicit one will fail to be parsed correctly. There's no inspection of the types of exports, only names will be compared.\n\nInstead of a version to download, a path to a local package can be specified instead.\n\n# TODO\n\nThis tools has various shortcomings and limitations and has only received a small amount of testing. Please let me know if you find an issue. Also see the various `TODO` comments scattered throughout the code.\n\n# Legal\n\nThis program is published under the [MIT License](http://en.wikipedia.org/wiki/MIT_License).\n\n# Author\n\nDeveloped by Tim C. Schroeder, visit my [website](http://www.blitzcode.net) to learn more.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblitzcode%2Fhackage-diff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblitzcode%2Fhackage-diff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblitzcode%2Fhackage-diff/lists"}