# 4.08 let bindings let\*, let+ giving errors with ppx\_jane

**URL:** https://discuss.ocaml.org/t/4-08-let-bindings-let-let-giving-errors-with-ppx-jane/4580
**Category:** Community
**Created:** [October 25, 2019, 12:08am UTC](https://discuss.ocaml.org/t/4-08-let-bindings-let-let-giving-errors-with-ppx-jane/4580 "2019-10-25T00:08:21Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![BikalGurung](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/bikalgurung/32/5105_2.png) [@BikalGurung](https://discuss.ocaml.org/u/BikalGurung)
#### Post date: [October 25, 2019, 12:08am UTC](https://discuss.ocaml.org/t/4-08-let-bindings-let-let-giving-errors-with-ppx-jane/4580/1 "2019-10-25T00:08:21Z")

</div>

I am using ocaml 4.08.1 and trying to use the new let bindings `let*` and `let+` along with `ppx_jane` and `core_kernel`. I have defined `Result` monad as such

```auto
module Result = struct
  include Result

  let ( let+ ) = ( >>| )

  let ( let* ) = ( >>= )

  let ( and+ ) = Let_syntax.Let_syntax.both
end

```

My dune file

```auto
(library
 (name test)
 (flags
  (:standard
   (-open Core_kernel)
   (-w -37)
   (-w -32)))
 (libraries core_kernel lwt lwt.unix core_kernel.binary_packing)
 (preprocess
  (pps ppx_jane)))

```

However, when I try to use let bindings like below I am getting a compilation error.

```auto
let open Result in 
let* res = get_result () in 
...

```

Error:

```auto
Raised at file "src/migrate_parsetree_408_407_migrate.ml", line 7, characters 2-49
Called from file "src/migrate_parsetree_408_407_migrate.ml", line 57, characters 8-40
Called from file "src/migrate_parsetree_408_407_migrate.ml", line 211, characters 9-29
Called from file "src/migrate_parsetree_408_407_migrate.ml", line 57, characters 8-40
Called from file "src/migrate_parsetree_408_407_migrate.ml", line 211, characters 9-29
Called from file "src/migrate_parsetree_408_407_migrate.ml", line 57, characters 8-40
Called from file "src/migrate_parsetree_408_407_migrate.ml", line 84, characters 10-30
Called from file "src/migrate_parsetree_408_407_migrate.ml", line 57, characters 8-40
Called from file "src/migrate_parsetree_408_407_migrate.ml", line 253, characters 8-34
Called from file "list.ml", line 92, characters 20-23

```

Using without `ppx_jane` seems to work. Is there a workaround to this? I am using the latest version of `ppx_jane` - v0.12.0.

---

<div class="post-metadata">

### Author: ![Levi\_Roth](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/levi_roth/32/2268_2.png) [@Levi\_Roth](https://discuss.ocaml.org/u/Levi_Roth)
#### Post date: [October 25, 2019, 12:19am UTC](https://discuss.ocaml.org/t/4-08-let-bindings-let-let-giving-errors-with-ppx-jane/4580/2 "2019-10-25T00:19:17Z")

</div>

I believe this happens because the 0.12 version of `ppx_jane` is only up to date through OCaml 4.07, so it isn’t able to read syntax trees that contain new constructs from 4.08.

One workaround is to use the development version of `ppx_jane`, for example by adding the [“janestreet-bleeding” opam repo](https://github.com/janestreet/opam-repository).

Of course, you can also get basically the same behavior as the new binding operators by using the `ppx_let` part of `ppx_jane`, but that might not be compatible with what you’re trying to do.

---

<div class="post-metadata">

### Author: ![BikalGurung](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/bikalgurung/32/5105_2.png) [@BikalGurung](https://discuss.ocaml.org/u/BikalGurung)
#### Post date: [October 25, 2019, 12:33am UTC](https://discuss.ocaml.org/t/4-08-let-bindings-let-let-giving-errors-with-ppx-jane/4580/3 "2019-10-25T00:33:45Z")

</div>

Just tried to use the ppx\_jane dev branch. However, the build was not successful since ppxlib does not support 4.08. ☹

---

<div class="post-metadata">

### Author: ![xclerc](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/xclerc/32/504_2.png) [@xclerc](https://discuss.ocaml.org/u/xclerc)
#### Post date: [October 25, 2019, 11:22am UTC](https://discuss.ocaml.org/t/4-08-let-bindings-let-let-giving-errors-with-ppx-jane/4580/4 "2019-10-25T11:22:46Z")

</div>

I think @Levi_Roth’s analysis is spot on. Jane Street ppxes  
ultimately rely on ppxlib, whose version for v0.12 selects the  
4.07 AST.

It is also true that the bleeding edge repository does use a  
ppxlib version whose AST is 4.08, thus fixing the issue.

The only useful thing I can add is that we are currently in  
the early stages of v0.13 (which will be based on what is  
currently in the bleeding edge repository). The upcoming  
version is expected to be fully compatible with 4.08 and 4.09.

---

<div class="post-metadata">

### Author: ![xclerc](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/xclerc/32/504_2.png) [@xclerc](https://discuss.ocaml.org/u/xclerc)
#### Post date: [October 25, 2019, 11:24am UTC](https://discuss.ocaml.org/t/4-08-let-bindings-let-let-giving-errors-with-ppx-jane/4580/5 "2019-10-25T11:24:39Z")

</div>

I do think ppxlib is compatible with 4.08. There is probably  
something weird with your constraints, or your opam metadata  
is out of date.

Please also notice that we do not support mixing released  
versions and bleeding edge versions.

---

<div class="post-metadata">

### Author: ![BikalGurung](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/bikalgurung/32/5105_2.png) [@BikalGurung](https://discuss.ocaml.org/u/BikalGurung)
#### Post date: [October 25, 2019, 12:54pm UTC](https://discuss.ocaml.org/t/4-08-let-bindings-let-let-giving-errors-with-ppx-jane/4580/6 "2019-10-25T12:54:50Z")

</div>

Ah, okay. Maybe that’s why. Thanks. Any expected timeline for v0.13.0 release?

---

<div class="post-metadata">

### Author: ![xclerc](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/xclerc/32/504_2.png) [@xclerc](https://discuss.ocaml.org/u/xclerc)
#### Post date: [October 25, 2019, 4:31pm UTC](https://discuss.ocaml.org/t/4-08-let-bindings-let-let-giving-errors-with-ppx-jane/4580/7 "2019-10-25T16:31:13Z")

</div>

(I will start the process next week, but it can take several  
weeks before the packages are actually available in opam.)
