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
vicfred has quit [Quit: Leaving]
Tuplanolla has quit [Quit: Leaving.]
rock64 has quit [Ping timeout: 260 seconds]
rock64 has joined #ocaml
borne has quit [Ping timeout: 240 seconds]
spew has quit [Quit: Connection closed for inactivity]
<cemerick> is there not an in-place deriver like `[%show int * int]` that produces a pp fun instead of a `t -> string` fun?
<cemerick> I could have sworn there was, but it seems I'm wrong
<companion_cube> [%pp maybe?
<cemerick> nope, no dice
<cemerick> s/show/show:
rwmjones has quit [Ping timeout: 240 seconds]
amiloradovsky has quit [Ping timeout: 240 seconds]
vicfred has joined #ocaml
ransom has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ransom has joined #ocaml
laokz has joined #ocaml
shmibs has quit [Quit: leaving =o]
shmibs has joined #ocaml
cloveistaken has quit [Ping timeout: 272 seconds]
jbrown has quit [Ping timeout: 272 seconds]
jbrown has joined #ocaml
ransom has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ransom has joined #ocaml
_whitelogger has joined #ocaml
ransom has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
reynir has quit [Ping timeout: 240 seconds]
reynir has joined #ocaml
laokz has quit [Quit: Leaving]
ransom has joined #ocaml
shmibs has quit [Quit: leaving =o]
shmibs has joined #ocaml
inkbottle has joined #ocaml
zebrag has quit [Ping timeout: 256 seconds]
proletkultura has joined #ocaml
ransom has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
narimiran has joined #ocaml
proletkultura has quit [Ping timeout: 260 seconds]
retropikzel has joined #ocaml
waleee-cl has quit [Quit: Connection closed for inactivity]
Serpent7776 has joined #ocaml
retropikzel has left #ocaml ["Leaving"]
ggole has joined #ocaml
sspi__ has quit [*.net *.split]
angerman has quit [*.net *.split]
peddie has quit [*.net *.split]
flux has quit [*.net *.split]
Manis[m]11 has quit [*.net *.split]
talyian[m] has quit [*.net *.split]
chripell has quit [Quit: ZNC 1.8.1+deb1+build1 - https://znc.in]
decentpenguin has quit [Read error: Connection reset by peer]
decentpenguin has joined #ocaml
chripell has joined #ocaml
Haudegen has joined #ocaml
borne has joined #ocaml
bartholin has quit [Quit: Leaving]
borne has quit [Client Quit]
borne has joined #ocaml
kandu has quit [Remote host closed the connection]
snowpanda has quit [Quit: Leaving...]
rwmjones has joined #ocaml
borne has quit [Quit: WeeChat 2.9]
borne has joined #ocaml
rwmjones has quit [Ping timeout: 246 seconds]
rwmjones has joined #ocaml
Tuplanolla has joined #ocaml
proletkultura has joined #ocaml
mmohammadi9812 has joined #ocaml
hnOsmium0001 has quit [Quit: Connection closed for inactivity]
sspi__ has joined #ocaml
angerman has joined #ocaml
flux has joined #ocaml
peddie has joined #ocaml
talyian[m] has joined #ocaml
Manis[m]11 has joined #ocaml
proletkultura has quit [Ping timeout: 265 seconds]
dhil has joined #ocaml
dckc has quit [Ping timeout: 258 seconds]
olle has joined #ocaml
dckc has joined #ocaml
osa1 has joined #ocaml
sspi__ has quit [*.net *.split]
angerman has quit [*.net *.split]
peddie has quit [*.net *.split]
flux has quit [*.net *.split]
talyian[m] has quit [*.net *.split]
Manis[m]11 has quit [*.net *.split]
mmohammadi9812 has quit [Ping timeout: 256 seconds]
talyian[m] has joined #ocaml
peddie has joined #ocaml
sspi__ has joined #ocaml
flux has joined #ocaml
angerman has joined #ocaml
Manis[m]11 has joined #ocaml
mmohammadi9812 has joined #ocaml
dhil has quit [Ping timeout: 272 seconds]
kandu has joined #ocaml
dhil has joined #ocaml
mmohammadi9812 has quit [Quit: I quit (╯°□°)╯︵ ┻━┻]
proletkultura has joined #ocaml
olle has quit [Ping timeout: 240 seconds]
osa1 has quit [Remote host closed the connection]
osa1 has joined #ocaml
zozozo has quit [Quit: WeeChat 2.9]
zozozo has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
nullcone has quit [Quit: Connection closed for inactivity]
laokz has joined #ocaml
proletkultura has quit [Ping timeout: 260 seconds]
mbuf has joined #ocaml
def has quit [Remote host closed the connection]
proletkultura has joined #ocaml
motherfsck has joined #ocaml
Yagotzirck has joined #ocaml
proletkultura has quit [Ping timeout: 265 seconds]
dhil has quit [Ping timeout: 260 seconds]
Yagotzirck has quit [Quit: Leaving]
Haudegen has joined #ocaml
FreeBirdLjj has joined #ocaml
proletkultura has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 240 seconds]
waleee-cl has joined #ocaml
mbuf has quit [Remote host closed the connection]
mbuf has joined #ocaml
ransom has joined #ocaml
proletkultura has quit [Ping timeout: 258 seconds]
reynir has quit [Ping timeout: 260 seconds]
reynir has joined #ocaml
dhil has joined #ocaml
dckc has quit [Ping timeout: 260 seconds]
dckc has joined #ocaml
mbuf has quit [Quit: Leaving]
zebrag has joined #ocaml
inkbottle has quit [Ping timeout: 260 seconds]
laokz has quit [Quit: Leaving]
def has joined #ocaml
tane has joined #ocaml
superherointj has joined #ocaml
<superherointj> Hi. By any chance is anyone using OCaml with Nix/NixOS here? I need help to figure out why dune can't find a package (cmdliner in example). The package is in path. So I wonder why it is not working. https://github.com/superherointj/ocaml-nix-demo1
<superherointj> I've been thinking: buildInputs might not be path.
<dash> superherointj: you're putting a list inside a list
<superherointj> Thanks!
<dash> you have `with pkgs; [ ocaml dune_2 (with ocamlPackages; [ cmdliner ] ) ]`
<superherointj> Got it! Will test.
<dash> try either `with pkgs; [ ocaml dune_2 ocamlPackages.cmdliner ]` or with pkgs; [ ocaml dune_2 ] ++ (with ocamlPackages; [ cmdliner ] )`
<dash> * try either `with pkgs; [ ocaml dune_2 ocamlPackages.cmdliner ]` or `with pkgs; [ ocaml dune_2 ] ++ (with ocamlPackages; [ cmdliner ] )`
hnOsmium0001 has joined #ocaml
<superherointj> Tried it [no nested list]. Same error.
borne has quit [Ping timeout: 272 seconds]
<dash> ok yeah i didn't read closely, it's in buildInputs so you don't have a nix problem
<dash> you just need to make dune see it
<superherointj> Should I be using nix to build the application and then nix calling dune instead of me calling dune on commandline (for test)?
zebrag has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
mmohammadi9812 has joined #ocaml
spew has joined #ocaml
<superherointj> It seems I should have used 'inputsFrom' instead of 'buildInputs'.
<superherointj> [Or in addition to.]
borne has joined #ocaml
Anarchos has joined #ocaml
nullcone has joined #ocaml
snowpanda has joined #ocaml
borne has quit [Ping timeout: 272 seconds]
vicfred has quit [Quit: Leaving]
vicfred has joined #ocaml
sspi__ has quit [*.net *.split]
angerman has quit [*.net *.split]
peddie has quit [*.net *.split]
flux has quit [*.net *.split]
Manis[m]11 has quit [*.net *.split]
talyian[m] has quit [*.net *.split]
borne has joined #ocaml
gareppa has joined #ocaml
gareppa has quit [Quit: Leaving]
sm2n has quit [Read error: Connection reset by peer]
sm2n has joined #ocaml
vicfred has quit [Quit: Leaving]
vicfred has joined #ocaml
ggole has quit [Quit: Leaving]
angerman has joined #ocaml
Manis[m]11 has joined #ocaml
peddie has joined #ocaml
flux has joined #ocaml
sspi__ has joined #ocaml
talyian[m] has joined #ocaml
proletkultura has joined #ocaml
RalfJ has quit [Remote host closed the connection]
RalfJ has joined #ocaml
amiloradovsky has joined #ocaml
<d_bot> <beheddard> does anyone here have expertise with JaneStreet Async?
<d_bot> <beheddard> I've got a bit of a weird issue coming up with a bind hanging forever (when *I think* the value should be resolvable right away)
osa1 has quit [Quit: osa1]
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
ransom has quit [Quit: Textual IRC Client: www.textualapp.com]
<d_bot> <craigfe> Fire away with your question, and someone with expertise will come along 🙂
<d_bot> <craigfe> As someone without expertise, I believe the bind in Async has a different notion of "resolvable right away" than you may be used to if you're more used to Lwt.
<d_bot> <craigfe> In particular, a Deferred.t that is a resolved value underneath will still yield to the scheduler for a single cycle, introducing time for a non-cooperative thread to take charge and stop your value from resolving
<d_bot> <craigfe> (so if you have other Deferred's going on at the same time, that's something to think about)
<d_bot> <beheddard> after screwing with it some more it seems like it is the `after` which isn't resolving, which works fine in my other uses.
<d_bot> <beheddard> ```
<d_bot> <beheddard> open Core
<d_bot> <beheddard> open Async
<d_bot> <beheddard>
<d_bot> <beheddard> type 'a t = ('a, Pipe.Writer.phantom) Pipe.t
<d_bot> <beheddard>
<d_bot> <beheddard> type 'b inbox = ('b, Pipe.Reader.phantom) Pipe.t
<d_bot> <beheddard>
<d_bot> <beheddard> type 'b answer = State of 'b | Async of 'b Deferred.t | Stop
<d_bot> <beheddard>
<d_bot> <beheddard> let ( >> ) f g x = g (f x)
<d_bot> <beheddard>
<d_bot> <beheddard> let ( >?= ) answer loop =
<d_bot> <beheddard> match answer with
<d_bot> <beheddard> | State s -> loop s
<d_bot> <beheddard> | Async d -> d >>= loop
<d_bot> <beheddard> (* | Async d -> Thread_safe.block_on_async_exn (fun () -> d) |> loop *)
<d_bot> <beheddard> | Stop -> return ()
<d_bot> <beheddard>
<d_bot> <beheddard> let create ?(size=100) ~init body : 'a t =
<d_bot> <beheddard> let (inbox, mailslot) = Pipe.create () in
<d_bot> <beheddard> let () = Pipe.set_size_budget inbox size in
<d_bot> <beheddard> let rec msg_loop state =
<d_bot> <beheddard> Pipe.read inbox >>= function
<d_bot> <beheddard> | `Eof -> return ()
<d_bot> <beheddard> | `Ok msg -> body state msg >?= msg_loop in
<d_bot> <beheddard> let () = msg_loop init >>= (fun () -> return (Pipe.close mailslot))
<d_bot> <beheddard> |> don't_wait_for in
<d_bot> <beheddard> mailslot
<d_bot> <beheddard>
<d_bot> <beheddard> let post : 'a t -> 'a -> unit Deferred.t = Pipe.write
<d_bot> <beheddard> ```ocaml
<d_bot> <beheddard> module Test = struct
<d_bot> <beheddard> type msg =
<d_bot> <beheddard> | Add of int
<d_bot> <beheddard> | Show
<d_bot> <beheddard> | BlockUp of float
<d_bot> <beheddard> | BindUp of float
<d_bot> <beheddard> | SlowShow of float
<d_bot> <beheddard> | Fetch of int t
<d_bot> <beheddard> | Stop
<d_bot> <beheddard>
<d_bot> <beheddard> let body state = function
<d_bot> <beheddard> | Add i -> State (state + i)
<d_bot> <beheddard> | Show -> printf "state = %d\n" state; State state
<d_bot> <beheddard> | BlockUp secs -> begin fun () ->
<d_bot> <beheddard> return (print_endline "(block) just a sec...") >>= fun () ->
<d_bot> <beheddard> after (Time.Span.of_sec secs) >>= fun () ->
<d_bot> <beheddard> return state
<d_bot> <beheddard> end |> Thread_safe.block_on_async_exn |> fun s -> State s
<d_bot> <beheddard> | BindUp 0. -> Async begin
<d_bot> <beheddard> think this covers the relevant parts. It's a simple agent abstraction, like mailboxprocessor in F#
<d_bot> <beheddard> The perma-hang happens at the (BindUp 3.0) message, since it hangs execution of the agents msg_loop
<d_bot> <beheddard> The offending Deferred is the `after` since (BindUp 0.0) continues with no issue
dhil has quit [Ping timeout: 246 seconds]
<d_bot> <beheddard> The commented out version of Async answer handling works, as does the BlockUp message, which uses explicit `block_on_async`
narimiran has quit [Ping timeout: 258 seconds]
<d_bot> <beheddard> My suspicion is that the scheduler is just not running the after contained within the BindUp handler at all, but I don't know why that might be
<d_bot> <craigfe> (Please don't edit code-snippets in the #general channel, since the IRC bridge interprets that as a command to DoS the IRC users.)
<d_bot> <beheddard> ah sorry, wasn't aware. I just added the ocaml tag after posting.
<d_bot> <craigfe> np 🙂 it's not a very user-friendly or intuitive behaviour for the IRC bridge
sonologico has joined #ocaml
dhil has joined #ocaml
rig0rmortis has joined #ocaml
mmohammadi9812 has quit [Quit: I quit (╯°□°)╯︵ ┻━┻]
borne has quit [Ping timeout: 260 seconds]
<d_bot> <Bluddy> I've posted an issue on matterbridge's github. editing should not be coming through anymore. I'm not sure why the code blocks aren't recognized as one message and truncated at 400 chars (which should be the default).
borne has joined #ocaml
Serpent7776 has quit [Quit: leaving]
andreas303 has quit [Remote host closed the connection]
andreas303 has joined #ocaml
tane has quit [Quit: Leaving]
rig0rmortis has quit [Quit: beep boop]
jbrown has quit [Ping timeout: 265 seconds]
superherointj has quit [Quit: Leaving]
Tuplanolla has quit [Ping timeout: 240 seconds]
inkbottle has joined #ocaml
zebrag has quit [Ping timeout: 260 seconds]
proletkultura has quit [Ping timeout: 260 seconds]
Tuplanolla has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
sspi__ has quit [*.net *.split]
angerman has quit [*.net *.split]
peddie has quit [*.net *.split]
flux has quit [*.net *.split]
Manis[m]11 has quit [*.net *.split]
talyian[m] has quit [*.net *.split]