-
-
Notifications
You must be signed in to change notification settings - Fork 370
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow hole filling to deal with recursion (#472)
This PR enhances the "attempt to fill hole" code action, allowing it to implement self-recursive functions. The generated code ensures recursion occurs only on structurally-smaller values, and preserves the positional ordering of homomorphically destructed arguments. It's clever enough to implement foldr and nontrivial functor instances. Co-authored-by: TOTBWF <reed.mullanix@calabrio.com>
- Loading branch information
Showing
35 changed files
with
785 additions
and
244 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
module Ide.Plugin.Tactic.Auto where | ||
|
||
import Ide.Plugin.Tactic.Context | ||
import Ide.Plugin.Tactic.Judgements | ||
import Ide.Plugin.Tactic.KnownStrategies | ||
import Ide.Plugin.Tactic.Tactics | ||
import Ide.Plugin.Tactic.Types | ||
import Refinery.Tactic | ||
import Ide.Plugin.Tactic.Machinery (tracing) | ||
|
||
|
||
------------------------------------------------------------------------------ | ||
-- | Automatically solve a goal. | ||
auto :: TacticsM () | ||
auto = do | ||
jdg <- goal | ||
current <- getCurrentDefinitions | ||
traceMX "goal" jdg | ||
traceMX "ctx" current | ||
commit knownStrategies | ||
. tracing "auto" | ||
. localTactic (auto' 4) | ||
. disallowing | ||
$ fmap fst current | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.