Skip to content

Commit

Permalink
Experimentation with polymorphic task definition.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Kariniemi committed Apr 9, 2024
1 parent 3069745 commit 79d84d8
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 1 deletion.
2 changes: 1 addition & 1 deletion examples/build-systems-ala-carte/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ HS_SPEC=hs-spec

# Handwritten modules (usually by modification of generated version)
HANDMOD = \
Build/Task \



Expand Down Expand Up @@ -67,7 +68,6 @@ HANDMOD = \
# | Script : k -> Key k v s s
# | Value : k -> Key k v s v.
MODULES = \
Build/Task \
Build/Store \
Build/Trace \
Build/Task/Monad \
Expand Down
51 changes: 51 additions & 0 deletions examples/build-systems-ala-carte/manual/Build/Task.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
(* Default settings (from HsToCoq.Coq.Preamble) *)

Generalizable All Variables.

Unset Implicit Arguments.
Set Maximal Implicit Insertion.
Unset Strict Implicit.
Unset Printing Implicit Defensive.

Require Coq.Program.Tactics.
Require Coq.Program.Wf.

(* Preamble *)


(* No imports to convert. *)

(* Converted type declarations: *)
Set Universe Polymorphism.

Polymorphic Inductive Task (c : (Type -> Type) -> Type) (k : Type) (v : Type) : Type :=
| Mk_Task (run : forall {f}, forall `{c f}, (k -> f v) -> f v) : Task c k v.

Polymorphic Definition Tasks c k v :=
(k -> option (Task c k v))%type.


Arguments Mk_Task {_} {_} {_} _.

Definition run {c : (Type -> Type) -> Type} {k : Type} {v : Type} (arg_0__
: Task c k v) :=
let 'Mk_Task run := arg_0__ in
run.

(* No value declarations to convert. *)

(* Skipping definition `Build.Task.compose' *)

(* Skipping definition `Build.Task.liftTask' *)

(* Skipping definition `Build.Task.liftTasks' *)

(* External variables:
Type option
*)


Definition pidentity {A : Type} (a : A) := a.

Check pidentity.
Unset Universe Polymorphism.

0 comments on commit 79d84d8

Please sign in to comment.