<zozozo>
afaik there is ounit, qtest, alcotest, qcheck
<ocaml805>
I am used mock libraries.
<ocaml805>
Ah!
fraggle-boate has quit [Ping timeout: 258 seconds]
cheater has quit [Ping timeout: 258 seconds]
troydm has quit [Ping timeout: 258 seconds]
fraggle-boate has joined #ocaml
cheater has joined #ocaml
troydm has joined #ocaml
snhmib has joined #ocaml
<ocaml805>
match l,n with | hd :: tl,n when n > 0 -> loop (hd :: acc) (n - 1) tl | [],_ -> None | hd :: tl,0 -> Some (acc, hd, tl)
<ocaml805>
_::_,1 is unmatched according to the error.
<ocaml805>
Should I ignore ?
<zozozo>
well, the type-cehcker cannot know it is catched by the 'when' statement
<Leonidas>
unit testing? how retro
<Leonidas>
writing possible test data and results by hand, like an animal
<dmbaturin>
In a formal proof, simplifying it to () = () is a perfectly valid thing to do though. ;)
<dmbaturin>
ocaml805: The only thing I find mildly irritating about ounit is that I can't do assert_raises with the exn constructor alone, but nothing short of camlp4 could change it.
<ocaml805>
I've heard the term "Equational reasoning".
<ocaml805>
That makes it sound that I am learned. But I am a learner.
<zozozo>
Leonidas: well, even quickcheck can be expressed as some kind of unit test
ocaml805 has quit [Ping timeout: 260 seconds]
maattdd has joined #ocaml
maattdd has quit [Quit: WeeChat 1.5]
dhil has joined #ocaml
sz0 has quit [Quit: Connection closed for inactivity]
ryanartecona has joined #ocaml
rossberg has quit [Ping timeout: 240 seconds]
wtetzner has joined #ocaml
al-damiri has joined #ocaml
wtetzner has quit [Remote host closed the connection]
shinnya has joined #ocaml
rossberg has joined #ocaml
copy` has joined #ocaml
hunteriam has joined #ocaml
sillyotter has joined #ocaml
silver has quit [Read error: Connection reset by peer]
jmiven has quit [Quit: co'o]
jmiven has joined #ocaml
MercurialAlchemi has quit [Remote host closed the connection]
<copy`>
Can I make all record fields from another module visible? (without opening that module and without repeating the type definition)
sillyotter has quit [Quit: WeeChat 1.4]
<companion_cube>
I don't think so
<companion_cube>
a local open can be adequate
<lobo>
companion_cube: while you're at it. List. drop/take wouldbe nice in the stdlib too. the "more ocaml" book has a package almost just for that on github :D
<companion_cube>
erf
<companion_cube>
I'm a bit afraid that the more functions I had, the less likely to be merged the PR is
<Armael>
I thought the mainteners were tired of the N unconcerted PRs, each adding one function to the stdlib
orbifx-m has joined #ocaml
<orbifx-m>
how do I tell oasis to make a thread enabled build?
<companion_cube>
Armael: I have no idea.
<companion_cube>
do you think I should make one single PR to add everything from containers into the stdlib? 0:-)
<orbifx-m>
threads?
<orbifx-m>
hmm that's it
<flux>
companion_cube, you could, but it would be pointless, wouldn't it?-)
<companion_cube>
heh
<companion_cube>
chances of being merged ~= 0
freusque has joined #ocaml
lfish has joined #ocaml
<lfish>
hi, a question... should I prefer to raise Failure or Invalid_argument when a situation would break an invariant of an abstract type?
<lfish>
(Like passing 0 as a denominator for a representation of a rational number)
<companion_cube>
Invalid_argument, I think
<companion_cube>
it's not very clear-cut
pierpa has joined #ocaml
yomimono has joined #ocaml
MercurialAlchemi has joined #ocaml
<lfish>
then I'll stick with Invalid_argument, thanks
<zozozo>
at least for the constructors of your abstract type, else I'd say assert false
<copy`>
Is there a library that allows printing literals in ocaml syntax, something like: show (list (pair int string)) [3, "b"; 4, "c"]` -> "[3, "b"; 4, "c"]"
<copy`>
Meh, probably I can do it myself
<jerith>
copy`: Fmt has something like that.
<reynir>
ppx_deriving has a 'show' plugin(?) that can help generate those show-functions
<copy`>
Cool, I'll have a look at fmt
<companion_cube>
also in containers
<companion_cube>
CCFormat.Dump (inspired from Fmt indeed)
<copy`>
So many options, thanks guys
<lfish>
in containers tutorial I've seen expressions like, for instance, CCVector.(1 -- 10), is that normal syntax?
<chelfi>
lfish: CCVector.(*expr*) means that CCVector is opened locally in the scope of expr and (--) is, I guess, a range operator
jnavila has quit [Ping timeout: 240 seconds]
johnelse_ has joined #ocaml
johnelse has quit [Read error: Connection reset by peer]
<companion_cube>
yes
<companion_cube>
it's similar to `let open CCVector in 1--10`
tokenrove has quit [Ping timeout: 258 seconds]
relrod has quit [Ping timeout: 258 seconds]
tokenrove has joined #ocaml
relrod_ has joined #ocaml
relrod_ has quit [Changing host]
relrod_ has joined #ocaml
hunteriam has quit [Quit: Connection closed for inactivity]
yomimono has quit [Ping timeout: 240 seconds]
larhat has quit [Quit: Leaving.]
trepta has joined #ocaml
smondet has joined #ocaml
yomimono has joined #ocaml
trepta has quit [Remote host closed the connection]
johnelse_ is now known as johnelse
ollehar has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
roberto_ has joined #ocaml
<Leonidas>
or let open CCVector in (--) 1 10
tristero has joined #ocaml
<lfish>
yeah... I was thinking of it as if it was like a filesystem, but the let open Module in ... way of seeing it makes perfect sense
orbifx has joined #ocaml
xorpse has joined #ocaml
AltGr has left #ocaml [#ocaml]
larhat has joined #ocaml
ryanartecona has joined #ocaml
orbifx-m has quit [Ping timeout: 240 seconds]
orbifx has quit [Ping timeout: 255 seconds]
relrod_ is now known as relrod
silver has joined #ocaml
yomimono has quit [Ping timeout: 240 seconds]
ygrek has joined #ocaml
jnavila has joined #ocaml
<copy`>
def`: Could you make a new opam release of grenier?
slash^ has joined #ocaml
yomimono has joined #ocaml
xorpse has quit [Ping timeout: 252 seconds]
dhil has quit [Ping timeout: 240 seconds]
jnavila has quit [Ping timeout: 252 seconds]
obadz has joined #ocaml
kakadu has joined #ocaml
jnavila has joined #ocaml
_andre has quit [Quit: leaving]
obadz has quit [Read error: Connection reset by peer]
trepta has joined #ocaml
octachron has joined #ocaml
ltadeu has quit [Ping timeout: 245 seconds]
Xadnem has joined #ocaml
Xadnem has quit [Client Quit]
lfish has quit [Ping timeout: 260 seconds]
wagle_ has joined #ocaml
wagle has quit [Remote host closed the connection]
wagle_ is now known as wagle
jnavila has quit [Ping timeout: 240 seconds]
rgrinberg has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
omongo has joined #ocaml
omongo has quit [Client Quit]
jnavila has joined #ocaml
omongo has joined #ocaml
obadz has joined #ocaml
omongo has quit [Client Quit]
omongo has joined #ocaml
obadz has quit [Ping timeout: 255 seconds]
govg has joined #ocaml
orbifx has joined #ocaml
trepta has quit [Ping timeout: 240 seconds]
<def`>
copy`: yes
slash^ has quit [Read error: Connection reset by peer]
yomimono has quit [Ping timeout: 240 seconds]
<copy`>
Cheers
hcarty1 has joined #ocaml
obadz has joined #ocaml
hcarty has quit [Ping timeout: 252 seconds]
srax has quit [Ping timeout: 260 seconds]
srax has joined #ocaml
obadz has quit [Read error: Connection reset by peer]
Algebr`` has joined #ocaml
<kakadu>
Folks, can I in myocamlbuild.ml add some switches to the beginning of command line? (-toolchain android seems to be position-dependent)
zv has joined #ocaml
madroach has quit [Ping timeout: 240 seconds]
madroach has joined #ocaml
<octachron>
kakadu, afaik, not with tags: tag expansion assumes that everything is commutative, and where the expansion itself is determined by the rule
<kakadu>
So, no chance that his will work?
<kakadu>
flag ["compile"] (S [A"-toolchain"; A"android"]) ?
<octachron>
kakadu, are you truing to set the ocamlfind -toolchain option?
<kakadu>
yep
<octachron>
ocamlbuild own toolchain does not fit your need?
<kakadu>
what do you mean?
<octachron>
sorry, I mean the ocambuild -toolchain option?
<octachron>
i.e. calling ocamlbuild with "ocamlbuild -toolchain android"
yomimono has joined #ocaml
<kakadu>
Ah, thanks
<kakadu>
I did not know about this option
MercurialAlchemi has quit [Ping timeout: 240 seconds]
<orbifx>
hey all
larhat has quit [Quit: Leaving.]
<orbifx>
are record field names values? (or functions)
<kakadu>
no
ollehar has quit [Quit: ollehar]
<orbifx>
what are they?
<theblatte>
identifiers
<theblatte>
just a syntactic category
ryanartecona has quit [Quit: ryanartecona]
<orbifx>
any further explanation of references to read on this?
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
ryanartecona has joined #ocaml
ryanartecona has quit [Client Quit]
ryanartecona has joined #ocaml
<kakadu>
do you want to use them as functions?
<orbifx>
I kinda though of them us such. Kept the language simpler
<orbifx>
but I know I can use lenses etc
<orbifx>
I use them in logarion
hcarty1 has quit [Quit: WeeChat 1.5]
<Armael>
there's probably a ppx out there that can generate functions corresponding to record fields
ryanartecona has quit [Quit: ryanartecona]
<octachron>
Janestreet's ppx_fields_conv does that (and a lot of other things)
<kakadu>
I think it is another name of lenses
jnavila has quit [Remote host closed the connection]
rcabaco has quit [Ping timeout: 256 seconds]
<orbifx>
octachron: what is conv? seen it in a few things, but never looked deeper
<Leonidas>
orbifx: conv is basically the name for all kind of conversion macros
<orbifx>
is it Janestreet specific?
<Leonidas>
into sexp, js objects, what have you
<Leonidas>
orbifx: not really. they just like naming things conv, but if you search for it there are a number of other packages also using that term
<Leonidas>
kinda like ppx_ and pa_ prefixes
AlexRussia has quit [Ping timeout: 240 seconds]
<orbifx>
thanks Leonidas
<orbifx>
and it's not part of ppx? Just a stand alone project?
AlexRussia has joined #ocaml
<orbifx>
rgrinberg: here?
<octachron>
ppx is a name used for any exntension-point based preprocessor
<Leonidas>
ppx is basically just the name given to preprocessors that use the OCaml AST. They don't even need to be written in OCaml, you could have ppx'es in bash.
<orbifx>
ok
kakadu has quit [Remote host closed the connection]
<octachron>
Leonidas, writing a ppx in bash sounds absolutely nightmarish
<orbifx>
would probably end up relying on sed
<octachron>
orbifx, I am not sure how much sed would work on a binary serialized ast
<orbifx>
ow
<orbifx>
might get hairy
yomimono has quit [Ping timeout: 252 seconds]
jimt_ has joined #ocaml
jimt has quit [Ping timeout: 248 seconds]
ryanartecona has joined #ocaml
jao has joined #ocaml
kareeeeem has quit [Quit: Connection closed for inactivity]