ghc-justdoit: A magic typeclass that just does it

[ language, library, mit ] [ Propose Tags ]

This plugin allows you to write

{-# OPTIONS_GHC -fplugin GHC.JustDoIt.Plugin #-}
module Test where

import GHC.JustDoIt

foo :: ((a -> r) -> r) -> (a -> ((b -> r) -> r)) -> ((b -> r) -> r)
foo = (…)

without having to write the actual implementation of foo.

See examples/Demo.hs for a few examples of what this plugin can do for you.

[Skip to Readme]


[Last Documentation]

  • GHC
    • GHC.JustDoIt
      • GHC.JustDoIt.Plugin
      • GHC.JustDoIt.Solver
    • GHC.LJT


Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Versions [RSS] 0.1,,
Change log
Dependencies base (>=4.15 && <4.16), ghc (>=9.0), hashable [details]
License MIT
Copyright 2018 Joachim Breitner
Author Joachim Breitner
Category Language
Home page
Source repo head: git clone git://
Uploaded by JoachimBreitner at 2022-08-01T18:39:38Z
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 1262 total (14 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2022-08-01 [all 2 reports]

Readme for ghc-justdoit-

[back to package description]

ghc-justdoit: a GHC plugin to write the code for you

This is a prototype of a code synthesis plugin for GHC, which uses LJT proof search to instantiate a type.


{-# OPTIONS_GHC -fplugin=GHC.JustDoIt.Plugin #-}
module Test where

import GHC.JustDoIt

foo :: ((a -> r) -> r) -> (a -> ((b -> r) -> r)) -> ((b -> r) -> r)
foo = (…)

Missing bits

  • The LJT might not be complete, due to insufficient backtracking.
  • The implementation is very much unoptimized.
  • It returns one solution, but not necessary the “best” one. But what is the “best” one?
  • It ignores any recursive type, so it cannot do anything with lists. It would be much more useful if it could do some best-effort thing here as well.
  • It ignores linear types, and will likely produce ill-typed expressions for them.

If someone wants to pick it up from here, that’d be great!


Please reports bugs and missing features at the GitHub bugtracker. This is also where you can find the source code.

ghc-justdoit was written by Joachim Breitner and is licensed under a permissive MIT license.