mcc has quit [Quit: Connection closed for inactivity]
Algebr` has joined #ocaml
rgrinberg has joined #ocaml
Sim_n has quit [Read error: Connection reset by peer]
minn has quit [Ping timeout: 244 seconds]
brunoro has joined #ocaml
brunoro has quit [Ping timeout: 264 seconds]
noethics has quit [Quit: Leaving]
Algebr` has quit [Ping timeout: 265 seconds]
noethics has joined #ocaml
Algebr` has joined #ocaml
minn has joined #ocaml
brunoro has joined #ocaml
brunoro has quit [Ping timeout: 244 seconds]
xen3 has quit [Ping timeout: 264 seconds]
vapid has joined #ocaml
nomicflux has joined #ocaml
average has quit [Remote host closed the connection]
myst|fon has quit [Quit: Connection closed for inactivity]
brunoro has joined #ocaml
mfp has quit [Ping timeout: 264 seconds]
wolfcore has quit [Ping timeout: 240 seconds]
brunoro has quit [Ping timeout: 272 seconds]
silver has quit [Read error: Connection reset by peer]
wolfcore has joined #ocaml
jao has quit [Ping timeout: 264 seconds]
rgrinberg has quit [Ping timeout: 265 seconds]
brunoro has joined #ocaml
brunoro has quit [Ping timeout: 248 seconds]
pierpa has joined #ocaml
Algebr` has quit [Ping timeout: 252 seconds]
nomicflux has quit [Quit: nomicflux]
tmtwd has joined #ocaml
ygrek_ has joined #ocaml
warhat has joined #ocaml
brunoro has joined #ocaml
brunoro has quit [Ping timeout: 272 seconds]
rgrinberg has joined #ocaml
malina has joined #ocaml
fluter has quit [Ping timeout: 244 seconds]
Heasummn has quit [Quit: Leaving]
malina has quit [Remote host closed the connection]
brunoro has joined #ocaml
brunoro has quit [Ping timeout: 252 seconds]
kakadu has joined #ocaml
minn has quit [Ping timeout: 244 seconds]
AlexDenisov has joined #ocaml
brunoro has joined #ocaml
brunoro has quit [Ping timeout: 265 seconds]
MercurialAlchemi has joined #ocaml
al-damiri has quit [Quit: Connection closed for inactivity]
myst|fon has joined #ocaml
sh0t has quit [Remote host closed the connection]
tane has joined #ocaml
noethics has quit [Quit: Leaving]
tmtwd has quit [Ping timeout: 264 seconds]
rgrinberg has quit [Ping timeout: 252 seconds]
fluter has joined #ocaml
copy` has quit [Quit: Connection closed for inactivity]
brunoro has joined #ocaml
average has joined #ocaml
brunoro has quit [Ping timeout: 244 seconds]
slash^ has joined #ocaml
kakadu has quit [Remote host closed the connection]
Algebr` has joined #ocaml
brunoro has joined #ocaml
orbifx-m2 has joined #ocaml
brunoro has quit [Ping timeout: 264 seconds]
orbifx-m has quit [Ping timeout: 244 seconds]
pierpa has quit [Ping timeout: 252 seconds]
fluter has quit [Ping timeout: 252 seconds]
orbifx-m has joined #ocaml
orbifx-m2 has quit [Ping timeout: 248 seconds]
fluter has joined #ocaml
Simn has joined #ocaml
octachron has joined #ocaml
brunoro has joined #ocaml
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
brunoro has quit [Ping timeout: 264 seconds]
wxfdglm has joined #ocaml
ygrek_ has quit [Ping timeout: 272 seconds]
copy` has joined #ocaml
hhx has quit [Ping timeout: 244 seconds]
wxfdglm has quit [Ping timeout: 264 seconds]
wxfdglm has joined #ocaml
brunoro has joined #ocaml
brunoro has quit [Ping timeout: 248 seconds]
orbifx-m has quit [Ping timeout: 252 seconds]
mfp has joined #ocaml
llamatarianism has joined #ocaml
<llamatarianism>
hello
<Algebr`>
hi
orbifx has joined #ocaml
brunoro has joined #ocaml
natimic has quit [Ping timeout: 276 seconds]
<orbifx>
what is the best known way to constrain a string?
<orbifx>
restrict its sizes, type of characters etc?
<Algebr`>
maybe a phantom type?
<Algebr`>
with some checks?
brunoro has quit [Ping timeout: 244 seconds]
warhat has quit [Quit: Connection closed for inactivity]
llamatarianism has quit [Quit: Page closed]
<orbifx>
any tutorials or other documentation on phantom types Algebr` ?
adrien has quit [Quit: leaving]
adrien has joined #ocaml
<wxfdglm>
hello
<wxfdglm>
anyone have tried using ocaml in an android app ? I keep getting undefined references when linking to libasmrun
<Algebr`>
orbifx: at the risk of sounding trite, google is your friend? There is a jane street post about it and a lib<something virtualization> post about it
<Algebr`>
wxfdglm: yes, opam-android is your friend
<wxfdglm>
I'm already using opam-android and it works for building a "normal" binary
<wxfdglm>
but it always fail with undefined references when linking to libasmrun in the ndk makefiles
chattered has joined #ocaml
<chattered>
Hey. Our institution is working with a fork of the Ocaml compiler that we want to host on the github. We don't intend to pull request. Do we just need to extend copyright notices to the changed files?
brunoro has joined #ocaml
brunoro has quit [Ping timeout: 248 seconds]
AlexDenisov has joined #ocaml
nicoo has quit [Remote host closed the connection]
<Algebr`>
wxfdglm: have you opened a github issue on opam-android?
<wxfdglm>
no, I guess I will have to
<Algebr`>
I'm sure it would help more than just you too, everyone benefits.
brunoro has joined #ocaml
ggole has joined #ocaml
brunoro has quit [Ping timeout: 252 seconds]
orbifx has quit [Ping timeout: 265 seconds]
gladyon has joined #ocaml
octachron has quit [Ping timeout: 248 seconds]
kamog` has joined #ocaml
kamog has quit [Ping timeout: 264 seconds]
<gladyon>
hi I'm about to start a new OCaml project that may make busy for a couple of years. I used Batteries in the past, as a substitute for the standard library. Now I contemplate the possibilty of using another library. I'm not too fond of Core_kernel which I don't find well documented. I thought I'd use Containers which is small enough, but it seems to me it doesn't use the newly-added 'result' type... Any advice?
wxfdglm has quit [Ping timeout: 248 seconds]
<adrien>
probably a matter of time (not long I bet)
<Algebr`>
companion_cube: ping
<Drup>
gladyon: hum, it does
<Algebr`>
!stdlib
<Algebr`>
!lwt
<Drup>
CCResult = result
<Algebr`>
(did the bot die?)
yomimono has joined #ocaml
<Drup>
gladyon: what made you think it doesn't ?
tane has quit [Quit: Leaving]
<reynir>
Hmm. Opam switch complains [WARNING] The environment is not in sync with the current switch. You should run: eval `opam config env`
<reynir>
but I ran opam config setup -a and it still says that in a new shell
<reynir>
Hmm, I can't see what's wrong - everything seems correct otherwise
<Drup>
reynir: which opam version ? That warning can ocasionally trigger without reason
<reynir>
1.2.2
<Drup>
yeah, I remember having that warning for no reasons quite often
<reynir>
at least that's the one I have installed now; just started a system upgrade ^^
<reynir>
OK thanks
<reynir>
It's weird though if I run eval $(opam config env) it goes away
<reynir>
but I don't see anything missing
octachron has joined #ocaml
<Drup>
For a while, opam was trying to look inside your PATH and was not particularly clever about it, so if you had things in the wrong order, it was unhappy
<Drup>
something like that
<Drup>
mostly unconsequential
<Drup>
(pretty sure all of this is fixed in 2.0)
<Algebr`>
when is 2.0 going to be released
brunoro has joined #ocaml
<Drup>
Algebr`: I think the plan was something like january, after a reasonably long beta session
<reynir>
OK I have opam like 4 times in $PATH - maybe that's what's confusing opam heh
<gladyon>
Drup: well I thought it used an old, in-house result type rather than the one introduced in 4.03... Let me check whether the documentation has been updated...
brunoro has quit [Ping timeout: 264 seconds]
<gladyon>
:) indeed I must have dreamed
<gladyon>
oh wait. it's because there's also a CCError module
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
NingaLeaf has joined #ocaml
AlexDenisov has joined #ocaml
NingaLeaf has quit [Client Quit]
octachron has quit [Ping timeout: 265 seconds]
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
octachron has joined #ocaml
ggole_ has joined #ocaml
FreeBirdLjj has joined #ocaml
ggole has quit [Ping timeout: 264 seconds]
flerex has joined #ocaml
<flerex>
hey guys, how can i implement a function that does the cartesian product of two lists??
ggole__ has joined #ocaml
<gladyon>
flerex: BatList.cartesian_product
<Algebr`>
flerex: for each thing in this list, create a pairing with each item from the other list
<flerex>
yeah, but i don't know how to do it, if you could give me a clue
ggole_ has quit [Ping timeout: 264 seconds]
<Enjolras>
flerex: you can usea List.map nested in a List.fold_left
gladyon has quit [Quit: Page closed]
<Enjolras>
ok, this is not 100% efficient
<Enjolras>
so i guess 2 folds is better
<Enjolras>
all you need to do is walk the first list and append the list of pairs of the current elements of the first list with the elements of the second list to the accumulator
<flerex>
okey thank you all very much!
gladyon has joined #ocaml
<gladyon>
Regarding testing frameworks, I hesitate between using Alcotest and iteml (which seems handier to me). Any advice?
<Algebr`>
I like alcotest, its straightforward and easy
<Algebr`>
never saw iteml before
flerex has joined #ocaml
flerex has quit [Client Quit]
flerex has joined #ocaml
pierpa has joined #ocaml
<gladyon>
Alcotest seems like there is a lot of code to write w.r.t. iteml. The latter works by writing tests inside comments; this is used for the validatin of Batteries for instance. Iteml has quicheck-like features too: is it the same for Alcotest?
brunoro has joined #ocaml
vapid is now known as Xd
Xd is now known as xen3
<Drup>
alcotest is very simple, it's just a bunch of stuff to run tests and to print the result, and have pretty colors. It doesn't do anything clever like qcheck/iteml
<gladyon>
all right. is it possible to get a colorful output with iteml?
brunoro has quit [Ping timeout: 252 seconds]
<Drup>
companion_cube is the resident expert, you will have to ask him.
FreeBirdLjj has quit [Remote host closed the connection]
<orbitz>
Are tehre well defined strategies for reducing allocations in libraries in ocaml? If I'm writing a library that i think might be at the center of a tight loop, for example.
<orbitz>
This is a hot selling point in Rusy, for example, I'm curious what one's options are in Ocaml.
<gladyon>
I must pretty-print (not just print) huge formulas into files. I have used PPrint but it seems slowish to me; does anyone know of another combinator-based pretty-printing library that would be efficient? Or perhaps give some advice to gain in efficiency whatever the library?
pierpa has quit [Ping timeout: 272 seconds]
annoymouse has joined #ocaml
hhx has quit [Ping timeout: 264 seconds]
<zozozo>
gladyon: have you tried Format ?
nicoo has joined #ocaml
sh0t has joined #ocaml
ldopa has joined #ocaml
<orbitz>
Is it possible to do an optional argument relative to a non-otpional argument. Specifically like: let f ?(pos = 0) ?(len = Bytes.length b) b = ...?
orbifx has joined #ocaml
<orbitz>
gladyon: There is also Fmt by buenzli
<octachron>
orbitz, Fmt is essentially a set of combinators for Format, performance should be the same
<ggole_>
orbitz: yes, but b has to come first
<orbitz>
ggole_: i figured, unfortunately it's super awkward since you get an optional as the last element of a function
<orbitz>
octachron: yes, I was just pointing it out as another library to look at.
<ggole_>
You can add a (), which is annoying but will work.
<orbitz>
I'll just go with always having to specify len, which is unfortunate.
<ggole_>
The optional argument machinery would be a lot nicer if it didn't have that problem.
orbifx has quit [Ping timeout: 248 seconds]
<octachron>
orbitz, you could also write the expansion of the default argument yourself
<orbitz>
octachron: the extra optional layer becomes even awkwardar, IMO.
<octachron>
i.e. "f ?(pos=0) ?len b = let len = match len with None -> Bytes.length b | Some n -> n in … "
natimic has joined #ocaml
fluter has quit [Ping timeout: 265 seconds]
luzi has left #ocaml ["WeeChat 1.6-rc1"]
ggole__ has joined #ocaml
ggole_ has quit [Ping timeout: 264 seconds]
kiwnix has quit [Quit: -]
struk|desk has quit [Quit: Konversation terminated!]
kamog` is now known as kamog
struk|desk has joined #ocaml
maufred_ has joined #ocaml
maufred_ has quit [Quit: WeeChat 1.5]
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
FreeBirdLjj has joined #ocaml
inr has quit [Quit: bye]
octachron has quit [Ping timeout: 248 seconds]
tmtwd has joined #ocaml
inr has joined #ocaml
LiamGoodacre has joined #ocaml
yomimono has quit [Ping timeout: 265 seconds]
inr has quit [Quit: bye]
inr has joined #ocaml
shinnya has quit [Ping timeout: 244 seconds]
jao has joined #ocaml
average has quit [Quit: leaving]
rgrinberg has quit [Ping timeout: 252 seconds]
brunoro has quit [Ping timeout: 248 seconds]
orbifx has joined #ocaml
fluter has joined #ocaml
orbifx has quit [Ping timeout: 264 seconds]
gladyon has quit [Quit: Page closed]
yomimono has joined #ocaml
hhx has joined #ocaml
xen3 has quit [Read error: Connection reset by peer]
vapid has joined #ocaml
vapid has quit [Remote host closed the connection]
vapid has joined #ocaml
octachron has joined #ocaml
freusque has joined #ocaml
vapid has quit [Read error: Connection reset by peer]
vapid has joined #ocaml
ygrek_ has joined #ocaml
annoymouse has quit [Quit: Connection closed for inactivity]
tmtwd has quit [Ping timeout: 264 seconds]
freusque has quit [Ping timeout: 272 seconds]
copy` has quit [Quit: Connection closed for inactivity]
average has joined #ocaml
brunoro has joined #ocaml
brunoro has quit [Ping timeout: 264 seconds]
orbifx has joined #ocaml
orbifx has quit [Ping timeout: 264 seconds]
AlexDenisov has joined #ocaml
<average>
hi
<average>
i'm bored
<average>
just sayin
axiles has quit [Ping timeout: 244 seconds]
<flux>
average, try the ocaml object system?-)
<average>
like how
<average>
i don't write ocaml yet
<flux>
oh.
<average>
i didn't have time to read the docs and stuff
<flux>
well, then it should be even easier to entertain yourself
yomimono has quit [Quit: Leaving]
<average>
have enough stuff to solve outside ocaml
ggole__ has quit []
slash^ has quit [Read error: Connection reset by peer]
axiles has joined #ocaml
brunoro has joined #ocaml
lolisa has joined #ocaml
brunoro has quit [Ping timeout: 264 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
<Algebr`>
but enough to say ir on IRC =P
noethics has joined #ocaml
etc has joined #ocaml
LiamGoodacre has quit [Quit: Leaving]
FreeBirdLjj has joined #ocaml
etc has quit [Quit: Page closed]
FreeBirdLjj has quit [Remote host closed the connection]
MercurialAlchemi has quit [Ping timeout: 264 seconds]
<aantron>
lwt will release in a couple weeks. if you have any lingering issues to report that you want included, please go ahead and report them :) https://github.com/ocsigen/lwt/issues/275
copy` has joined #ocaml
troydm has quit [Ping timeout: 264 seconds]
annoymouse has joined #ocaml
troydm has joined #ocaml
brunoro has joined #ocaml
brunoro has quit [Ping timeout: 244 seconds]
<Algebr`>
aantron: you're alive!
<Algebr`>
yay!
<aantron>
lol
<aantron>
needed to get away for a little while
wolfcore has quit [Ping timeout: 272 seconds]
wolfcore has joined #ocaml
mr_foobar has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 272 seconds]
orbifx has joined #ocaml
noethics_ has joined #ocaml
noethics has quit [Disconnected by services]
noethics_ is now known as noethics
<noethics>
how does the Printf package hook into the compiler frontend
<noethics>
i thought i would need to use -ppx to do something like that
<noethics>
but somehow Printf does it
<octachron>
noethics, format strings (e.g. "%s %s") have specific support in the compiler
<noethics>
oh ok
<octachron>
and nowadays the implementation of printf and formatf are build from these format strings using GADTs
orbifx has quit [Ping timeout: 244 seconds]
brunoro has joined #ocaml
rgrinberg has joined #ocaml
octachron has quit [Quit: Leaving]
brunoro has quit [Ping timeout: 248 seconds]
rgrinberg has quit [Quit: WeeChat 1.5]
rgrinberg has joined #ocaml
kamog has quit [Ping timeout: 265 seconds]
freusque has joined #ocaml
shinnya has joined #ocaml
nomicflux has quit [Quit: nomicflux]
<nicoo>
noethics: /grep gadt
<nicoo>
Oops
<dxtr>
So, uhm, let's say I am doing something along the lines of: 'match x with \n | Foo (bar,baz) -> ...'
<dxtr>
What's the syntax for assigning the entire Foo to a variable?
<nicoo>
Foo (x, y) as z ->
vapid has quit [Read error: Connection reset by peer]
<dxtr>
Alright!
<nicoo>
Might need parenthesis around Foo(x,y), I can't recall right now
<nicoo>
By the way, the \n is not necessary: OCaml isn't whitespace-sensitive
<nicoo>
(You definitely want it in code, not so much when writing on IRC)
<dxtr>
I was imagining that it'd make the mental picture clearer :p
etc has joined #ocaml
<nicoo>
I see
vapid has joined #ocaml
an_ has joined #ocaml
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]