adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.09 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.09/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
olle has quit [Ping timeout: 246 seconds]
olle has joined #ocaml
jbrown has quit [Ping timeout: 272 seconds]
CcxWrk has quit [Remote host closed the connection]
CcxWrk has joined #ocaml
<HyperMonkey> if I define mylist is there a way to override the cons operator :: for it?
<pigeonv> yes, you can
<pigeonv> e.g. type mylist = [] | (::) of int * mylist
<Anarchos> or let (::) a l = (a:int) :: (l:mylist)
<HyperMonkey> is there a way to eliminate catch-exit in this? https://paste.ee/p/W2kwe
<HyperMonkey> I guess it's not a disaster if it has catch/exit ... can be simplified out by inlining the catch expressions into the exists ...
pigeonv has quit [Ping timeout: 260 seconds]
pierpa has quit [Remote host closed the connection]
andreas303 has quit [Remote host closed the connection]
andreas303 has joined #ocaml
Jesin has quit [Read error: Connection reset by peer]
Jesin has joined #ocaml
Jesin has quit [Client Quit]
Jesin has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 244 seconds]
mfp has quit [Ping timeout: 272 seconds]
narimiran has joined #ocaml
waleee-cl has quit [Quit: Connection closed for inactivity]
jao- has quit [Read error: Connection reset by peer]
Guest850 has joined #ocaml
mbuf has joined #ocaml
kvda has joined #ocaml
_whitelogger has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kvda has joined #ocaml
Jesin has quit [Ping timeout: 246 seconds]
Guest850 has quit [Ping timeout: 265 seconds]
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
<def> HyperMonkey: why would you do that?
<def> catch/exit has no runtime cost
sleepydog has quit [Ping timeout: 256 seconds]
haesbaert has joined #ocaml
cbarrett has quit [Ping timeout: 252 seconds]
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kvda has joined #ocaml
cbarrett has joined #ocaml
ferd has quit [Ping timeout: 265 seconds]
Haudegen has joined #ocaml
ferd has joined #ocaml
ferd has quit [Ping timeout: 240 seconds]
Jesin has joined #ocaml
kvda has quit [Ping timeout: 265 seconds]
kvda has joined #ocaml
jbrown has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
waleee-cl has joined #ocaml
Anarchos has joined #ocaml
ollehar_ has joined #ocaml
olle_ has joined #ocaml
ferd has joined #ocaml
kvda has joined #ocaml
kvda has quit [Client Quit]
amiloradovsky has joined #ocaml
<olle_> Affe = "This language aims to prevent linearity violations, notably bugs such as use-after-free. Affe is an ML-like language similar to OCaml. In particular, Affe is functional with arbitrary side effects and complete type inference (i.e., users never need to write type annotations). "
<olle_> (please don't kill me, drup)
<olle_> (still want to post that on reddit)
<olle_> (so cool...)
<Anarchos> olle_ ocaml with linear logic typing system ?
kvda has joined #ocaml
<olle_> Anarchos: yes, something like this
<olle_> Anarchos: you can find presentation and paper online if you search for "kindly bent to free us ocaml"
HyperMonkey has quit [Ping timeout: 245 seconds]
<olle_> How can linear types ensure that a file handler is closed?
<olle_> at the end of the program
mfp has joined #ocaml
higherorder has joined #ocaml
<higherorder> Hello! I started learning Ocaml this week-end and I have a question about polymorphic variants. In the spirit of row types, I am wondering if it's possible to write a function which eliminates a certain tag from a variant. e.g a function which would have a (fantasy) type signature like [`A | `B | rest] -> [`B | rest]
<higherorder> The context in which I'd like to write such a function is when writing a partial interpreter over an AST, which would interpret some (but not all) nodes
<octachron> Only if rest is a closed row type.
<flux1> olle_: I think by removing the ability to just forget a binding, you must feed it to some function to remove it from scope
<olle_> aha
<olle_> hm
<olle_> flux1: like a close_file function?
<olle_> oh yes, the difference between "use exactly once" and "use at least once"
<flux1> yes
<olle_> or "at most"
<olle_> 11:59 < flux1> yes
<olle_> hm
<flux1> or a function that calls close_file, etc
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<olle_> flux1: right
<flux1> I guess the tricky part are like: what if you return a closure that closes the file ;).
<olle_> yeah
<olle_> phew
<olle_> whatever function that uses that closure must reflect it in its type, i guess
<olle_> or that outside that closure, there's no guarantee that the file is still open
<olle_> so you give away ownership permanently
kvda has joined #ocaml
dborisog has joined #ocaml
pigeonv has joined #ocaml
Jesin has quit [Ping timeout: 246 seconds]
<higherorder> octachron: how so?
<octachron> For instance, "type t = [`B | `C ] let f = function `A -> `B | #t as x -> x" works as expected
<higherorder> oops sorry for the weird snippet
<higherorder> (in ReasonML syntax). I think it's the same as your function but it doesn't infer the same type
amiloradovsky1 has joined #ocaml
amiloradovsky has quit [Ping timeout: 252 seconds]
amiloradovsky1 is now known as amiloradovsky
<higherorder> ah nevermind; got it to work; thanks!
<octachron> The ` *list of constructors* as x` part is indeed important to decouple the input and output type.
<higherorder> what is the name of that construct? (#t). It's the first time I see it
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
waleee-cl has quit [Quit: Connection closed for inactivity]
<higherorder> thanks!
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
amiloradovsky has quit [Remote host closed the connection]
amiloradovsky has joined #ocaml
Haudegen has quit [Ping timeout: 260 seconds]
tane has joined #ocaml
Jesin has joined #ocaml
raver has joined #ocaml
ferd has joined #ocaml
jao has joined #ocaml
waleee-cl has joined #ocaml
ferd has quit [Ping timeout: 265 seconds]
ferd has joined #ocaml
tautologico has joined #ocaml
sleepydog has joined #ocaml
Jesin has quit [Ping timeout: 272 seconds]
clement_ has joined #ocaml
<clement_> Hi all. I'm porting an OCaml project that includes code generated using Coq to OCaml 4.09 (we originally targeted 4.07). Coq-generated code uses Pervasives everywhere, so I'm seeing plenty of deprecation alerts on 4.09. stdlib-shims doesn't help (I don't have control on what Coq generates) so I thought I'd silence the alerts while waiting for Coq to update. But what's the right way to disable the alerts? Adding (flags
<clement_> (:standard -alert -deprecated)) to my dune file works with 4.09, but it breaks the build in 4.07, and I don't think dune has conditional flags support. How should I deal with this? Thanks!
<companion_cube> maybe you could alias `module Pervasives = Stdlib` somewhere?
<Armael> that’ll break pre-stdlib
<companion_cube> not with stdlib-shims
Haudegen has joined #ocaml
<octachron> clement_, you can disable the alert through the (deprecated) deprecation warning "-w -3" rather than the alert mechanism
<companion_cube> (also, yessss)
<clement_> companion_cube: I don't know a good way to prepend text to Coq's generated ML code, but maybe with a careful grep? Or maybe with a copiler option to open a module that contains a fake Pervasives…
<clement_> octachron: Yes, perfect! That works nicely
<sleepydog> is there a Coq issue open to move to Stdlib ?
<clement_> sleepydog: https://github.com/coq/coq/issues/11359 maybe?
<companion_cube> yeah, `-open MyPrelude` or something
<clement_> In a similar vein, how do I tell OPAM that I need coq-ltac2 only if coq is < 8.11? I currently have "coq" {>= "8.9"} and "coq-ltac2" {>= "0.3"}, but coq-ltac2 is incompatible with 8.11 because it comes bundled with it.
<companion_cube> I guess one of these packages should declare the incompatibility
<clement_> It does: coq-ltac2 says it's not compatible with coq >= 8.11
<clement_> But as a result if I make it a dependency I can't target 8.11
<Armael> maybe coq-ltac2 should default to a dummy package if it detects coq >= 8.11
<Armael> or you have a different implementation of the opam package, one for <8.11 and one for >=8.11
<companion_cube> ^
<Armael> I think it’s how it works for the shim packages
<Armael> e.g. maybe look at the opam package for uchar
chripell has joined #ocaml
chripell_ has joined #ocaml
chripell has quit [Ping timeout: 264 seconds]
chripell__ has joined #ocaml
chripell_ has quit [Ping timeout: 264 seconds]
clockish has joined #ocaml
Jesin has joined #ocaml
pigeonv has joined #ocaml
narimiran has joined #ocaml
muskan has joined #ocaml
<clement_> Armael: Thanks, I will look :)
nullifidian_ has joined #ocaml
<olle> ocsigen mentiones comet but not websockets_
<olle> _?
<olle> comet should probably be considered deprecated
<olle> who's maintinaing this?????
TC01 has joined #ocaml
nullifidian__ has joined #ocaml
nullifidian_ has quit [Ping timeout: 240 seconds]
sleepydog has quit [Ping timeout: 260 seconds]
<olle> Reason it is... grrr
<waleee-cl> olle: are you looking for strictly frontend-stuff?
<waleee-cl> if so, have you seen incr_dom?
<olle> waleee-cl: nah, i want to do both be and fe in ocaml with websockets
<olle> seems like there's no such thing right now
<olle> checking out reasonml + react right now
<waleee-cl> incr_dom is ocaml
<olle> waleee-cl: server or client?
<waleee-cl> client, js_of_ocaml
<olle> ah
<olle> not enough, need server too
<waleee-cl> yeah, that side has gone a bit stale unfortunately
<olle> pity
<olle> well, found a good blog post from last year, gonna give it a try :)
muskan has quit [Ping timeout: 245 seconds]
narimiran has quit [Ping timeout: 256 seconds]
<olle> yes, I've done websocket with lwt before, years ago, but I want a ready-to-go framework for both server and client in one package
<olle> waleee-cl: thanks for tring xD
<olle> wait
<olle> yeah, i read that thread - no standard way in ocsigen, what i can find
Jesin has quit [Quit: Leaving]
Hrundi_V_Bakshi has joined #ocaml
<olle> seems like it transpiles ocaml to js on server side and client side
<olle> s/ocaml/reasonml
Jesin has joined #ocaml
nullifidian_ has joined #ocaml
Hrundi_V_Bakshi has quit [Ping timeout: 258 seconds]
nullifidian__ has quit [Ping timeout: 256 seconds]
yomimono_ has joined #ocaml
kvda has joined #ocaml
jao has quit [Ping timeout: 265 seconds]
Haudegen has quit [Ping timeout: 240 seconds]
jao has joined #ocaml
sleepydog has joined #ocaml
yomimono_ has quit [Quit: Lost terminal]
HyperMonkey has joined #ocaml