JonathanBrouwer / agda2hs

Compiling Agda code to readable Haskell

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GitHub CI

agda2hs

The goal of this project is not to translate 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.

See test/Test.agda for an example.

Future work

  • Compile lambdas #5
  • Sections #21
  • Compile if/then/else #13
  • Literals in patterns
  • Use some Haskell syntax ADT and a proper pretty printing library #4
  • Map instance arguments to Haskell type classes (definitions and use) #3
  • where clauses #23
  • Higher-rank polymorphism
  • More builtin types (Double, Word64) #12
  • Strings
  • Compile case_of_ λ where to Haskell case
  • with?
  • Compile equality proofs to QuickCheck properties?
  • Module export lists (how?)
  • Fixity declarations

About

Compiling Agda code to readable Haskell

License:MIT License


Languages

Language:Agda 57.8%Language:Haskell 40.8%Language:Makefile 0.8%Language:Nix 0.7%