<Ptival>
hi guys, do you know if there's a way to query the lib directory of ocaml?
lggr has joined #ocaml
lggr has quit [Ping timeout: 264 seconds]
lggr has joined #ocaml
<Qrntz>
Ptival, «ocamlc -where»?
<Ptival>
Qrntz: thanks
lggr has quit [Ping timeout: 248 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 252 seconds]
err404 has quit [Remote host closed the connection]
lggr has joined #ocaml
lggr has quit [Ping timeout: 244 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 248 seconds]
lggr has joined #ocaml
emmanuelux has quit [Ping timeout: 246 seconds]
lggr has quit [Ping timeout: 252 seconds]
Yoric has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
madroach has quit [Ping timeout: 265 seconds]
madroach has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 248 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
Catnaroek has joined #ocaml
hongboz has joined #ocaml
lggr has quit [Ping timeout: 252 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 252 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 268 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 264 seconds]
lggr has joined #ocaml
ghostbuster2 has joined #ocaml
lggr has quit [Ping timeout: 244 seconds]
fraggle_ has joined #ocaml
lggr has joined #ocaml
lggr has quit [Ping timeout: 264 seconds]
osa1 has quit [Quit: Konversation terminated!]
lggr has joined #ocaml
lggr has quit [Ping timeout: 264 seconds]
everyonemines has joined #ocaml
lggr has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
Yoric has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 240 seconds]
BiDOrD has joined #ocaml
lggr has joined #ocaml
BiDOrD_ has quit [Ping timeout: 268 seconds]
lggr has quit [Ping timeout: 240 seconds]
ghostbuster2 has quit [Ping timeout: 264 seconds]
wmeyer has quit [*.net *.split]
testcocoon has quit [*.net *.split]
snarkyboojum has quit [*.net *.split]
thelema_ has quit [*.net *.split]
wmeyer has joined #ocaml
lggr has joined #ocaml
45PAA27RV has joined #ocaml
testcocoon has joined #ocaml
snarkyboojum has joined #ocaml
thelema_ has joined #ocaml
lggr has quit [Ping timeout: 248 seconds]
45PAA27RV has quit [Ping timeout: 244 seconds]
thelema_ has quit [Write error: Broken pipe]
thelema has joined #ocaml
Catnaroek has quit [Quit: brb gais]
lggr has joined #ocaml
lggr has quit [Ping timeout: 268 seconds]
Yoric has quit [Ping timeout: 252 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 244 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 264 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 264 seconds]
lggr has joined #ocaml
thomasga has joined #ocaml
lggr has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 248 seconds]
lggr has joined #ocaml
tufisi has joined #ocaml
err404 has joined #ocaml
Snark has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
pango is now known as pangoafk
lggr has joined #ocaml
djcoin has joined #ocaml
Snark has quit [Ping timeout: 246 seconds]
lggr has quit [Ping timeout: 264 seconds]
lggr has joined #ocaml
sepp2k has joined #ocaml
lggr has quit [Ping timeout: 264 seconds]
<fasta>
How do you think GHC and the ocaml compiler compare? By sheer number of commits, GHC has had much more work, but that's of course only one variable and not a very useful one (perhaps GHC developers changed their backend 10 times for no good reason, etc. ).
lggr has joined #ocaml
cago has joined #ocaml
lggr has quit [Ping timeout: 244 seconds]
mika1 has joined #ocaml
edwin has joined #ocaml
Yoric has joined #ocaml
lggr has joined #ocaml
hkBst has joined #ocaml
hkBst has quit [Changing host]
hkBst has joined #ocaml
lggr has quit [Ping timeout: 245 seconds]
<flux>
ocaml is faster (in compilation), ghc has much more advanced optimizations. ocaml is probably easier to grasp & hack, no idea about ghc.
ocp has joined #ocaml
edwin has left #ocaml []
<fasta>
I have the impression that by first putting your program in tons of monadic layers, that it will be nothing short of a miracle if all those indirections are removed.
<fasta>
That is: the input language for typical Haskell programs is vastly more difficult than those of OCaml programs.
<fasta>
The default lazyness also adds to this problem.
<fasta>
While in principle it would be nicer to write in Haskell, it's just that it really isn't a language very well suited for execution on a Von Neumann architecture.
<fasta>
I have no doubt that such a miracle compiler could potentially be written. It's just that you would have to wait an hour to compile a 50 line program.
<flux>
I think the greatest 'danger' is that first you have fast code. then you make small modification. then suddenly your code doesn't satisfy some pattern, doesn't get optimized, and thus performs poorly.
<flux>
not sure if that happens in real life, though.
<fasta>
Sure, the 50lines ~ hour thing is not how it is currently.
<flux>
at least the stream fusion optimization sounds like something that has great opportunities for that to happen
<fasta>
I also think the language itself is more complex to parse by a computer.
<fasta>
There is a good reason why people say you have to develop a limited lookahead language.
lggr has joined #ocaml
<fasta>
Haskell is basically what results if you create some academic beauty, and OCaml is the result if you have a bunch of people who develop a language with industry feedback.
<fasta>
At least, AFAIK OCaml has been in use by French companies for a very long time.
<flux>
but there's no denying that haskell has a lot of people writing code for it
tufisi has quit [Ping timeout: 245 seconds]
<fasta>
flux: yeah, but how useful is it?
<flux>
it's nice to be able to build new code and find that the pieces of puzzle have already been written&debugged by some other people
<flux>
although I haven't particularly found things missing in the ocaml land either
<fasta>
flux: even gaussian elimination libraries didn't work 3 years ago in Haskell.
<flux>
and then there's caml4perl ;)
<flux>
(which actually works and is pretty nice to use, at least for small things)
<fasta>
flux: also for OCaml4?
<fasta>
flux: I think the only nice thing is the parallelism, but if you first lose a factor of 4 in single-threaded performance in Haskell, no amount of parallelism is going to catch up to that.
<flux>
actually the name was perl4caml. basically ocaml bindings for the perl library, allowing to execute perl code in the same process
<fasta>
flux: yes, I tried it with OCaml3.something.
<flux>
I think I've used it for doing puny-encoded domain names
<flux>
but then the algorithms wasn't that complicated that I just wrote it myself, to rid myself of the dependency. but it worked alright before.
<fasta>
Perl libraries aren't that good either.
<fasta>
For example, I was using strptime.
hkBst has quit [Read error: Connection reset by peer]
<fasta>
Then I upgraded the library and it stopped working...
lggr has quit [Ping timeout: 252 seconds]
<flux>
the quality varies, but I think many libraries are quite alright. and they encourage putting tests that are always executed during the install.
<djcoin>
Purity makes Haskell very different from Ocaml. Hard to compare the compiler and such then.
<fasta>
(so, I switched to Ruby for that specific problem)
<fasta>
flux: what do you prefer now?
hkBst has joined #ocaml
<flux>
fasta, I prefer OCaml
<fasta>
djcoin: you can write pure OCaml if you want without too much problems.
<fasta>
AFAIK, it's only mutable when you use the word mutable.
<flux>
although if I need to do a small app that needs access to some C library without bindings - then I use C
<flux>
or if it's text processing, or at work, I'll likely use Perl
djcoin has quit [Quit: WeeChat 0.3.7]
<fasta>
flux: is there any reason why you wouldn't use it at work?
<flux>
I haven't actually written anything worthwhile in Haskell.
djcoin has joined #ocaml
<flux>
fasta, I like my colleagues to be able to read and modify it
<djcoin>
damn, bug oO
<fasta>
flux: and they are scared of OCaml?
<djcoin>
fasta: the problem is not that you can wirte pure code of ocaml
<flux>
fasta, they don't even know what it is
chambart has joined #ocaml
<djcoin>
it is that you can't write unpure code in haskell
<fasta>
flux: as in: never heard of it?
hkBst has quit [Excess Flood]
<flux>
correct
<djcoin>
Thus the compiler can't perform tremendous optimization
<flux>
actually I've written a valgrind log analyzer in ocaml at work
lggr has joined #ocaml
<fasta>
djcoin: define 'unpure'.
<fasta>
djcoin: there is no definition of pure.
<flux>
..and at previous place I wrote a lot of other things, but there were a lot fewer people there (2)
<flux>
(as in people coding)
<djcoin>
impure *
<djcoin>
fasta: no side effects at all, no modification of datastructure
Cyanure has joined #ocaml
<fasta>
djcoin: the ST monad provides side-effects.
<fasta>
djcoin: also, I wouldn't even use a language which didn't provide side-effects in the first place.
<djcoin>
fasta: why ?
<fasta>
AFAIK, all database datastructures are written in C++ and are full of mutation.
<flux>
fasta, well, it only provides them as an optimization (the ST monad), you can implement ST monad functionally as well. it just won't perform as well.
<fasta>
djcoin: because certain algorithms depend on it.
<fasta>
djcoin: (for algorithmic complexity reasons, that is)
<fasta>
djcoin: it's the same with uninitialized memory.
hkBst has joined #ocaml
<fasta>
djcoin: if it's impossible to have an array filled with garbage, then it's probably not a serious programming language.
<fasta>
(all of these things are possible in Haskell, btw)
<djcoin>
fasta: if you need perf you could also code it in C/C++I guess
<fasta>
companion_cube: of course, that's ray-tracing, which is kind of a stupid benchmark.
<fasta>
companion_cube: (because there's almost no communication)
<fasta>
It would be more interesting to see a linear amount of communication.
<companion_cube>
well then, they should merge JoCaml into OCaml :)
<fasta>
It wouldn't surprise me if that would happen at some point.
<fasta>
It seems easy to maintain.
<flux>
it would surprise me, at least if it would go as-is
<fasta>
(two weeks after 4.00 was released, they released it)
<flux>
it has at least one backwards-incompatible syntax change currently, the & operator (although it's been deprecated for ocaml for a while, so I suppose it wouldn't be that bad)
Cyanure has quit [Remote host closed the connection]
<fasta>
It's also not really that interesting whether or not it is merged, since you can already use it.
hkBst has quit [Ping timeout: 264 seconds]
<flux>
true
<flux>
but then there are things like lwt, that could probably somehow work with it
lggr has joined #ocaml
<flux>
..and the new contender Async from Jane Street
<fasta>
I wonder if Jane Street would want to switch to Haskell if some oracle came by to do it for free.
<fasta>
I think they wouldn't want it.
Cyanure has joined #ocaml
hkBst_ has joined #ocaml
Cyanure has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
eikke has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
rgrinberg has quit [Ping timeout: 268 seconds]
hkBst_ has quit [Read error: Connection reset by peer]
hkBst_ has joined #ocaml
hkBst_ has quit [Changing host]
hkBst_ has joined #ocaml
lggr has joined #ocaml
lggr has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 244 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 248 seconds]
lggr has joined #ocaml
hkBst_ has quit [Read error: Connection reset by peer]
hkBst_ has joined #ocaml
hkBst_ has quit [Changing host]
hkBst_ has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 248 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 268 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
Yoric has quit [Ping timeout: 246 seconds]
lggr has quit [Ping timeout: 244 seconds]
hkBst_ has quit [Remote host closed the connection]
eni has joined #ocaml
hkBst_ has joined #ocaml
lggr has joined #ocaml
lggr has quit [Ping timeout: 245 seconds]
hkBst_ has quit [Read error: Connection reset by peer]
hongboz has quit [Ping timeout: 240 seconds]
hkBst_ has joined #ocaml
lggr has joined #ocaml
lggr has quit [Ping timeout: 252 seconds]
hkBst_ has quit [Remote host closed the connection]
hkBst_ has joined #ocaml
hkBst_ has quit [Changing host]
hkBst_ has joined #ocaml
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
Yoric has joined #ocaml
lggr has joined #ocaml
lggr has quit [Ping timeout: 252 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
ankit9 has joined #ocaml
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
chambart has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
_andre has joined #ocaml
lggr has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
eni has quit [Ping timeout: 248 seconds]
lggr has quit [Ping timeout: 248 seconds]
eikke has quit [Ping timeout: 268 seconds]
lggr has joined #ocaml
Tobu has quit [Ping timeout: 272 seconds]
lggr has quit [Ping timeout: 256 seconds]
Snark has joined #ocaml
Tobu has joined #ocaml
lggr has joined #ocaml
Kakadu has joined #ocaml
lggr has quit [Ping timeout: 245 seconds]
ftrvxmtrx has quit [Quit: Leaving]
ftrvxmtrx has joined #ocaml
lggr has joined #ocaml
CrazyThinker has joined #ocaml
chambart has joined #ocaml
lggr has quit [Ping timeout: 268 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
eikke has joined #ocaml
ftrvxmtrx has quit [Ping timeout: 268 seconds]
Drakken has quit [Ping timeout: 268 seconds]
lggr has quit [Ping timeout: 252 seconds]
lggr has joined #ocaml
Drakken has joined #ocaml
ftrvxmtrx has joined #ocaml
lggr has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
fraggle_laptop has quit [Remote host closed the connection]
<munga>
why Hashtbl.hash always returns the same value if I pass a record to it ?
<munga>
ignore my question ...
<munga>
buaaa.
munga has quit [Client Quit]
<thelema>
:)
lggr has joined #ocaml
lggr has quit [Ping timeout: 264 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
avsm has quit [Ping timeout: 252 seconds]
Cyanure has joined #ocaml
lggr has joined #ocaml
ocp has left #ocaml []
lggr has quit [Ping timeout: 268 seconds]
lggr has joined #ocaml
eikke has quit [Ping timeout: 256 seconds]
mika1 has quit [Quit: Leaving.]
cago has quit [Quit: Leaving.]
lggr has quit [Ping timeout: 246 seconds]
Snark has quit [Quit: Quitte]
Tobu has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 268 seconds]
avsm has joined #ocaml
Yoric has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
Tobu has joined #ocaml
avsm has quit [Quit: Leaving.]
err404 has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 240 seconds]
ulfdoz has joined #ocaml
Tobu has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
Tobu has joined #ocaml
cdidd has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
chambart has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
rgrinberg has quit [Ping timeout: 244 seconds]
lggr has quit [Ping timeout: 260 seconds]
ontologiae has quit [Ping timeout: 246 seconds]
sepp2k has quit [Ping timeout: 246 seconds]
sepp2k has joined #ocaml
lggr has joined #ocaml
osa1 has joined #ocaml
djcoin has quit [Quit: WeeChat 0.3.7]
lggr has quit [Ping timeout: 268 seconds]
lggr has joined #ocaml
paolooo has joined #ocaml
avsm has joined #ocaml
avsm1 has joined #ocaml
avsm has quit [Read error: Connection reset by peer]
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
eni has quit [Ping timeout: 244 seconds]
lggr has quit [Ping timeout: 246 seconds]
everyonemines has quit [Quit: Leaving.]
lggr has joined #ocaml
Yoric has joined #ocaml
thomasga has quit [Ping timeout: 248 seconds]
gnuvince has quit [Ping timeout: 245 seconds]
lggr has quit [Ping timeout: 268 seconds]
fraggle_laptop has quit [Remote host closed the connection]
lggr has joined #ocaml
lggr has quit [Ping timeout: 248 seconds]
diego_diego has joined #ocaml
sepp2k has quit [Ping timeout: 264 seconds]
diego_diego has quit [Read error: Connection reset by peer]
diego_diego has joined #ocaml
diego_diego has quit [Client Quit]
SpanishInquisitr is now known as NaCl
sepp2k has joined #ocaml
Tobu has quit [Ping timeout: 272 seconds]
lggr has joined #ocaml
Tobu has joined #ocaml
Tobu has quit [Ping timeout: 260 seconds]
lggr has quit [Ping timeout: 264 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
emmanuelux has joined #ocaml
lggr has joined #ocaml
dsheets has joined #ocaml
lggr has quit [Ping timeout: 244 seconds]
pangoafk is now known as pango
lggr has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
sgnb has quit [Remote host closed the connection]
sgnb has joined #ocaml
lggr has quit [Ping timeout: 264 seconds]
osa1 has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
edwin has joined #ocaml
lggr has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
edwin has quit [Remote host closed the connection]
edwin has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
err404 has joined #ocaml
lggr has joined #ocaml
Sablier_ has joined #ocaml
eudicot has quit [Ping timeout: 245 seconds]
eudicot has joined #ocaml
<thelema>
are there any experts on library link flags embedded in .cmxa files awake?
lggr has quit [Ping timeout: 248 seconds]
<thelema>
My problem is with mlpcap; the .cma file has linking options built into it, but the cmxa file - nothing
<thelema>
hmm, do .cmxa files even have this information built into them ever? bitstring is the same way...
edwin has left #ocaml []
<thelema>
my root problem is a linking error - undefined references to symbols defined in the dllpcap_stubs.so file
<thelema>
this file is installed in a directory in ocaml's ld.conf file
Sablier_ has quit [Ping timeout: 265 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 264 seconds]
sepp2k has quit [Read error: Connection reset by peer]
lggr has joined #ocaml
hongboz has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
eni has joined #ocaml
pngl has joined #ocaml
<pngl>
I'm new to Ocaml. I've seen people on emacs get a printout of the value of every line of a file whenever they do C-x C-b (I think). Is it possible to get the same result through a command-line tool?
lggr has joined #ocaml
<thelema>
pngl: hmm, you can paste a file into the toplevel
ghostbuster2 has joined #ocaml
<thelema>
pngl: run 'ocaml' and put your code into it, followed by ;;
<pngl>
thelema: thank you
<thelema>
ot make the toplevel easier to use (since it doesn't come with line editing), use 'rlwrap ocaml'
<wmeyer>
pngl: M-x tuareg-run-ocaml RET
<wmeyer>
pngl: or even way better: M-s utop RET
lggr has quit [Ping timeout: 246 seconds]
<wmeyer>
M-x
<wmeyer>
If you've installed ocaml from ocamlbrew utop come out of the box
<wmeyer>
just as it is.
<wmeyer>
now, if you don't use ocamlbrew than I would suggest trying it out :-)
* thelema
realizes that ocamlbrew is the first ocaml platform
<pngl>
wmeyer: doesn't your advice presuppose emacs?
<wmeyer>
thelema: indeed, today? :-) waaa
<wmeyer>
pngl: yes, it factly it does
<thelema>
wmeyer: for some reason, I was still awaiting someone to make an ocaml platform.
Yoric has quit [Ping timeout: 245 seconds]
<wmeyer>
pngl: I know ther are vim users, and still the workflows are different
<pngl>
wmeyer: I'm one of them :
<pngl>
wmeyer: :)
oriba has joined #ocaml
<wmeyer>
thelema: no worries, we are getting there. Still we have to work hard ;-)
<wmeyer>
pngl: YEAH!
<wmeyer>
:-)
lggr has joined #ocaml
<wmeyer>
thelema: it was long time ago recognised, we need it, but once we have the needed rudimentary tools and environment we can keep doing it.
<ghostbuster2>
hello, any ideas to setup ocaml to work in a window split with vim?
<pngl>
(If someone has a little script that feeds every line of a file to the toplevel so I don't have to write it myself, I'll be ever thankful)
<thelema>
ghostbuster2: just running 'ocaml' inside vim doesn't work?
<wmeyer>
pngl: press C-c e
<wmeyer>
pngl: preassuming tuareg mode, or typerex
<thelema>
wmeyer: stop trying to convert the vi user to emacs
<wmeyer>
pngl: these days i think my mode is tuareg, it sucks a lot of less battery
<wmeyer>
thelema: ups
<pngl>
wmeyer: I'll learn emacs one day, but not tonight
<wmeyer>
pngl: ok, so my excitement was premature sorry
<thelema>
pngl: I'm sure such a script exists, but don't know enough about the vi world to help
<ghostbuster2>
thelema, E492: Not a editor command, !ocaml returns to bash.... I would like to have ocaml running in a split an a file in other...
<pngl>
For whoever's interested: I went low-tech . I just edit in vim, then :w, Alt-Tab, C-p, RET with a readline-wrapped ocaml in another window and #use "myfile.ml";; as the last line.
lggr has quit [Ping timeout: 268 seconds]
<Anarchos>
pngl i edit in vim too
lggr has joined #ocaml
chambart has joined #ocaml
ghostbuster2 has quit [Ping timeout: 264 seconds]
<Anarchos>
chambart modulonet ? C'est marrant comme nom de réseau :)
lggr has quit [Ping timeout: 240 seconds]
<thelema>
Anarchos: #ocaml-fr
<Anarchos>
thelema oh sorry wrong language
<Anarchos>
chambart fun as a network name, modulonet :)
Yoric has quit [Ping timeout: 260 seconds]
gnuvince has joined #ocaml
lggr has joined #ocaml
avsm1 has quit [Quit: Leaving.]
lggr has quit [Ping timeout: 246 seconds]
smondet has quit [Remote host closed the connection]
ontologiae has joined #ocaml
lggr has joined #ocaml
hongboz has quit [Ping timeout: 246 seconds]
avsm has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
avsm has quit [Quit: Leaving.]
<pngl>
I want to capture two possible constructors of a recursive type t in one expression (to make pattern matching easier). Is that possible? (e.g. type t = C1 of string | C2 of C1, and I want an expression that matches "C1 of string" and "C2 C1 of string")
<thelema>
| C1 s | C2 (C1 s) -> ... s ...
<Anarchos>
thelema you were faster than me :)
<thelema>
this time.
<pngl>
Ah I can match multiple types on the left of -> ! :-) thank you.
avsm has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
<thelema>
you can match multiple patterns, separated by | before one ->, but make sure that they all bind the same identifiers with the same types
<thelema>
i.e. `| C1 s | C2 (C1 _) -> ...` is wrong
ontologiae has quit [Ping timeout: 268 seconds]
<pngl>
Can I do | C1 s as x | C2 (C1 _) as x -> x ?
<thelema>
| (C1 _) as x | C2 ((C1 _) as x) -> x
<thelema>
maybe some of the parens aren't needed
<pngl>
but both are of type t
<thelema>
but you can't bind s in one pattern and not in the other
<pngl>
sure
chambart has quit [Ping timeout: 246 seconds]
<pngl>
thanks!
<thelema>
n/p
ontologiae has joined #ocaml
chambart has joined #ocaml
eni has quit [Quit: Leaving]
lggr has joined #ocaml
avsm has quit [Quit: Leaving.]
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 264 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
wmeyer has quit [Remote host closed the connection]
lggr has joined #ocaml
lggr has quit [Ping timeout: 240 seconds]
<pngl>
Going back to my earlier question, I'm pattern matching on a pair. Each member can be one of 3 patterns. Is there something more elegant than writing 3² lines?
<thelema>
do you have 9 -> results?
<pngl>
no, one
<thelema>
you can use | in the middle of patterns
<thelema>
| (A | B | C), (A | B | C) -> ...
<thelema>
i gotta go; Anarchos - it's all you
<pngl>
oh yes. perfect. Alright, where should I read up on this so I don't have to ask here next time? Also, out of curiosity, is it possible to define an expression that will expand to a pattern? e.g. exp = A | B | B; and then | (exp, exp) -> ...;; ?
lggr has joined #ocaml
<pngl>
thelema: thanks!
<Anarchos>
pngl you can't define patterns as furst class values
err404 has quit [Remote host closed the connection]
<Anarchos>
cause the name is bound to the values while applying the pattern matching
ontologiae has quit [Ping timeout: 264 seconds]
avsm has joined #ocaml
gnuvince has quit [Ping timeout: 246 seconds]
<pngl>
I don't follow
avsm1 has joined #ocaml
gnuvince has joined #ocaml
lggr has quit [Ping timeout: 264 seconds]
wmeyer has joined #ocaml
avsm has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
oriba has quit [Quit: oriba]
lggr has quit [Ping timeout: 248 seconds]
<pngl>
Anarchos: couldn't the string of the pattern be interpolated at compile time?
lggr has joined #ocaml
CoverSlide has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
_andre has quit [Quit: leaving]
lggr has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
<Anarchos>
pngl try to do : let fun x => let p = A|B in match x with p -> 0 | _ -> 1;;
<Anarchos>
pngl i get syntax error on A|B
<Anarchos>
patterns can't be used to defined values as p
lggr has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 240 seconds]
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
lggr has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
ftrvxmtrx has joined #ocaml
chambart has quit [Ping timeout: 244 seconds]
lggr has quit [Ping timeout: 248 seconds]
lggr has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
chambart has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
emmanuelux has quit [Remote host closed the connection]