Skip to content
This repository was archived by the owner on Aug 3, 2024. It is now read-only.

Provide --show-interface option to dump interfaces #645

Merged
merged 10 commits into from
Aug 6, 2017

Conversation

alexbiehl
Copy link
Member

@alexbiehl alexbiehl commented Jun 24, 2017

I have spent lots of time debugging haddock recently and I think this would have helped me a lot. Like ghcs own --show-iface this flag dumps a binary interface file to
stdout in a human (and machine) readable fashion. Currently it uses json as output format.

@alexbiehl
Copy link
Member Author

Currently output is not pretty at all.
$ haddock --show-interface bundled.haddock results in pretty garbled output:

{"link_env": null,"inst_ifaces": [{"module": "$main$BundledPatterns","is_sig": false,"info": null,"doc_map": null,"arg_map": null,"exports": ["$main$BundledPatterns$RTree","$main$BundledPatterns$LR","$main$BundledPatterns$BR","$main$BundledPatterns$Vec","$main$BundledPatterns$Nil","$main$BundledPatterns$:>"],"visible_exports": ["$main$BundledPatterns$Vec","$main$BundledPatterns$Nil","$main$BundledPatterns$:>","$main$BundledPatterns$RTree","$main$BundledPatterns$LR","$main$BundledPatterns$BR"],"options": null,"sub_map": {"$main$BundledPatterns$tsplit": [],"$main$BundledPatterns$textract": [],"$main$BundledPatterns$tail": [],"$main$BundledPatterns$head": [],"$main$BundledPatterns$:>": [],"$main$BundledPatterns$LR": [],"$main$BundledPatterns$BR": [],"$main$BundledPatterns$Vec": ["$main$BundledPatterns$Nil","$main$BundledPatterns$Cons"],"$main$BundledPatterns$RTree": ["$main$BundledPatterns$LR_","$main$BundledPatterns$BR_"]},"bundled_patsyns": {"$main$BundledPatterns$Vec": ["$main$BundledPatterns$:>"],"$main$BundledPatterns$RTree": ["$main$BundledPatterns$LR","$main$BundledPatterns$BR"]},"fix_map": {"$main$BundledPatterns$Cons": {"prec": 5,"direction": "infixr"},"$main$BundledPatterns$:>": {"prec": 5,"direction": "infixr"}}},{"module": "$main$BundledPatterns2","is_sig": false,"info": null,"doc_map": null,"arg_map": null,"exports": ["$main$BundledPatterns$RTree","$main$BundledPatterns$LR","$main$BundledPatterns$BR","$main$BundledPatterns$Vec","$main$BundledPatterns$Nil","$main$BundledPatterns$:>","$main$BundledPatterns2$Empty"],"visible_exports": ["$main$BundledPatterns2$Empty"],"options": null,"sub_map": {"$main$BundledPatterns2$Empty": []},"bundled_patsyns": {},"fix_map": {}}]}```

@alexbiehl alexbiehl requested review from hvr and bgamari June 24, 2017 10:02
@hvr
Copy link
Member

hvr commented Jun 24, 2017

This will prove very relevant to my hidden agendainterests... thanks for tackling this! :-)

Like ghcs own --show-iface this flag dumps a binary interface file to
stdout in a human (and machine) readable fashion. Currently it uses
json as output format.
dmalikov added a commit to dmalikov/ghc that referenced this pull request Aug 5, 2017
It seems to that double quotes is not escaped well at the moment.

We'd noticed this with @alexbiehl during the work on haskell/haddock#645
dmalikov and others added 6 commits August 6, 2017 11:25
* origin/master: (22 commits)
  Fix renaming after instance signature specializing (haskell#660)
  Prepare haddock-library-1.4.5 release
  Changelog for haddock-library
  Fixup haddock
  Move `DocMarkup` from haddock-api to haddock-library (haskell#659)
  Bump haddock to 2.18.2, haddock-library to 1.4.5
  Update README
  Mention new-build in README
  Add cheatsheet to haddock.cabal
  Import @aisamanra's Haddock cheatsheet
  Beef up haddock description (haskell#658)
  Drop obsolete/misleading `stability: experimental`
  haddock-api: add changelog pointing to haddock's changelog
  Refactor .cabal to use sub-lib for vendored lib
  Avoid trivial use of LambdaCase
  Tweak haddock-api.cabal for pending release
  Prepare 2.18.1 release (haskell#657)
  Fix compilation of lib:haddock-library w/ GHC < 8
  Fix haskell#249 (haskell#655)
  Avoid missing home module warning (haskell#652)
  ...
* origin/master:
  Fix: Generate pattern signatures for constructors exported as patterns (haskell#663)
@alexbiehl alexbiehl changed the title WIP: Provide --show-interface option to dump interfaces Provide --show-interface option to dump interfaces Aug 6, 2017
It would result in unused import if the Bifunctor instance is not generated.
@alexbiehl
Copy link
Member Author

Thank you @dmalikov! Nice work!

@alexbiehl alexbiehl merged commit f1d326b into haskell:master Aug 6, 2017
bgamari pushed a commit to bgamari/ghc that referenced this pull request Aug 7, 2017
It seems to that double quotes is not escaped well at the moment.

We'd noticed this with @alexbiehl during the work on haskell/haddock#645
bgamari pushed a commit to bgamari/ghc that referenced this pull request Aug 25, 2017
It seems to that double quotes is not escaped well at the moment.

We'd noticed this with @alexbiehl during the work on haskell/haddock#645
(cherry picked from commit e8fe12f)
bgamari pushed a commit to bgamari/ghc that referenced this pull request Aug 25, 2017
It seems to that double quotes is not escaped well at the moment.

We'd noticed this with @alexbiehl during the work on haskell/haddock#645
(cherry picked from commit e8fe12f)
bgamari pushed a commit to bgamari/ghc that referenced this pull request Aug 25, 2017
It seems to that double quotes is not escaped well at the moment.

We'd noticed this with @alexbiehl during the work on haskell/haddock#645
(cherry picked from commit e8fe12f)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants