agda2hs: Compiling Agda code to readable Haskell.

[ bsd3, compiler, language, program ] [ Propose Tags ] [ Report a vulnerability ]

Produces verified and readable Haskell code by extracting it from a (lightly annotated) Agda program. The tool is implemented as an Agda backend, which means that agda2hs is a fully functional Agda compiler.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 1.0, 1.1, 1.2, 1.3
Change log CHANGELOG.md
Dependencies aeson (>=2.0.3 && <2.3), Agda (>=2.7.0 && <2.8.0), base (>=4.13 && <4.21), bytestring (>=0.11.5 && <0.13), containers (>=0.6 && <0.8), deepseq (>=1.4.4 && <1.6), directory (>=1.2.6.2 && <1.4), filepath (>=1.4.1.0 && <1.5), haskell-src-exts (>=1.23 && <1.25), monad-control (>=1.0 && <1.1), mtl (>=2.2 && <2.3 || >=2.3.1 && <2.4), syb (>=0.7.2 && <0.8), text (>=2.0.2 && <2.2), transformers (>=0.6 && <0.7), unordered-containers (>=0.2.19 && <0.3), yaml (>=0.11 && <0.12) [details]
License BSD-3-Clause
Copyright 2024 Ulf Norell, Jesper Cockx, Orestis Melkonian, Sára Juhošová, James Chapman, Lucas Escot, Henry Blanchette, Viktor Csimma, Aleksander Wolska, Paul Bittner, Andreas Källberg, Bohdan Liesnikov, and Jakob Naucke
Author Ulf Norell, Jesper Cockx, Orestis Melkonian, Sára Juhošová, James Chapman, Lucas Escot, Henry Blanchette, Viktor Csimma, Aleksander Wolska, Paul Bittner, Andreas Källberg, Bohdan Liesnikov, and Jakob Naucke
Maintainer jesper@sikanda.be
Category Language, Compiler
Source repo head: git clone https://github.com/agda/agda2hs.git
Uploaded by jcockx at 2024-10-04T12:13:44Z
Distributions
Executables agda2hs
Downloads 239 total (20 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
Last success reported on 2024-10-04 [all 1 reports]

Readme for agda2hs-1.3

[back to package description]

GitHub CI

agda2hs

Agda2hs is a tool for producing verified and readable Haskell code by extracting it from a (lightly annotated) Agda program. The goal of this project is not to translate arbitrary Agda code to Haskell. Rather it is to carve out a common sublanguage between Agda and Haskell, with a straightforward translation from the Agda side to the Haskell side. This lets you write your program in the Agda fragment, using full Agda to prove properties about it, and then translate it to nice looking readable Haskell code that you can show your Haskell colleagues without shame.

Documentation

Documentation can be viewed at https://agda.github.io/agda2hs. You can also find examples in the test directory of this repository, in particular the file Test.agda. The documentation is a work in progress, so if you have been using agda2hs and want to contribute in some way, adding documentation or examples would be very welcome.

agda2hs was introduced in the Haskell Symposium '22 paper Reasonable Agda is Correct Haskell: Writing Verified Haskell using agda2hs.

Future work

Currently agda2hs is under active development, please take a look at the issue tracker. If you have a suggestion for a new feature that is not yet on the issue tracker, you are welcome to create a new issue or a PR. Feature requests should be of the form "Add support for Haskell feature X", not "Add support for Agda feature Y" (see "Objective" above). If you want to compile arbitrary Agda code to Haskell, you are advised to use Agda's built-in GHC backend instead.