https://github.com/mgree/ohso
A port of the Hughes/Peyton Jones pretty printing library.
https://github.com/mgree/ohso
Last synced: about 1 year ago
JSON representation
A port of the Hughes/Peyton Jones pretty printing library.
- Host: GitHub
- URL: https://github.com/mgree/ohso
- Owner: mgree
- License: gpl-3.0
- Created: 2020-08-14T21:34:33.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2020-08-18T20:43:52.000Z (almost 6 years ago)
- Last Synced: 2025-02-09T21:43:52.605Z (over 1 year ago)
- Language: Rust
- Size: 116 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ohso
[](https://travis-ci.com/mgree/mgt)
An implementation of the Hughes/Peyton Jones pretty printing library for Rust.
The code here follows
[pretty](https://hackage.haskell.org/package/pretty-1.1.3.6) package in Hackage.
NB that the original code is under a BSD 3-clause license (see
`LICENSE.original`) while _this_ package is under GPL 3 (see `LICENSE`).
# TODO
- [ ] Compare with [Haskell benchmarks](https://github.com/haskell/pretty/blob/master/bench/Bench.hs)
- [ ] Compare with [Rust benchmarks](https://github.com/Marwes/pretty.rs/blob/master/benches/trees.rs)
- [ ] Port [Haskell tests](https://github.com/haskell/pretty/tree/master/tests)
- [ ] Think about keeping annotations by reference
- [ ] Suite of examples (JSON, IMP, STLC)
- [ ] Profile and optimize `render` (e.g., `output` should be `rope` with good prepend operation; support using `Write` to avoid constructing the string)
- [ ] Figure out invariant around calls to `.reduce()` (every render involves a clone, per `render.rs` L221!)