Skip to content

Commit

Permalink
Fix compilation for ExtLib 1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
liyishuai committed Jan 28, 2024
1 parent 2d1d11e commit 693f36a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Decode.v
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Instance JDecode__bool : JDecode bool :=

Definition decode__list {T} `{JDecode T} : JDecode (list T) :=
fun j : json =>
if j is JSON__Array l then sequence $ map decode l
if j is JSON__Array l then @sequence list _ _ _ _ $ map decode l
else inl $ "Not an Array: " ++ to_string j.

Definition decode__option {T} `{JDecode T} : JDecode (option T) :=
Expand Down
3 changes: 2 additions & 1 deletion JSON.v
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ From ExtLib Require Export
List
Traversable
Monad
Option
OptionMonad.
From Coq Require Export
Basics
Expand Down Expand Up @@ -59,7 +60,7 @@ Definition get_bool (k : string) (j : json) : option bool :=

Definition get_list {T} (f : json -> option T) (j : json) : option (list T) :=
if j is JSON__Array l
then sequence (map f l)
then @sequence _ _ option _ _ (map f l)
else None.

Definition get_nth (n : nat) (j : json) : option json :=
Expand Down
1 change: 1 addition & 0 deletions coq-json.opam
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ run-test: [make "-j%{jobs}%" "test"]
install: [make "install"]
depends: [
"coq" { >= "8.14~" }
"coq-ext-lib"
"coq-parsec" { >= "0.1.1" }
"menhir" { >= "20220210" }
"coq-menhirlib" { >= "20220210" }
Expand Down

0 comments on commit 693f36a

Please sign in to comment.