|
| 1 | +# hackage-diff |
| 2 | + |
| 3 | +Compare the public API of different versions of a Hackage library. |
| 4 | + |
| 5 | +Sample output for `hackage-diff mtl 2.0.1.1 2.2.1`: |
| 6 | + |
| 7 | +``` |
| 8 | +Downloading Hoogle DBs... |
| 9 | +Parsing Hoogle DBs... |
| 10 | +Comparing Hoogle DBs... |
| 11 | +
|
| 12 | +--- Diff for | 2.0.1.1 → 2.2.1 | --- |
| 13 | +
|
| 14 | ++ Control.Monad.Except |
| 15 | + + type Except e = ExceptT e Identity |
| 16 | + + newtype ExceptT e (m :: * -> *) a :: * -> (* -> *) -> * -> * |
| 17 | + + ExceptT :: m (Either e a) -> ExceptT e a |
| 18 | + + class Monad m => MonadError e m | m -> e |
| 19 | + + catchError :: MonadError e m => m a -> (e -> m a) -> m a |
| 20 | + + mapExcept :: (Either e a -> Either e' b) -> Except e a -> Except e' b |
| 21 | + + mapExceptT :: (m (Either e a) -> n (Either e' b)) -> ExceptT e m a -> ExceptT e' n b |
| 22 | + + runExcept :: Except e a -> Either e a |
| 23 | + + runExceptT :: ExceptT e m a -> m (Either e a) |
| 24 | + + throwError :: MonadError e m => e -> m a |
| 25 | + + withExcept :: (e -> e') -> Except e a -> Except e' a |
| 26 | + + withExceptT :: Functor m => (e -> e') -> ExceptT e m a -> ExceptT e' m a |
| 27 | +× Control.Monad.Cont |
| 28 | +× Control.Monad.Cont.Class |
| 29 | + + instance MonadCont m => MonadCont (ExceptT e m) |
| 30 | +× Control.Monad.Error |
| 31 | +× Control.Monad.Error.Class |
| 32 | + + instance Monad m => MonadError e (ExceptT e m) |
| 33 | + + instance MonadError e (Either e) |
| 34 | + - instance Error e => MonadError e (Either e) |
| 35 | +× Control.Monad.RWS.Class |
| 36 | + + instance MonadRWS r w s m => MonadRWS r w s (ExceptT e m) |
| 37 | +× Control.Monad.RWS.Lazy |
| 38 | +× Control.Monad.RWS.Strict |
| 39 | +× Control.Monad.Reader |
| 40 | + × New: reader :: MonadReader r m => (r -> a) -> m a |
| 41 | + Old: reader :: (r -> a) -> Reader r a |
| 42 | +× Control.Monad.Reader.Class |
| 43 | + + instance MonadReader r m => MonadReader r (ExceptT e m) |
| 44 | + + reader :: MonadReader r m => (r -> a) -> m a |
| 45 | +× Control.Monad.State.Class |
| 46 | + + instance MonadState s m => MonadState s (ExceptT e m) |
| 47 | + + modify' :: MonadState s m => (s -> s) -> m () |
| 48 | + + state :: MonadState s m => (s -> (a, s)) -> m a |
| 49 | +× Control.Monad.State.Lazy |
| 50 | + + modify' :: MonadState s m => (s -> s) -> m () |
| 51 | + × New: state :: MonadState s m => (s -> (a, s)) -> m a |
| 52 | + Old: state :: (s -> (a, s)) -> State s a |
| 53 | +× Control.Monad.State.Strict |
| 54 | + + modify' :: MonadState s m => (s -> s) -> m () |
| 55 | + × New: state :: MonadState s m => (s -> (a, s)) -> m a |
| 56 | + Old: state :: (s -> (a, s)) -> State s a |
| 57 | +× Control.Monad.Writer.Class |
| 58 | + + instance MonadWriter w m => MonadWriter w (ExceptT e m) |
| 59 | + + writer :: MonadWriter w m => (a, w) -> m a |
| 60 | +× Control.Monad.Writer.Lazy |
| 61 | + × New: writer :: MonadWriter w m => (a, w) -> m a |
| 62 | + Old: writer :: (a, w) -> Writer w a |
| 63 | +× Control.Monad.Writer.Strict |
| 64 | + × New: writer :: MonadWriter w m => (a, w) -> m a |
| 65 | + Old: writer :: (a, w) -> Writer w a |
| 66 | +· Control.Monad.Identity |
| 67 | +· Control.Monad.List |
| 68 | +· Control.Monad.RWS |
| 69 | +· Control.Monad.State |
| 70 | +· Control.Monad.Trans |
| 71 | +· Control.Monad.Writer |
| 72 | +
|
| 73 | +[+ Added] [- Removed] [× Modified] [· Unmodified] |
| 74 | +``` |
| 75 | + |
| 76 | +In the terminal it can also use ANSI colors. |
| 77 | + |
| 78 | +# Usage |
| 79 | + |
| 80 | +``` |
| 81 | +hackage-diff | Compare the public API of different versions of a Hackage package |
| 82 | +github.com/blitzcode/hackage-diff | www.blitzcode.net | (C) 2014 Tim C. Schroeder |
| 83 | +
|
| 84 | +Usage: hackage-diff [options] <package-name> <old-version> <new-version> |
| 85 | + --mode=[downloaddb|builddb|parsehs] what to download, how to compare |
| 86 | + downloaddb - download Hoogle DBs and diff (Default) |
| 87 | + builddb - download packages, build Hoogle DBs and diff |
| 88 | + parsehs - download packages, directly diff .hs exports |
| 89 | + -c --disable-color disable color output |
| 90 | + -s --silent disable progress output |
| 91 | +``` |
| 92 | + |
| 93 | +For instance, `hackage-diff base 4.6.0.0 4.7.0.0` compares the last two major releases of `base`. |
| 94 | + |
| 95 | +# Modes |
| 96 | + |
| 97 | +`hackage-diff` can operate in there different modes which determine how it obtains and parses the information about the packages to be compared. |
| 98 | + |
| 99 | +### downloaddb |
| 100 | + |
| 101 | +Download 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. |
| 102 | + |
| 103 | +### builddb |
| 104 | + |
| 105 | +Download the package sources from Hackage, setup sandboxes, install dependencies, configure and use Haddock to build the Hoogle databases, parse and diff them. This is often very time consuming due to the dependency installation required for the Haddock build. Sometimes Haddock builds will fail, especially for older packages. |
| 106 | + |
| 107 | +### parsehs |
| 108 | + |
| 109 | +Download 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. This 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. |
| 110 | + |
| 111 | +# TODO |
| 112 | + |
| 113 | +This 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. |
| 114 | + |
| 115 | +# Legal |
| 116 | + |
| 117 | +This program is published under the [MIT License](http://en.wikipedia.org/wiki/MIT_License). |
| 118 | + |
| 119 | +# Author |
| 120 | + |
| 121 | +Developed by Tim C. Schroeder, visit my [website](http://www.blitzcode.net) to learn more. |
0 commit comments