companion_cube changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.11 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.11/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
copy has joined #ocaml
mxns has quit [Ping timeout: 240 seconds]
wonko7 has joined #ocaml
mxns has joined #ocaml
amiloradovsky has quit [Remote host closed the connection]
amiloradovsky has joined #ocaml
mxns has quit [Ping timeout: 258 seconds]
<d_bot> <inkbottle> @EduardoRFS
<d_bot> <inkbottle> It seems your question has already been answered there:
<d_bot> <inkbottle> and you need a "variant wrapper".
<d_bot> <inkbottle> They also explain what the syntax `'a. 'a a` is not the correct one in that situation.
<d_bot> <inkbottle> ```ocaml
<d_bot> <inkbottle> type a = int
<d_bot> <inkbottle> type b = bool
<d_bot> <inkbottle>
<d_bot> <inkbottle> type _ gadt =
<d_bot> <inkbottle> | A : a -> a gadt
<d_bot> <inkbottle> | B : b -> b gadt
<d_bot> <inkbottle>
<d_bot> <inkbottle> type wrapped = Wrap : 'a gadt -> wrapped (*[@@unboxed]*)
<d_bot> <inkbottle>
<d_bot> <inkbottle> type record = { field : wrapped }
<d_bot> <inkbottle> type record_list = record list
<d_bot> <inkbottle>
<d_bot> <inkbottle> let r = [ { field = Wrap (A 3) };
<d_bot> <inkbottle> { field = Wrap (B true) };
<d_bot> <inkbottle> { field = Wrap (A 2) } ]
<d_bot> <inkbottle> ```
Tuplanolla has quit [Ping timeout: 246 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 260 seconds]
wonko7 has quit [Ping timeout: 240 seconds]
Yagotzirck has quit [Quit: Leaving]
mxns has joined #ocaml
ArthurStrong has left #ocaml [#ocaml]
borne has quit [Ping timeout: 272 seconds]
madroach has joined #ocaml
madroach_ has quit [Ping timeout: 256 seconds]
vikfret has joined #ocaml
mfp has quit [Ping timeout: 256 seconds]
amiloradovsky has quit [Remote host closed the connection]
mxns has quit [Ping timeout: 256 seconds]
narimiran has joined #ocaml
zv has quit [Ping timeout: 265 seconds]
jlr has joined #ocaml
jlr has quit [Read error: Connection reset by peer]
jlr has joined #ocaml
jlr has quit [Ping timeout: 246 seconds]
jlr has joined #ocaml
Haudegen has joined #ocaml
Tuplanolla has joined #ocaml
Johann has quit [Ping timeout: 265 seconds]
artart78 has quit [Ping timeout: 265 seconds]
bartholin has joined #ocaml
artart78 has joined #ocaml
Johann has joined #ocaml
wonko7 has joined #ocaml
TheLemonMan has joined #ocaml
neiluj has joined #ocaml
wonko7 has quit [Quit: See You Space Cowboy..]
mengu has joined #ocaml
hnOsmium0001 has quit [Quit: Connection closed for inactivity]
<d_bot> <dinosaure> `hmap` does exactly that, a kind of dynamic typing in OCaml
mfp has joined #ocaml
artymort has quit [Ping timeout: 240 seconds]
<d_bot> <Lupus> is it possible to do dynamic linking for OCaml projects? like I have a library and I want to update it and do not rebuild my executable, but just put .so file or something like that?
<zozozo> there's Dynlink
artymort has joined #ocaml
borne has joined #ocaml
<oni-on-ion> Dynlink module
<oni-on-ion> ah
borne has quit [Ping timeout: 260 seconds]
olle has joined #ocaml
<olle> Merry Christmas everybody! :)
mengu has quit [Ping timeout: 256 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 265 seconds]
borne has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
<d_bot> <Lupus> cool, I'll look into that!
<d_bot> <Lupus> thanks
Anarchos has joined #ocaml
nicoo has quit [Quit: WeeChat 1.7.1]
nicoo has joined #ocaml
Haudegen has joined #ocaml
tvn948 has joined #ocaml
tvn948 has quit [Client Quit]
gautier94 has joined #ocaml
<gautier94> Hello
<gautier94> I'm having troubles compiling a program on windows with the Graphics library
borne has quit [Ping timeout: 272 seconds]
undu[m] has joined #ocaml
narimiran has quit [Ping timeout: 268 seconds]
narimiran_ has joined #ocaml
borne has joined #ocaml
vikfret has quit [Read error: Connection reset by peer]
Anarchos has quit [Ping timeout: 272 seconds]
Haudegen has quit [Quit: Bin weg.]
olle has quit [Ping timeout: 260 seconds]
borne has quit [Ping timeout: 272 seconds]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
jsoo has quit [Quit: ZNC 1.8.2 - https://znc.in]
jsoo has joined #ocaml
Haudegen has joined #ocaml
jlr has quit [Ping timeout: 272 seconds]
<d_bot> <EduardoRFS> @Lupus you can also use the bytecode .bc file directly, no linking time lost
osa1 has quit [Quit: osa1]
osa1 has joined #ocaml
osa1_ has joined #ocaml
gautier94 has quit [Remote host closed the connection]
<d_bot> <EduardoRFS> @inkbottle thank you so much for the example, yeah I even did something similar recently
hnOsmium0001 has joined #ocaml
ArthurStrong has joined #ocaml
<d_bot> <garf> is there a reason that ocamlopt sometimes just gives "syntax error" as an error message with no other context?
<d_bot> <octachron> OCaml parser is generated by menhir.
<d_bot> <octachron> Good syntax error messages is not so straightforward with generated parser. You can end up with situation where the parser just know that the parsing has failed, and don't know why a human user would make such an error.
<d_bot> <octachron> Moreover, OCaml doesn't use the advanced error handling mechanism of menhir.
<d_bot> <octachron> Nevertheless, improved syntax errors are currently a work-in-progress.
mxns has joined #ocaml
jsoo has quit [Remote host closed the connection]
<d_bot> <garf> how come the compiler team opted to use menhir over hand rolling a parser?
<companion_cube> because they're computer scientists and they like clean elegant solutions
jsoo has joined #ocaml
<companion_cube> the "syntax error" is more a problem of some corners of the syntax imho (like `let` being both local and toplevel binding)
mxns has quit [Ping timeout: 260 seconds]
Jesin has quit [Quit: Leaving]
<d_bot> <EduardoRFS> Reason parser had some nice updates on the error message problem using menhir, but Reason syntax seems easier to remove ambiguities
Jesin has joined #ocaml
<companion_cube> mostly thanks to {} I think
<zozozo> I have the experience of adding syntyax error messages using menhir (on languages used for automated deduction), and it takes a loooooong time
osa1_ has quit [Quit: osa1_]
<d_bot> <huB!erTi2> I want types and the feel of a Lisp (Scheme). Is this the right language?
<d_bot> <EduardoRFS> {} is really cool
gareppa has joined #ocaml
narimiran_ has quit [Ping timeout: 265 seconds]
Haudegen has quit [Quit: No Ping reply in 180 seconds.]
Haudegen has joined #ocaml
olle has joined #ocaml
<d_bot> <garf> OCaml or another ML language is probably the closest it gets to a strongly typed Lisp. Full program type inference keeps the verbosity down so that often code looks just as expressive as in Lisp.
mxns has joined #ocaml
mxns has quit [Ping timeout: 272 seconds]
amiloradovsky has joined #ocaml
urek has joined #ocaml
urek has quit [Client Quit]
gareppa has quit [Quit: Leaving]
hnOsmium0001 has quit [Quit: Connection closed for inactivity]
<olle> no macro system, no lisp ;)
<olle> every program must be its own DSL
jnavila has joined #ocaml
<oni-on-ion> every letter should be a word that is an acronym for more words
olle has quit [Ping timeout: 240 seconds]
mxns has joined #ocaml
<d_bot> <huB!erTi2> is there an ML with nice macros then?
ArthurStrong has left #ocaml [#ocaml]
Yagotzirck has joined #ocaml
<d_bot> <garf> Is there a better way to bind a value to a name and pattern match on it than just using a let binding and then a pattern match? I have been doing it like this ```ocaml
<d_bot> <garf> let my_list = get_list in
<d_bot> <garf> match my_list with
<d_bot> <garf> | x::xs -> (* Something *)
<d_bot> <garf> | [] -> (* Something *)
<d_bot> <garf> ```
<d_bot> <garf> but something along the lines of ```ocaml
<d_bot> <garf> match let my_list = get_list in
<d_bot> <garf> | x::xs -> (* Something *)
<d_bot> <garf> | [] -> (* Something *)
<d_bot> <garf> ```
<d_bot> <garf> seems more concise
<companion_cube> match get_list with x::xs as mylist -> … | [] -> …
<d_bot> <garf> perfect, thanks for the help
webshinra has quit [Remote host closed the connection]
webshinra has joined #ocaml
mxns has quit [Ping timeout: 272 seconds]
neiluj has quit [Ping timeout: 265 seconds]
jnavila has quit [Ping timeout: 272 seconds]
Haudegen has quit [Quit: No Ping reply in 180 seconds.]
Haudegen has joined #ocaml
mxns has joined #ocaml
mxns has quit [Ping timeout: 240 seconds]
bartholin has quit [Quit: Leaving]
amiloradovsky has quit [Remote host closed the connection]
amiloradovsky has joined #ocaml
Yagotzirck has quit [Quit: Leaving]
mxns has joined #ocaml
mxns has quit [Ping timeout: 240 seconds]