shp changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 4.00.1 http://bit.ly/UHeZyT | nohttp://www.ocaml-lang.org | Public logs at http://tunes.org/~nef/logs/ocaml/
wks has joined #ocaml
gnuvince_ has joined #ocaml
mattrepl has joined #ocaml
mattrepl has quit [Client Quit]
dwmw2 is now known as dwmw2_gone
lolcathost has quit [Ping timeout: 260 seconds]
lolcathost has joined #ocaml
cdidd has quit [Read error: Connection reset by peer]
madroach has quit [Ping timeout: 248 seconds]
madroach has joined #ocaml
lolcathost has quit [Ping timeout: 248 seconds]
lolcathost has joined #ocaml
weie has joined #ocaml
myx has joined #ocaml
tac has joined #ocaml
pkrnj has quit [Ping timeout: 240 seconds]
pkrnj has joined #ocaml
gour has joined #ocaml
lolcathost has quit [Ping timeout: 265 seconds]
lolcathost has joined #ocaml
mye has joined #ocaml
lolcathost has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
lolcathost has joined #ocaml
mye has quit [Ping timeout: 240 seconds]
wks has quit [Quit: Konversation terminated!]
pkrnj has quit [Quit: Textual IRC Client: www.textualapp.com]
tac has quit [Ping timeout: 245 seconds]
mye has joined #ocaml
Demitar has quit [Ping timeout: 265 seconds]
lolcathost has quit [Ping timeout: 260 seconds]
ttamttam has joined #ocaml
Snark_ has joined #ocaml
Snark_ is now known as Snark
ttamttam has quit [Quit: ttamttam]
lolcathost has joined #ocaml
ttamttam has joined #ocaml
lolcathost has quit [Ping timeout: 276 seconds]
osa1 has joined #ocaml
lolcathost has joined #ocaml
lolcathost has quit [Client Quit]
Demitar has joined #ocaml
answer_42 has joined #ocaml
hkBst has joined #ocaml
hkBst has quit [Changing host]
hkBst has joined #ocaml
lolcathost has joined #ocaml
cago has joined #ocaml
hkBst has quit [Client Quit]
hkBst has joined #ocaml
hkBst has quit [Changing host]
hkBst has joined #ocaml
hkBst has quit [Client Quit]
hkBst has joined #ocaml
hkBst has quit [Changing host]
hkBst has joined #ocaml
philed has joined #ocaml
mika1 has joined #ocaml
Yoric has joined #ocaml
ttamttam has quit [Quit: ttamttam]
hkBst_ has joined #ocaml
hkBst_ has quit [Changing host]
hkBst_ has joined #ocaml
ttamttam has joined #ocaml
thomasga has joined #ocaml
hkBst has quit [Ping timeout: 248 seconds]
cdidd has joined #ocaml
fayden has quit [Ping timeout: 248 seconds]
pango_ has joined #ocaml
hkBst_ has quit [Ping timeout: 248 seconds]
hkBst_ has joined #ocaml
hkBst_ has quit [Changing host]
hkBst_ has joined #ocaml
pango has quit [Ping timeout: 260 seconds]
ocp has joined #ocaml
hkBst_ has quit [Ping timeout: 248 seconds]
pango_ is now known as pango
Pantoufle has joined #ocaml
fayden has joined #ocaml
<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
<thelema> read the part "using preprocessors"
ttamttam has quit [Quit: ttamttam]
<thelema> the line "camlp5o -I . -I ioxml-0.9 pa_ioXML.cmo" can be put in a magic comment
<vincenzoml> oh, thanks
<vincenzoml> I see
<thelema> although the tricky part will be compiling pa_ioXML.ml to produce the cmo for pre-processing
<vincenzoml> I can do that separately in the end
<vincenzoml> I already have the makefile for ioxml
<thelema> it has to be done at the beginning, before compiling your code
jamii has joined #ocaml
RagingDave has joined #ocaml
<hcarty> thelema: I think there was a discussion replacing ( |- ) with ( %> ) - Do you know where that took place?
<hcarty> discussion ON replacing...
<thelema> hcarty: yes, one of the closed issues in batteries, IIRC
<hcarty> thelema: Cool, thanks
<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
<thelema> hcarty: ah, good.
<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?
pkrnj has joined #ocaml
<orbitz> i think so
<orbitz> shoudl probably just be http://www.ocaml.org too
ontologiae has joined #ocaml
adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 4.00.1 http://bit.ly/UHeZyT | http://www.ocaml-lang.org | Public logs at http://tunes.org/~nef/logs/ocaml/
<adrien> thanks
adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 4.00.1 http://bit.ly/UHeZyT | http://www.ocaml.org | Public logs at http://tunes.org/~nef/logs/ocaml/
|jbrown| has joined #ocaml
gustav__ has quit [Remote host closed the connection]
gustav__ has joined #ocaml
gnuvince_ has joined #ocaml
watermind has joined #ocaml
<watermind> was reading about polymorphic variants, and saw that you can and up with conjuntions of type, e.g. char & int
tane has joined #ocaml
<watermind> do these conjuntions a & b do ever have any inhabitants for a different from b?
<watermind> what does the & stand for? unification?
<orbitz> where do you see it?
myx has quit [Ping timeout: 256 seconds]
<tac> char & int just means an ordered pair type
<tac> It conains both a character and an integer
<tac> the & stands for "and" because you need both a char "and" an int to create one.
<watermind> # let f1 = function `A x -> x = 1 ;; # let f2 = function `A x -> x = 'a' ;; # let h x = f1 x && f2 x ;;
<watermind> val h : [< `A of char & int ] -> bool = <fun>
<watermind> ^
<orbitz> ah interesting
<watermind> tac: that shouldn't be the case in that code though
Kakadu has quit []
<tac> ah, sorry, I'm trying to answer a different kind of question
<watermind> tac: isn't ordered pair denoted by *
<tac> nevermind me!
<watermind> tac: ops!
<watermind> sorry
<watermind> my guess is that the & denotes unification
<watermind> but was wondering if there was more to it than that
chambart has quit [Ping timeout: 240 seconds]
ontologiae has quit [Ping timeout: 252 seconds]
osa1 has quit [Ping timeout: 255 seconds]
answer_42 has quit [Remote host closed the connection]
gnuvince_ has quit [Ping timeout: 248 seconds]
gour has quit [Quit: WeeChat 0.3.8]
<thelema> watermind: yes, & means that both types must be satisfied.
pkrnj has quit [Quit: Computer has gone to sleep.]
tac_ has joined #ocaml
tac_ is now known as tac-tics
tac has quit [Ping timeout: 245 seconds]
mrpantoufle has joined #ocaml
mrpantoufle has left #ocaml []
mrpantoufle has joined #ocaml
pkrnj has joined #ocaml
mrpantoufle has left #ocaml []
mrpantoufle has joined #ocaml
dwmw2_gone is now known as dwmw2
hto has quit [Read error: Connection reset by peer]
hto has joined #ocaml
elixey has quit [Remote host closed the connection]
milosn_ has joined #ocaml
milosn has quit [Ping timeout: 276 seconds]
<watermind> thelema: thanks!
<thelema> watermind: you're welcome
gnuvince_ has joined #ocaml
lolcathost has joined #ocaml
Yoric has quit [Ping timeout: 256 seconds]
mbac has quit [Quit: FUCK]
mgodshall has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
elixey has joined #ocaml
xavierm02 has quit [Quit: Leaving]
Snark has quit [Quit: Quitte]
beckerb has joined #ocaml
<watermind> how do you navigate source code in OCaml? In particular, how do you find where modules are defined?
<thelema> There's not necessarily an easy way.
<watermind> is there a way? :)
<thelema> generally module Foo is defined in foo.ml
<thelema> if you're wanting to navigate a compiled library, best to hope they provide html docs
<watermind> right, I looked for that but no such file existed
<thelema> after that, check your 'open's
<thelema> Foo must then be inside some opened module
<thelema> If you're trying to navigate core, I'm not sure I can help with any specifics; they're generous with module tricks
<watermind> yes, that's how I was trying to do it, but for instance the first open in this file is "open Sexplib.Std",
<watermind> thelema: yes I was trying to navigate core...
<watermind> so I looked at that first open and assumed there was some sexplib.ml file with a std submodule
<watermind> but apparently I was wrong
<watermind> thanks!
<thelema> watch out for "include Foo"
<watermind> maybe I'm missing something, but while I see this gives me the interface, what if I want to look at the source... does it help me find it?
<thelema> once you know the base module, you can look up the source in ...
<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
<skier_> yes, i was just reading that
<skier_> but the tarball dates back to 2003-ish
<skier_> lol
<thelema> never tried; may not work
<skier_> was also just reading that.. maybe somebody has good/bad experience about it>
<skier_> yeah, i see
<thelema> I use pycaml before, not so difficult
<thelema> you may wish to just try batteries for better IO
<skier_> with Py 2.7 ?
PM has quit [Ping timeout: 246 seconds]
<thelema> I used pycaml with 2.6 iirc. It was a while ago
<skier_> my ocaml is fairly rusty (i.e., only used it once or twice), but the pattern matching is awesome enough to use it more
<skier_> interesting
<tac-tics> skier_: pattern matching is the best
<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> http://caml.inria.fr/pub/docs/manual-ocaml/manual016.html <- paragraph starting "The optional type parameters"
<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]
ftrvxmtrx has quit [Ping timeout: 240 seconds]