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: 265 seconds]
olle has joined #ocaml
vicfred has quit [Quit: Leaving]
mfp has quit [Ping timeout: 256 seconds]
sleepydog has quit [Ping timeout: 260 seconds]
sleepydog has joined #ocaml
zmt01 has quit [Quit: Leaving]
zmt00 has joined #ocaml
pigeonv has quit [Ping timeout: 272 seconds]
<HyperMonkey> what does "if x" mean in lambda form? what happens if x is an integer is it like C where anything but zero is true? and what happens if x is a block, which tags are true vs false?
<companion_cube> wait, is there a if on blocks in lambda?!
mbuf has joined #ocaml
<HyperMonkey> indeed, it does "if" on list type (which is block in the cons case)
<HyperMonkey> I just compiled a bone-basic myrev function
zq has joined #ocaml
<zq> hi, is this the right place to find help for opam?
<zq> having trouble opam install ulex
waleee-cl has quit [Quit: Connection closed for inactivity]
dborisog_ has joined #ocaml
TakinOver has quit [Remote host closed the connection]
HyperMonkey has quit [Remote host closed the connection]
zebrag has quit [Quit: Konversation terminated!]
jao- has quit [Ping timeout: 272 seconds]
zebrag has joined #ocaml
zebrag has quit [Client Quit]
vicfred has joined #ocaml
webshinra has quit [Remote host closed the connection]
webshinra has joined #ocaml
mbuf has quit [Quit: Leaving]
amiloradovsky has quit [Ping timeout: 260 seconds]
mbuf has joined #ocaml
sleepydog has quit [Ping timeout: 260 seconds]
dckc has quit [Ping timeout: 264 seconds]
dckc has joined #ocaml
Anarchos has joined #ocaml
mbuf has quit [Quit: Leaving]
mfp has joined #ocaml
mbuf has joined #ocaml
jnavila has joined #ocaml
pigeonv has joined #ocaml
Anarchos has quit [Quit: long live haiku !]
HyperMonkey has joined #ocaml
<HyperMonkey> I'm somewhat surprised that lambda form does not optimize myapply f a = ((fun x -> f x) a);; ... the lambda form still contains the extra function ...
<HyperMonkey> I guess inlining is done further in the pipeline
<HyperMonkey> as far as I can make out lambda form "if" evaluates to true for all blocks/tags so only int 0 is false .. please correct me if this is wrong assumption
FreeBirdLjj has joined #ocaml
pigeonv has quit [Ping timeout: 272 seconds]
nil has joined #ocaml
jao has joined #ocaml
X-Scale` has joined #ocaml
X-Scale has quit [Ping timeout: 264 seconds]
X-Scale` is now known as X-Scale
nil has left #ocaml ["Fairfarren."]
X-Scale has quit [Ping timeout: 246 seconds]
X-Scale` has joined #ocaml
X-Scale` is now known as X-Scale
waleee-cl has joined #ocaml
<companion_cube> lambda doesn't optimize much
<companion_cube> flambda is better
<HyperMonkey> there doesn't seem to be a `-dflambda` though :/
<companion_cube> I think there is one, on ocamlopt, if you use a flambda switch
<HyperMonkey> ah indeed. that's interesting
<HyperMonkey> and indeed it optimizes (inlines) that unneeded abstraction
jnavila has quit [Quit: Konversation terminated!]
jnavila has joined #ocaml
kvda has joined #ocaml
drbb has joined #ocaml
drbb has quit [Client Quit]
kvda has quit [Ping timeout: 240 seconds]
zebrag has joined #ocaml
<flux1> what's the easiest way (so opam module) to make an ocaml REST endpoint?
<flux1> I guess it's down to cohttp and webmachine?
<HyperMonkey> why REST? I'd just make a single POST endpoint that accepts an input json and produces an output json and use atdgen
amiloradovsky has joined #ocaml
peterbb has joined #ocaml
<HyperMonkey> what if I have two cases in a match that have the same implementation? can I common them somehow?
<HyperMonkey> let's assume that they are adjacent for starters ...
<flux1> HyperMonkey: well, usually you can just do | match1 | match2 | .. -> result
<HyperMonkey> ah nice
<flux1> but I believe those share the same guard clause
<flux1> so if that is a limitation too big, you can define a function before the match
<HyperMonkey> guard clause?
<flux1> match 42 with x when x < 16 -> ..
<HyperMonkey> ah I'm not using when, so all is good on that front
<flux1> yep
<flux1> yeah I think single POST endpoint is all I need and the cohttp implementation doing that is succinct enough
<HyperMonkey> but emacs tuareg mode doesn't line up the pipe characters | properly when there are multiple matches to one impl
<HyperMonkey> I guess I can place them on one (long) line
<flux1> do you use ocp-format, btw?
<flux1> oops ocp-indent
sleepydog has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
<flux1> I seem to recall those would be lined up
<flux1> ..even with tuareg-mode, though
zebrag has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
<HyperMonkey> apparently it's intentional and one must `(setq tuareg-match-patterns-aligned t)` to get that
<waleee-cl> HyperMonkey: thanks, was a bit annoyed at that yesterday
dborisog_ has quit [Ping timeout: 265 seconds]
schlaftier_ has joined #ocaml
schlaftier has quit [Quit: Bye!]
schlaftier_ is now known as schlaftier
schlaftier has quit [Quit: The Lounge - https://thelounge.chat]
schlaftier_ has joined #ocaml
schlaftier_ is now known as schlaftier
<flux1> I wonder if it is the case that there is no PostgreSQL binding for OCaml that support both Lwt and TLS?
pigeonv has joined #ocaml
mbuf has quit [Quit: Leaving]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 260 seconds]
Haudegen has joined #ocaml
<flux1> hmm, sedlex is nice. is there as nice parser generator? so, a ppx extension?
<flux1> sedlex would be sufficient for me if it was possible to capture parts.. wasn't there some thing you could just do match xx with (Star ('a'..'z')) as capture_name .. -> and that would work?
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 260 seconds]
<flux1> and angstrom doesn't have unicode support in the level of being able to express "any alphabet", I guess sedlex it is even if it is tiresome to write :/
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 256 seconds]
inkbottle has joined #ocaml
zebrag has quit [Ping timeout: 256 seconds]
jnavila has quit [Quit: Konversation terminated!]
bitwinery has joined #ocaml
bitwinery has quit [Remote host closed the connection]
bitwinery has joined #ocaml
bitwinery has quit [Remote host closed the connection]
sleepydog has quit [Ping timeout: 260 seconds]
sz0 has quit [Quit: Connection closed for inactivity]
vicfred has quit [Quit: Leaving]
foocraft has joined #ocaml
foocraft has quit [Client Quit]
<HyperMonkey> I'm trying to debug a program by printing s-expressions. They look pretty inscrutable though ... is there anything line a pretty printer for s-expressions?
<HyperMonkey> like*
<companion_cube> all the S-expr libs will give you a `Format.formatter` printer
<HyperMonkey> hm, is there like an example I can copy pasta?
<HyperMonkey> it looks like the function is called pp_hum
<companion_cube> yep
<companion_cube> in sexplib, at least
vicfred has joined #ocaml
niklasl has joined #ocaml
sleepydog has joined #ocaml
kvda has joined #ocaml
HyperMonkey has quit [Remote host closed the connection]
HyperMonkey has joined #ocaml
<HyperMonkey> well, the only example I could find was `Format.eprintf "%a" Sexp.pp_hum sexp` .. but it printed the first line OK but subsequent lines at a large indent of like 40 coiumns
<HyperMonkey> hm if I comment out a previous dump (of something not an s-expression) then the s-expression dumps fine in isolation
<HyperMonkey> are there some settings that persist from dump to dump somehow?
<HyperMonkey> I don't have much experience with I/O in ocaml ...
<HyperMonkey> ah it sufficed to reset the pretty printer with `@.`