<seangrove>
Well, it's a nice tool to know about anyway :)
bthom has joined #ocaml
bthom has left #ocaml [#ocaml]
dsheets has joined #ocaml
thomasga has joined #ocaml
dsheets has quit [Remote host closed the connection]
dsheets has joined #ocaml
xyh-hermit is now known as vishnu
vishnu is now known as Guest68824
Guest68824 is now known as Guest10086
Kakadu has joined #ocaml
thomasga has quit [Quit: Leaving.]
thomasga has joined #ocaml
tane has quit [Ping timeout: 268 seconds]
AltGr has left #ocaml [#ocaml]
Quota has joined #ocaml
FreeBird_ has joined #ocaml
noddy has joined #ocaml
tane has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 244 seconds]
thomasga has quit [Quit: Leaving.]
thomasga has joined #ocaml
Guest10086 is now known as xyh
xyh is now known as TheOfenLisp
dsheets has quit [Remote host closed the connection]
TheOfenLisp is now known as TheOftenLisp
<seangrove>
Drup: in fuctoria, is it possible to have e.g. `Key.create "email_api_key" Key.Arg.(opt string None i)` ?
TheOftenLisp is now known as xyh
<seangrove>
Ok, so it looks like there's not a way to use Mailgun's http api with OCaml right now, because cohttp doesn't support multipart/form-data
<seangrove>
Well, maybe I can set the headers manually...
dinosaure has quit [Ping timeout: 276 seconds]
xyh is now known as condyHunter
Vintila has joined #ocaml
Stalkr_ has joined #ocaml
<Stalkr_>
Hi, I have function A and B that are dependent on each other. A calls B, B calls A. How do I solve this? Are there no `let A = ... and let B = ...` like with types?
dinosaure has joined #ocaml
condyHunter is now known as xyh
<Stalkr_>
Looks like I can just do `let A = ... and B = ...` hope this is correct
<Quota>
yes, yes it is
<Stalkr_>
Quota: I am getting Warning 10: this expression should have type unit. here https://gist.github.com/anonymous/1e54b25aff7693e72db7ddececf2490f interp is supposed to return unit, do you have any idea what I am doing wrong? I have tried wrapping interpStm in () too but still getting warning
sz0 has quit [Quit: Connection closed for inactivity]
_gt has joined #ocaml
seangrov` has joined #ocaml
<_gt>
hello
Quota has quit [Quit: Page closed]
seangrove has quit [Ping timeout: 276 seconds]
<_gt>
I want to rewrite my code, which make all permutations from python to OCaml, but I can't figure out how to use slice in OCaml.
<ggole__>
Stalkr_: interpStm seems to have a return value that is not unit
<ggole__>
If you want to ignore it, use ignore (...) (which the warning is aware of).
<Stalkr_>
ggole__: That is true, it is not possible to have that return something but interp to return unit?
<Stalkr_>
ignore (interpStm s []) works without using () too thanks
BitPuffin has joined #ocaml
<Drup>
seangrov`: probably, what's the problem ?
dsheets has joined #ocaml
noddy has quit [Ping timeout: 240 seconds]
struk|lap has quit [Ping timeout: 240 seconds]
dsheets_ has joined #ocaml
dsheets has quit [Ping timeout: 268 seconds]
djellemah_ has joined #ocaml
AltGr has joined #ocaml
seangrov` has quit [Ping timeout: 244 seconds]
_gt has quit [Quit: leaving]
apluke has joined #ocaml
djellemah has quit [Disconnected by services]
djellemah_ is now known as djellemah
matason has joined #ocaml
hcarty1 has joined #ocaml
apluke` has joined #ocaml
malina has joined #ocaml
jwatzman|work has quit [Quit: jwatzman|work]
apluke has quit [Ping timeout: 248 seconds]
apluke` has quit [Ping timeout: 248 seconds]
AltGr has left #ocaml [#ocaml]
noddy has joined #ocaml
matason has quit [Ping timeout: 264 seconds]
dhil has joined #ocaml
foocraft has joined #ocaml
noddy has quit [Ping timeout: 276 seconds]
Stalkr_ has quit [Quit: Leaving...]
njhb has quit [Quit: Page closed]
tennix has quit [Ping timeout: 264 seconds]
hcarty1 is now known as hcarty
sh0t has joined #ocaml
samoht1 has joined #ocaml
jeffmo has joined #ocaml
samoht1 is now known as thomasga
MercurialAlchemi has quit [Ping timeout: 260 seconds]
FreeBirdLjj has joined #ocaml
thomasga has quit [Quit: Leaving.]
M-Illandan has quit [Remote host closed the connection]
FreeBird_ has quit [Ping timeout: 260 seconds]
foocraft has quit [Remote host closed the connection]
FreeBirdLjj has quit [Remote host closed the connection]
axiles has joined #ocaml
samoht1 has joined #ocaml
samoht1 has quit [Client Quit]
thomasga has joined #ocaml
Vintila has quit [Ping timeout: 276 seconds]
thomasga is now known as foobarfoo
foobarfoo is now known as thomasga
darkf has quit [Quit: Leaving]
copy` has joined #ocaml
jwatzman|work has joined #ocaml
M-Illandan has joined #ocaml
tmtwd has joined #ocaml
thomasga1 has joined #ocaml
dsheets has joined #ocaml
thomasga has quit [Ping timeout: 264 seconds]
dsheets_ has quit [Ping timeout: 248 seconds]
orbifx has joined #ocaml
tmtwd has quit [Ping timeout: 264 seconds]
tennix has joined #ocaml
cdidd has joined #ocaml
th5 has joined #ocaml
MercurialAlchemi has joined #ocaml
jeffmo has quit [Quit: jeffmo]
th5 has left #ocaml [#ocaml]
<orbifx>
Is there a way to iterate a record structure?
<zozozo>
you mean, iterate through the fields of a record ?
<mrvn>
only with Obj or C code.
<mrvn>
or ppx
<mrvn>
worst case you can shorten the screw or place the spacer between the part and the motor.
<mrvn>
ups
<ggole__>
How would you even type that?
ggole__ is now known as ggole
<mrvn>
ggole: magic
<ggole>
I suppose you could do it with ocamlty or something like that
cdidd has quit [Remote host closed the connection]
<orbifx>
Hmm ok, I think I've got to avoid records for this implementation
<orbifx>
Thanks
M-Illandan has quit [Ping timeout: 248 seconds]
slash^ has joined #ocaml
MercurialAlchemi has quit [Quit: leaving]
MercurialAlchemi has joined #ocaml
cdidd has joined #ocaml
cdidd has quit [Remote host closed the connection]
M-Illandan has joined #ocaml
cdidd has joined #ocaml
<Leonidas>
interesting, the effect paper is 2 pages, the modular implicit paper is 42 pages.
<Leonidas>
orbifx: the issue is the code that iterates over a record would have to have a type signature of roughly 'a -> 'a at which point it is not overly useful.
<orbifx>
Yeah, I realised that from the solutions given
<orbifx>
I mean what others suggested as solutions
<leyyin>
giing3r97, was that regarding my question?
<leyyin>
does notepadd++ even support ocaml code?
<giing3r97>
Of course
<giing3r97>
And you can customize the style at your wish
<Algebr``>
can't tell if this is trolling or being serious
<giing3r97>
You can also use unix editors like vim or nano
<leyyin>
do they support automatic style formatting for ocaml code?
<leyyin>
don't you need a plugin?
<leyyin>
or a tool that can do that
<giing3r97>
Not sure what you mean :-/
<giing3r97>
You want to autoindent a file and have some nice color styling ?
<leyyin>
nope :)
<leyyin>
for example I have in my code `let a=2` and I define my rule so that there is spaces around the `=` so the tool will convert that code to `let a = 2`
<giing3r97>
Well, write your own script to parse a caml file and do as you wish :-)
<leyyin>
is not that simple :P
twobitsprite has quit [Quit: Lost terminal]
<giing3r97>
Write it in caml :-)
<Algebr``>
leyyin: I don't think such a tool exists at the moment
jwatzman|work has quit [Quit: jwatzman|work]
<fds>
GNU Indent does this for C, right? So maybe submit it as a patch for ocp-indent.
<fds>
If they're interested
<Algebr``>
I was hoping someone would extend clang-format
<leyyin>
I think a separate tool
<leyyin>
ocp-ident seems specialized on indentation
larhat has quit [Quit: Leaving.]
<orbifx>
Thanks copy`
Algebr`` has quit [Ping timeout: 264 seconds]
tennix has quit [Ping timeout: 244 seconds]
orbifx has quit [Ping timeout: 250 seconds]
shinnya has joined #ocaml
jgjl has joined #ocaml
ygrek has joined #ocaml
snhmib has quit [Ping timeout: 244 seconds]
<flux>
ygrek, thanks for the pointer! do you know how c dependencies should appear in that?
jgjl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<flux>
I guess I should find an ocaml project that makes a native code library and uses it in another directory and see how it's done..
<hcarty>
leyyin: It doesn't exist yet, unfortunately
<ygrek>
C dependencies are not tracked that way
<ygrek>
that's why one has to specify them in _oasis CSources
* leyyin
starts writing it
<leyyin>
*when I have time*
<flux>
ygrek, so I guess it means I cannot interrogate ocamlbuild about what it thinks the dependencies are, other than -verbose bignumber?
<flux>
hmm, so I guess the -lFFmpeg-stubs gets baked into the library, but that in itself doesn't create any dependency from the binary using the library to the stubs
thomasga1 has left #ocaml [#ocaml]
<flux>
I've tried things like dep ["link"; "use_FFmpeg"] ["ffmpeg/libFFmpeg-stubs.a"]; but that doesn't seem to affect anything
boegel has quit [Remote host closed the connection]
<ygrek>
you pass -l with -cclib and that cmdline arg gets embedded into cma cmxa meta info
<ygrek>
and ocamlopt will add that to linking phase when linking any binary using that cma
<flux>
right, and that part works fine
<ygrek>
why are you doing it by hand?
<flux>
but the part where modifying the .c file results in the binary being relinked doesn't
<ygrek>
add dep from .c to .a or .cma and then ocamlbuild should rebuild it iiuc
* ygrek
afk
<flux>
but if there is no such dependency already, why does it rebuild the .cmxa when I modify the .c?
Kakadu has quit [Ping timeout: 250 seconds]
ygrek has quit [Ping timeout: 246 seconds]
frankil has joined #ocaml
frankil has left #ocaml [#ocaml]
dsheets has quit [Remote host closed the connection]
A1977494 has quit [Ping timeout: 248 seconds]
A1977494 has joined #ocaml
dsheets has joined #ocaml
chindy has quit [Remote host closed the connection]
dsheets has quit [Ping timeout: 246 seconds]
tane has quit [Ping timeout: 260 seconds]
pierpa has joined #ocaml
tane has joined #ocaml
orbifx has joined #ocaml
dhil has quit [Ping timeout: 250 seconds]
apache2_ is now known as apache2
jeffmo has joined #ocaml
jeffmo has quit [Client Quit]
ygrek has joined #ocaml
sepp2k has quit [Quit: Leaving.]
thomasga has joined #ocaml
nicholasf has quit [Remote host closed the connection]
<flux>
so I think the reason is this: the .cmxa does not get changed when the c-file changes
<flux>
and because the .a isn't a direct dependency of the binary, merely a switch passed to it, it doesn't think the binary shuold be recompiled
<flux>
but how do I fix this? btw, the repo is at https://github.com/eras/webcamviewer/ if someone is feeling super-helpful, the source in question is ffmpeg/ffmpeg-stubs.c ;)
cdidd has joined #ocaml
Kakadu has joined #ocaml
seangrove has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
Algebr has quit [Remote host closed the connection]
cat5e has quit [Ping timeout: 264 seconds]
ggole has quit []
cat5e has joined #ocaml
BitPuffin has quit [Ping timeout: 276 seconds]
xyh has left #ocaml [#ocaml]
Algebr` has joined #ocaml
ollehar has joined #ocaml
ooo has joined #ocaml
ollehar has quit [Client Quit]
matason has joined #ocaml
j0sh has quit [Ping timeout: 244 seconds]
malc_ has joined #ocaml
seangrove has quit [Remote host closed the connection]
seangrove has joined #ocaml
t4nk504 has joined #ocaml
thomasga has quit [Quit: Leaving.]
<seangrove>
Any easy way to turn a Cohttp Request into a string (uri, headers, etc.)? I want to email it in the case of an error.
j0sh has joined #ocaml
thomasga has joined #ocaml
<Algebr`>
seangrove: maybe use one of the sexp serializers then turn it into string
<Algebr`>
aka I see: val Cohttp_lwt.Request.sexp_of_t t -> Sexplib.Sexp.t and then turn that Sexp.t into a string
<MercurialAlchemi>
sign that you're getting tired: you momentarily try to work with the standard library
<companion_cube>
I must be tired often
<companion_cube>
o/ people
<MercurialAlchemi>
well, you write an stdlib, you don't have much choice (at least when you do that)
<MercurialAlchemi>
but trying to use the Sys module when you could use lwt, that's usually masochistic
<companion_cube>
ah, if you're doing mosly IO, yes
<MercurialAlchemi>
I'm not sure what the stdlib is good at that third-party libraries are not considerably better at, actually
<MercurialAlchemi>
I mean, sure, you're going to use List.map and friends, unless you use jane street's replacements, but apart from that?
<flux>
can I tell ocamlbuild that something depends on foo.cmi, without ocamlbuild adding that foo.cmi to the compilation line?
<companion_cube>
its good at being shipped with the compiler?
<companion_cube>
the data structures are ok, also
<MercurialAlchemi>
yeah, that's what I was trying to say with my List.map mention
seangrove has quit [Ping timeout: 244 seconds]
<companion_cube>
I think the stdlib is ok (albeit a bit small) for algorithmic programs
<companion_cube>
which is what many people write in OCaml
<MercurialAlchemi>
hm
<MercurialAlchemi>
that's being generous
<companion_cube>
well it's not going to fullfill all the needs, sure
<MercurialAlchemi>
you can't even pipe data efficiently
<companion_cube>
but no stdlib can
<companion_cube>
yeah, that's why I'm talking about algorithmic
<MercurialAlchemi>
well, no, but it's 2016 and linq and guava have been around for a few years now
<MercurialAlchemi>
fortunately gen and seq are not far away
<companion_cube>
I don't know guava, isn't it just a java stdlib?
<MercurialAlchemi>
well, yeah, with constructs like List.transform
<MercurialAlchemi>
which are lazy
<companion_cube>
(what's the type?)
<companion_cube>
ah I see
<_y>
if i write something like « Array.make n 0 » (or « Array.make n Z.zero »), does it get specially optimized as compared to the case where we fill the array with a non‐empty value?
<MercurialAlchemi>
(which can bite you quite easily if you don't pay attention)
<_y>
*non‐zero value
<companion_cube>
_y: I don't think so
<MercurialAlchemi>
it's just that I can't imagine operating on arbitrarily-sized collections without this kind of stuff
<companion_cube>
well, yeah, we should have iterators
<companion_cube>
:
<companion_cube>
:/
<MercurialAlchemi>
yeah
<MercurialAlchemi>
I think there is a stream module in the stdlib that nobody uses?
seangrove has joined #ocaml
<companion_cube>
kind of
<MercurialAlchemi>
but anyway, it's always this weird distorsion with ocaml, where you have laser guns next to stone age tools
<flux>
(I guess I messed something up earlier, now it again works like I expected it to ;))
<MercurialAlchemi>
like the community was playing a crazy game of civilization
<companion_cube>
:D
<flux>
mercurialalchemi, well it's a bit like writing portable C
<flux>
so cool folks already know all about it!
<MercurialAlchemi>
flux: I don't get it, but my brain is starting to melt a bit
<MercurialAlchemi>
hm, talking about stone tools, ounit apparently never heard about integration tests
<MercurialAlchemi>
who would be crazy enough to need setup/teardown functions?
<flux>
..it does have setup/teardown functions
<MercurialAlchemi>
oh, I see bracket
<MercurialAlchemi>
just the getting started which only mentions tmp_file and tmp_dir
<companion_cube>
you seem a bit tense, MercurialAlchemi
<MercurialAlchemi>
soon bedtime, I think
rand__ has joined #ocaml
leyyin has quit [Ping timeout: 248 seconds]
<companion_cube>
so after 4.03, there might be discussions about the stdlib
leyyin has joined #ocaml
<companion_cube>
I'll try to push iterators into it
<MercurialAlchemi>
that'd be great
<MercurialAlchemi>
I'll tone down my criticisms of the stdlib by 50%
hydan has joined #ocaml
<Algebr`>
its a common topic around here.
<fds>
Reforms of the standard library would be cool.
<Algebr`>
We pin 95 complaints to Iniria's door.
<companion_cube>
no guarantee it will work
hydan has quit [Client Quit]
snhmib has joined #ocaml
dhil has joined #ocaml
<flux>
meh, I almost fixed it, now I can end up in the "inconsistent" case when I modify code. well, gotta try fixing it at some point..
cdidd has quit [Remote host closed the connection]
pyon has quit [Quit: Reality is multi-dimensional. More precisely, two-dimensional.]
nicholasf has joined #ocaml
A1977494 has quit [Remote host closed the connection]
NingaLeaf has quit [Quit: Leaving]
malc_ has quit [Remote host closed the connection]
aantron has joined #ocaml
<MercurialAlchemi>
anyway, enough ranting, time for snoring
<MercurialAlchemi>
night all
<companion_cube>
good night MercurialAlchemi
<companion_cube>
st
orbifx2 has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 260 seconds]
orbifx has quit [Ping timeout: 244 seconds]
t4nk504 has quit [Ping timeout: 250 seconds]
pyon has joined #ocaml
d0nn1e has quit [Ping timeout: 260 seconds]
Stalkr_ has joined #ocaml
d0nn1e has joined #ocaml
Stalkr_ has quit [Quit: Leaving...]
apache2 has quit [Quit: leaving]
<Leonidas>
companion_cube: yes, iterators!
<companion_cube>
yay
leyyin has quit [Quit: So Long, and Thanks for All the Fish]
dhil has quit [Ping timeout: 264 seconds]
<seangrove>
Algebr`: There's a top-level printer (I think) for Request though, surely I could use that somehow?
teiresias has joined #ocaml
<seangrove>
The sexp route seems pretty heavy
<companion_cube>
ppx_deriving.show?
orbifx has joined #ocaml
<seangrove>
companion_cube: I'm trying to capture a Cohttp Request as a string for an report email (backtrace + error + context) when an error occurs in production
<companion_cube>
yeah well, pp_hum
<companion_cube>
apparently
<seangrove>
Can I apply ppx_deriving.show to someone else's types?
orbifx2 has quit [Ping timeout: 268 seconds]
<seangrove>
companion_cube: Ah, that could make sense. Have to find out how to use formatters
matason has quit [Ping timeout: 250 seconds]
<companion_cube>
with ppx_import, maybe
<companion_cube>
but just Format.printf "request: %a@." Request.pp_human req
<companion_cube>
shoudl do the trick
Stalkr_ has joined #ocaml
Stalkr_ has quit [Read error: Connection reset by peer]