<osa1>
is there a shorter code for "let open BatInt32 in let open Int32 in ..." ?
<adrien_oww>
is Int32 from BatInt32?
hkBst_ has joined #ocaml
<osa1>
yes
<adrien_oww>
have you tried let open BatInt32.Int32 in ?
<osa1>
yes, didn't work
<adrien_oww>
# let open MoreLabels.Hashtbl in 42;;
<adrien_oww>
- : int = 42
<adrien_oww>
are you sure this Int32 module exists in BatInt32?
<osa1>
adrien_oww: hmm. after "open BatInt32" I have to call BatInt32 functions with Int32.fun so I thought there should be another module
<adrien_oww>
Int32 is a module of the standard library
<adrien_oww>
that's most probably what you're actually accessing
hkBst_ has quit [Ping timeout: 240 seconds]
hkBst_ has joined #ocaml
<orbitz>
Does BatInt32 work with pa_do too? If you want to get crazy you can use that which just becomes BatInt32.(expression)
<osa1>
does batteries replace standard modules when I call open Batteries ?
<adrien_oww>
osa1: that's supported in vanilla ocaml 3.12
<orbitz>
osa1: No idea, Batteries docs might do it. In Core it's open Core.Std
<orbitz>
adrien_oww: was that to me?
<orbitz>
adrien_oww: is pa_do obsolete now?
<orbitz>
cool
<orbitz>
Int32.(of_int_exn 1 + of_int_exn 2);;
<adrien_oww>
orbitz: yup, sorry
<adrien_oww>
orbitz: pa_do still doe more things
ontologiae has joined #ocaml
<Qrntz>
osa1, yes, it does
mcclurmc has joined #ocaml
Yoric has quit [Remote host closed the connection]
Yoric has joined #ocaml
weie_ has joined #ocaml
ttamttam1 has joined #ocaml
hkBst__ has joined #ocaml
Demitar_ has joined #ocaml
|jbrown| has joined #ocaml
dsheets1 has joined #ocaml
hkBst_ has quit [*.net *.split]
ttamttam has quit [*.net *.split]
Demitar has quit [*.net *.split]
weie has quit [*.net *.split]
dsheets has quit [*.net *.split]
jbrown has quit [*.net *.split]
djcoin has joined #ocaml
|jbrown| has quit [Ping timeout: 260 seconds]
_andre has joined #ocaml
ontologi1e has joined #ocaml
ontologiae has quit [Read error: Connection reset by peer]
ontologi1e is now known as ontologiae
Kakadu has joined #ocaml
|jbrown| has joined #ocaml
RagingDave has joined #ocaml
leoncamel has joined #ocaml
ftrvxmtrx_ has joined #ocaml
Kakadu has quit []
Kakadu has joined #ocaml
djcoin has quit [Ping timeout: 244 seconds]
weie_ has quit [Quit: Leaving...]
lolcathost has quit [Ping timeout: 260 seconds]
RagingDave has quit [Quit: Ex-Chat]
mika1 has quit [Quit: Leaving.]
weie has joined #ocaml
lolcathost has joined #ocaml
weie has quit [Client Quit]
Kakadu has quit [Read error: Connection reset by peer]
Kakadu has joined #ocaml
Kakadu has quit [Ping timeout: 248 seconds]
Kakadu has joined #ocaml
leoncamel has quit [Ping timeout: 252 seconds]
iratsu has joined #ocaml
iratsu has quit [Ping timeout: 240 seconds]
djcoin has joined #ocaml
Kakadu has quit []
Kakadu has joined #ocaml
mika1 has joined #ocaml
ontologiae has quit [Ping timeout: 256 seconds]
mcclurmc has quit [Ping timeout: 264 seconds]
mcclurmc has joined #ocaml
cago has quit [Ping timeout: 260 seconds]
|jbrown| has quit [Ping timeout: 276 seconds]
|jbrown| has joined #ocaml
lolcathost is now known as Playground
cago has joined #ocaml
ontologiae has joined #ocaml
zen_ben has joined #ocaml
zen_ben is now known as ben_zen
gnuvince_ has quit [Ping timeout: 252 seconds]
Cyanure has joined #ocaml
leoncamel has joined #ocaml
ttamttam has joined #ocaml
ttamttam has quit [Read error: Connection reset by peer]
ttamttam has joined #ocaml
ttamttam1 has quit [Read error: Connection reset by peer]
leoncamel has quit [Ping timeout: 252 seconds]
philed has quit [Remote host closed the connection]
elixey has joined #ocaml
leoncamel has joined #ocaml
sad0ur has quit [Read error: Connection reset by peer]
sad0ur has joined #ocaml
mye has quit [Ping timeout: 256 seconds]
sivoais has quit [Ping timeout: 260 seconds]
<f[x]>
<Qrntz> (ocurl is notorious for doing just that)
<f[x]>
what's the deal with ocurl?
<orbitz>
no-no-notorious
mcclurmc has quit [Ping timeout: 276 seconds]
<adrien_oww>
what about ocurl?
<f[x]>
that's the question
<Qrntz>
it won't work in the toplevel because of something along the lines of «unavailable external function» but works just fine when linked into a natively-compiled binary
<adrien_oww>
ah
Playground has quit [Ping timeout: 255 seconds]
<adrien_oww>
ocamlobjinfo on the .cma?
<Qrntz>
sorry, not now, I really should be running off
<f[x]>
it works fine
osa1 has quit [Ping timeout: 240 seconds]
<f[x]>
so you are just spreading FUD based on your personal problems :)
<Qrntz>
yeah um, except I've seen reports of other people having the same problem
<Qrntz>
I don't know if it's version-specific
<Qrntz>
later
<f[x]>
hm
<f[x]>
ok
<f[x]>
actually the upstream version had some arcane build procedure so maybe you are right..
lolcathost has joined #ocaml
bobry_ has quit [Quit: Connection closed for inactivity]
mcclurmc has joined #ocaml
q66 has joined #ocaml
osa1 has joined #ocaml
vincenzoml has joined #ocaml
<vincenzoml>
Hi there. I would like to add ioxml to the sources of my ocaml program and then compile my program using ioxml, from ocamlmakefile
<vincenzoml>
And I've not been using ocaml for the last few years so I don't understand anything anymore :)
ppseafield has joined #ocaml
sivoais has joined #ocaml
<thelema>
vincenzoml: you have a findlib package ioxml
<thelema>
?
<vincenzoml>
thelema: no I would like to run everything from the source directory
<vincenzoml>
thelema: I can do that by hand
<thelema>
you want to put the sources of ioxml into your program sources... why?
<vincenzoml>
because I need to leave this source code to people who can run "make" but won't be able to install additional ocaml libraries
<vincenzoml>
and also because ioxml is two files
<vincenzoml>
three
<thelema>
ok, so you copy ioxml into your source dir, and... put its .ml file into the SOURCES=?
<thelema>
is one of the files a .c file?
<vincenzoml>
no, there are a mli and a ml for
<vincenzoml>
well, the real stuff
<vincenzoml>
and a pa_... file
<vincenzoml>
however I can't add the "pa_" file to the sources, I get an error from ocamldep
<thelema>
ok, the pa file is the syntax extension
<thelema>
It seems that ioxml adds new syntax to ocaml; if you avoid using this, you can ignore the pa_ file
<vincenzoml>
thelema, the syntax extension is precisely the point of using ioxml :)
<thelema>
I take that back, from reading about ioxml, it looks like all the good bits are in the syntax extension
<vincenzoml>
anyway, I am supposed to use ocamlc -pp "camlp5o -I . -I ioxml-0.9 pa_ioXML.cmo" -I +camlp5 -c myfile.mli
chambart has joined #ocaml
<vincenzoml>
in order to use the syntax extension. Now apart from the fact that I don't know how to make the generated functions known to other modules, I am already confused on how to do the rest
<hcarty>
thelema: A little bit weird - I tried ( |> ) in the toplevel to see what would come back (OCaml 4.00.1). Error: The external function `%revapply' is not available
<hcarty>
thelema: It works fine in actual use from what I can see.
<vincenzoml>
thelema, I managed to incorporate the three files into my sources, and add the correct preprocessing directives to all needed files, except that I get an undefined reference to Pcaml while linking...
<hcarty>
thelema: Never mind - it's a known and fixed bug post-4.00.1
<rixed>
Need a confirmation: "match x with Some x -> Some x" will allocate while "match x with (Some x) as v -> v" will not, right? Or is it fixed in ocaml v4?
<adrien_oww>
afaik, yes
<adrien_oww>
as far as I'm concerned, I don't see this as a bug but as "do what I've written"
<thelema>
rixed: the first will allocate; not fixed afaik
<rixed>
thank you.
<rixed>
thelema: so in batSplay we could win some allocations :-)
<hcarty>
thelema: Congratulations on getting 2.0 out - it's a nicely cleaned up version of Batteries.
<thelema>
rixed: send the pull request; this should be easy to merge
<thelema>
hcarty: thanks. It's *way* overdue, but thanks to cedric taking the time to fix up modules, it actually happenned.
<rixed>
thelema: I will perform a global pass on all functions that are sensible to performance later - when I'm done with modify/modify_def/modify_opt.
<rixed>
thelema: it's probably easy to save some allocs here and there due to this only.
<vincenzoml>
thelema, I just lacked "LIBS = camlp5". Done, thanks :)
<thelema>
vincenzoml: great! you're welcome.
<thelema>
rixed: no problem.
weie has joined #ocaml
hkBst__ has quit [Remote host closed the connection]
mye has joined #ocaml
ttamttam has joined #ocaml
vincenzoml has left #ocaml []
answer_42 has quit [Ping timeout: 276 seconds]
hkBst__ has joined #ocaml
xavierm02 has joined #ocaml
Kakadu has quit []
hkBst__ has quit [Remote host closed the connection]
ttamttam has quit [Quit: ttamttam]
hkBst__ has joined #ocaml
ttamttam has joined #ocaml
ttamttam has quit [Client Quit]
alang_ has joined #ocaml
iratsu has joined #ocaml
hkBst__ has quit [Remote host closed the connection]
hkBst__ has joined #ocaml
|jbrown| has quit [Ping timeout: 248 seconds]
ttamttam has joined #ocaml
hkBst__ has quit [Ping timeout: 260 seconds]
ocp has quit [Ping timeout: 245 seconds]
hkBst__ has joined #ocaml
lolcathost has quit [Ping timeout: 252 seconds]
ftrvxmtrx_ has quit [Quit: Leaving]
|jbrown| has joined #ocaml
hkBst__ has quit [Quit: Konversation terminated!]
mye has quit [Ping timeout: 260 seconds]
mika1 has quit [Quit: Leaving.]
cago has left #ocaml []
djcoin has quit [Quit: WeeChat 0.3.9.2]
tac has joined #ocaml
Demitar_ has quit [Ping timeout: 255 seconds]
|jbrown| has quit [Ping timeout: 240 seconds]
Cyanure has quit [Remote host closed the connection]
mcclurmc has quit [Ping timeout: 255 seconds]
Yoric has quit [Ping timeout: 260 seconds]
ttamttam has quit [Quit: ttamttam]
ttamttam has joined #ocaml
ttamttam has quit [Client Quit]
ttamttam has joined #ocaml
thomasga has quit [Quit: Leaving.]
|jbrown| has joined #ocaml
ontologiae has quit [Read error: Connection reset by peer]
answer_42 has joined #ocaml
ontologiae has joined #ocaml
Demitar has joined #ocaml
ttamttam has quit [Quit: ttamttam]
mcclurmc has joined #ocaml
ppseafield has left #ocaml []
thomasga has joined #ocaml
gnuvince_ has joined #ocaml
Yoric has joined #ocaml
mattrepl has joined #ocaml
ontologiae has quit [Ping timeout: 248 seconds]
pango_ has joined #ocaml
pango has quit [Read error: Connection reset by peer]
pango_ is now known as pango
patronus1 has quit [Ping timeout: 256 seconds]
patronus_ has joined #ocaml
mattrepl has quit [Quit: mattrepl]
Kakadu has joined #ocaml
beckerb has joined #ocaml
_andre has quit [Quit: leaving]
diml has quit [Ping timeout: 260 seconds]
patronus_ has quit [Ping timeout: 240 seconds]
diml has joined #ocaml
shp has joined #ocaml
weie has quit [Quit: Leaving...]
Pantoufle has quit [Quit: Lost terminal]
shp has quit [Client Quit]
patronus_ has joined #ocaml
smondet has joined #ocaml
beginner42 has joined #ocaml
ocp has joined #ocaml
mye has joined #ocaml
beginner42 has quit [Quit: irc2go]
beckerb has quit [Ping timeout: 256 seconds]
|jbrown| has quit [Ping timeout: 276 seconds]
gnuvince_ has quit [Ping timeout: 276 seconds]
<Kakadu>
Guys, we have nohttp link in channel topic. Is it a typo or not?
<tac-tics>
are there any mature web frameworks for Ocaml?
_mdp has quit [Ping timeout: 260 seconds]
<thelema>
tac-tics: ocsigen and ...
<thelema>
ohm
<tac-tics>
ty
<watermind>
thelema: got it, I undertstand my mistake now... I was thinking of ocaml-core/base/core/lib as if it were the root, thank you again]
<thelema>
watermind: you're welcome
beckerb has quit [Ping timeout: 248 seconds]
lolcathost has quit [Ping timeout: 252 seconds]
beckerb has joined #ocaml
emmanuelux has joined #ocaml
<benmachine>
how do I syntax-check/typecheck my program without running it?
<benmachine>
...compile it, I guess
<thelema>
yes, compilation is recommended
* benmachine
shrug
<benmachine>
sure why not
<thelema>
bytecode compilation is quite fast, if you want to skip native codegen
<benmachine>
I think I mostly avoided it just because it meant writing more Makefile
<benmachine>
and having more files around the place
<thelema>
benmachine: ocamlbuild?
<benmachine>
but those aren't actually a big deal, on reflection
skier_ has joined #ocaml
<skier_>
so guys, i was wondering if anyone has ever wanted to use OCaml from Python (let's hope i'm not saying anything stupid here), but i'd like to do some cool pattern matching in OCaml while doing all unrelated stuff (reading files, dumping output) in Python
<thelema>
I've called python routines before from ocaml
<watermind>
is there any trick for detecting equality errors at compile time?
<skier_>
but first of all i can easily code something like that myself, and secondly it's not even close as good as OCaml for obvious reasons
<thelema>
watermind: equality errors? like trying to use (=) on functions?
<watermind>
thelema: yes
<thelema>
watermind: no, although there's been the idea of compiler support for this.
<watermind>
thelema: as in compiler warnings or type system extensions?
<thelema>
I've been plagued by this problem, and have added comparison combinators for batteries data structures to make constructing your own comparison functions
<thelema>
compiler warnings
<watermind>
right
chambart has joined #ocaml
<thelema>
and even these would be weak, as (=) can live inside a polymorphic function that happens to get applied to function values; that means that every function would need to know whether there's a polymorphic compare somewhere in it? eww...
<watermind>
exactly
pngl has joined #ocaml
<watermind>
well a compiler warning for every application of equality to polymorphic operators would be a start I guess
<pngl>
How can one tell if a type appears in a covariant/contravariant position (in the type of some value)?
<thelema>
pngl: polymorphic type definitions can have +/- to indicate variance
<pngl>
thelema: can it be inferred from the shape of the type? for instance, I am guessing that in 'a -> 'b -> 'c, 'a and 'b are in contravariant positions but not 'c?
<thelema>
pngl: ah, yes. if you're to the left of an arrow, you're generally contravariant
<benmachine>
unless you're to the left of an arrow that's to the left of an arrow :P
<thelema>
"more precisely, follow the left branch of an even number of arrows"
<benmachine>
...yeah, that's a more helpful description than mine
* benmachine
quiet
<thelema>
benmachine: if it helps, I don't really know what it means; I'm just copy/pasting
<benmachine>
oh
<thelema>
I rarely deal with subtyping in my ocaml code.
<benmachine>
well, in ('a -> 'b) -> 'c, 'a would be covariant, I think
lolcathost has joined #ocaml
<thelema>
Every time I try a non-trivial use of polymorphic variants or objects, it blows up on me and I have to go back to simpler code
<benmachine>
I'm not sure, because I don't know about subtyping /specifically/, but it would make sense
<pngl>
thelema, benmachine: thanks, it helps a lot.
<benmachine>
(basically two contravariants sort of "cancel out", like two negative numbers)
<benmachine>
(...being multiplied together, that is.)
<benmachine>
(sometimes being on the left of an arrow is called being in negative position, because of that analogy)
<benmachine>
(or so I understand it)
<pngl>
ok, ('a -> 'b) -> 'c makes sense. what about something like 'a list ref or 'a list?
<tac-tics>
benmachine: They cancel each other out more like two negations than two negative numbers, don't they? :)
<benmachine>
tac-tics: yeah, I suppose
<tac-tics>
The positive/negative position is related to who is responsible for creating the object
<tac-tics>
^ another way to think about it
<benmachine>
the way I think about it is, if I want to change that variable to a 'z, do I need ('a -> 'z), or do I need ('z -> 'a)
<tac-tics>
If a module defines an Int, it must produce it. If it defines an Char -> Int, I (the caller) am responsible for producing the Char, while the module produces the Int
<benmachine>
if the former, covariant, if the latter, contravariant
<benmachine>
so 'a -> int can be turned into 'z -> int by supplying 'z -> 'a and composing the two, so in 'a -> int the 'a is contravariant
<benmachine>
in 'a list ref, you can change it into 'z list ref with 'a -> 'z
<benmachine>
so it's covariant
<benmachine>
actually, wait
<benmachine>
no, that's fine, yes
<benmachine>
there *is* a function ('a -> 'b) -> 'a ref -> 'b ref
beckerb has quit [Ping timeout: 264 seconds]
<benmachine>
but it creates a new ref (obviously, in retrospect)
* benmachine
rambles
|jbrown| has quit [Remote host closed the connection]
<pngl>
benmachine: you are helping me quite a bit
<benmachine>
pngl: well, I like to think about it, too :)
smondet has quit [Ping timeout: 276 seconds]
ocp has quit [Quit: Leaving.]
<benmachine>
but I also like to eat dinner so I'm going to do that, like I meant to a few hours ago >_>
<watermind>
core's Monad module seems so small...
mye has quit [Quit: mye]
leoncamel has quit [Ping timeout: 252 seconds]
tane has quit [Quit: Verlassend]
wks has joined #ocaml
pngl has quit [Quit: Page closed]
cdidd has quit [Remote host closed the connection]
pkrnj has quit [Quit: Computer has gone to sleep.]
jamii has quit [Read error: No route to host]
dmilith is now known as tasks
pkrnj has joined #ocaml
tasks has left #ocaml []
thomasga has quit [Ping timeout: 252 seconds]
lolcathost has quit [Ping timeout: 256 seconds]
TDJACR has joined #ocaml
samposm has quit [Ping timeout: 255 seconds]
samposm has joined #ocaml
dwmw2 is now known as dwmw2_gone
ontologiae has joined #ocaml
PM has joined #ocaml
q66 has quit [Quit: Quit]
chambart has quit [Ping timeout: 246 seconds]
tac-tics has quit [Ping timeout: 245 seconds]
ontologiae has quit [Ping timeout: 264 seconds]
pkrnj has quit [Read error: Connection reset by peer]
pkrnj has joined #ocaml
RagingDave has quit [Quit: Ex-Chat]
emmanuelux has quit [Remote host closed the connection]