This syntax will be very useful - is there a reason why this does not work? Thank!
module Foo = { let bar: string = "bar" }; let bar = Foo.bar; /* works */ let { bar } = Foo; /* Unbound record field bar */
Try it now!
Closest you can do the following:
module Foo = { let bar = "bar"; let baz = "baz"; }; let (bar, baz) = Foo.(bar, baz);
Unable to destroy module in OCaml / Reason.
Equivalent OCaml Code Generates Syntax Error on Line 3
module Foo = struct let bar: string = "bar" end let bar = Foo.bar let struct bar end = Foo File "", line 3, characters 4-10: Error: Syntax error
If you are fine by entering all the values specified in Foo into the local area, you can use open Foo. https://reasonml.imtqy.com/try.html?reason=LYewJgrgNgpgBAMRCOBeOBvOsAucBGAhgE4BccAzjsQJYB2A5mnAERHEtwC+A3AFAgADjDqJk-AFIUAdFBAMAFOwCUQA
open Foo
module Foo = { let bar: string = "bar" }; open Foo; Js.log(bar)
Foo , include Foo. https://reasonml.imtqy.com/try.html?reason=LYewJgrgNgpgBAMRCOBeOBvOsAucBGAhgE4BccAzjsQJYB2A5mnAERHEtwC+A3AFD0AxlAhh4SEPwBSFAHRQQDABTsAlEA
include Foo
module Foo = { let bar: string = "bar" }; include Foo; Js.log(bar)
Source: https://habr.com/ru/post/1694794/More articles:Will the C compiler actually have an ascii lookup table - cUpgrading to django 1.11 not in many columns - djangoExoPlayer cannot establish connection with camera IP address - androidFind type synonyms in haskell - haskellTcpClient exceptions when calling EndReceive and BeginReceive - c #Uikit error? viewWillAppear is not called when it should be - iosPython splits the full name into two variables with a possibly verbose name - pythonReact Native TypeScript Images and Static Assets - react-nativeHow to create a circular bottom view? - javaIs it good practice to invalidate String in java - javaAll Articles