<Ptival>
"both argument types appear for ‘A as int & string. This means that if we pass the variant tag ‘A to f, its argument should be both int and string."
<Ptival>
indeed, ast & string is hopeless
Tobu has quit [Read error: Connection reset by peer]
<Ptival>
f[x]: it would pass the compiler though, no? (as long as `Binding is never used)
<f[x]>
Ptival, why ask - just try
<Ptival>
sure
<f[x]>
it is meaningless - thee shall never passs!
<f[x]>
that's why I am wondering how it could appear in human-written code and what was that human thinking
<Drakken>
the [= syntax returns the same expression as regular [ syntax in original syntax.
<Drakken>
so it's the same semantics.
roha has joined #ocaml
<Drakken>
original syntax:
<Drakken>
| "["; OPT "|"; rfl = row_field; "]" ->
<Drakken>
<:ctyp< [ = $rfl$ ] >>
<f[x]>
holy, your problem is not with syntax
<f[x]>
the error message rightfully tells that type ast is abstract
<f[x]>
I am just pointing that even if you fix that - your code is still strange
<Drakken>
I'm just trying to extend a user-defined polymorphic variant type.
<f[x]>
then you need to apply functor with type sharing
krktz has left #ocaml []
lamawithonel__ has quit [Ping timeout: 244 seconds]
mononofu has joined #ocaml
mononofu has quit [Read error: Connection reset by peer]
eni has joined #ocaml
ankit9 has quit [Quit: Leaving]
lamawithonel__ has joined #ocaml
ankit9 has joined #ocaml
mononofu has joined #ocaml
untroubled has joined #ocaml
Anarchos has quit [Ping timeout: 276 seconds]
Anarchos has joined #ocaml
lamawithonel has joined #ocaml
lamawithonel__ has quit [Ping timeout: 276 seconds]
eni has quit [Ping timeout: 260 seconds]
untroubled has quit [Quit: leaving]
untroubled has joined #ocaml
roha has quit [Ping timeout: 260 seconds]
Hussaind has joined #ocaml
hiptobecubic has joined #ocaml
lamawithonel_ has joined #ocaml
lamawithonel has quit [Ping timeout: 276 seconds]
ankit9 has quit [Quit: Leaving]
lamawithonel__ has joined #ocaml
lamawithonel_ has quit [Ping timeout: 245 seconds]
caligula has quit [Ping timeout: 255 seconds]
cyphase has quit [Ping timeout: 244 seconds]
alpounet has joined #ocaml
lamawithonel has joined #ocaml
lamawithonel__ has quit [Ping timeout: 250 seconds]
caligula has joined #ocaml
cyphase has joined #ocaml
fabjan has left #ocaml []
smiler has joined #ocaml
eni has joined #ocaml
lamawithonel_ has joined #ocaml
lamawithonel has quit [Ping timeout: 256 seconds]
_andre has joined #ocaml
snearch has joined #ocaml
Cyanure has quit [Ping timeout: 276 seconds]
eni has quit [Quit: Leaving]
roha has joined #ocaml
lamawithonel__ has joined #ocaml
lamawithonel_ has quit [Ping timeout: 276 seconds]
mononofu has quit [Remote host closed the connection]
<Ptival>
is there a dichotomic search algorithm over supposedly-sorted arrays somewhere?
<Ptival>
actually nvm, I need something more specialized
larhat has quit [Quit: Leaving.]
letrec has joined #ocaml
Cyanure has joined #ocaml
lamawithonel has joined #ocaml
lamawithonel__ has quit [Ping timeout: 265 seconds]
<Anarchos>
Ptival look at smoothsort from Edsger Dijsktra
<Ptival>
Anarchos: that's irrelevant but interesting :)
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
BiDOrD has joined #ocaml
BiDOrD_ has quit [Ping timeout: 244 seconds]
alxbl has quit [Ping timeout: 252 seconds]
lamawithonel_ has joined #ocaml
lamawithonel has quit [Ping timeout: 256 seconds]
testcocoon has quit [Quit: Coyote finally caught me]
alxbl has joined #ocaml
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
testcocoon has joined #ocaml
ankit9 has joined #ocaml
s_p has joined #ocaml
emmanuel__ has joined #ocaml
Submarine has quit [Quit: Leaving]
<s_p>
Is there a way to shorten this pattern mathing - http://pastebin.com/ayAsT78t Not to repeat calling the function for every connective ?
snearch has quit [Quit: Verlassend]
Kakadu has joined #ocaml
<thelema>
s_p: you could change the connective to BinOp(And, p, q), etc.
hiptobecubic has quit [Ping timeout: 252 seconds]
<s_p>
thelema: thanks, I got it.
testcocoon has quit [Quit: Coyote finally caught me]
lamawithonel_ has quit [Ping timeout: 245 seconds]
lamawithonel__ has joined #ocaml
gnuvince has joined #ocaml
testcocoon has joined #ocaml
ankit9 has quit [Remote host closed the connection]
smondet has joined #ocaml
philed has joined #ocaml
TDJACR has quit [Changing host]
TDJACR has joined #ocaml
cdidd has joined #ocaml
lamawithonel has joined #ocaml
lamawithonel__ has quit [Ping timeout: 276 seconds]
avsm has joined #ocaml
untroubled has quit [Quit: leaving]
philed has quit [Ping timeout: 276 seconds]
philed has joined #ocaml
<philed>
Hey all. I'm running into problems when including multiple structures with overlapping type definitions. Am I doing something wrong, or is this a common issue?
<mrvn>
iirc you are not allowed to redefine types
<mrvn>
in modules
<philed>
Right, but I really wanna!
<mrvn>
philed: do you maybe want to open the modules?
<philed>
No, I think I want to include both. But now that I look at it again, I've got a different idea.
<mrvn>
philed: you can use stubs instead of include type t2 = M.t let foo = M.foo ...
oriba has joined #ocaml
<philed>
Yeah, but that might mean rewriting a large interface, and then I've got to remember to extra stubs if I ever decide to grow the interface.
<philed>
*to add extra stubs.
<mrvn>
then rename the original types.
roha has quit [Ping timeout: 260 seconds]
<philed>
I tried, but that causes other problems. I want to be able to apply both modules to the same collection of functors in one case, and in another case, I'd like to be able to merge the two modules.
<philed>
But I think I can avoid doing it.
<mrvn>
I think you can rename types when you apply the functor, something like Make(M with type t = t2)
<philed>
No, with constraints only apply to signatures.
<mrvn>
Make(struct include M type t = t2 end)
<philed>
Huh.
<philed>
Yeah, that's kinda obvious.
<mrvn>
Too bad you can't say struct include M type t2 = t untype t end
<philed>
Yeah, or just do a destructive type renaming like you can with signatures.
<philed>
But yeah, I don't know what that hadn't occurred to me. Cheers!
<mrvn>
philed: how do you rename a type in a signature?
<mrvn>
because then you can do (struct include type t2 = t end : signature)
<philed>
module type Foo = struct type t end
<philed>
module type Bar = type s include Foo with type t := s end
<philed>
Now Bar will only have the type s.
<philed>
It's a language extension with 3.12.
lamawithonel_ has joined #ocaml
lamawithonel has quit [Ping timeout: 276 seconds]
ocp has quit [Ping timeout: 272 seconds]
ftrvxmtrx has quit [Quit: Leaving]
cago has quit [Quit: Leaving.]
mika1 has quit [Quit: Leaving.]
<letrec>
how to compile with compilerlibs?
<letrec>
I have INCDIRS = /usr/lib/ocaml/compiler-libs in my makefile, but it doesn't work
<letrec>
INCDIR = +../compiler-libs doesn't work as well
<letrec>
I just want to be able to use a bunch of compiled modules which is a part of the package
alaincoste has joined #ocaml
alaincoste has left #ocaml []
oriba has quit [Quit: oriba]
iago has joined #ocaml
ftrvxmtrx has joined #ocaml
eni has joined #ocaml
<mrvn>
Programming would be so much easier with limitless memory.
letrec has quit [Ping timeout: 248 seconds]
mononofu has joined #ocaml
<mrvn>
Anyone know offhand how Gc.finalise is implemented? Would it slow down the GC to register a million of them?
Kakadu has quit [Quit: Konversation terminated!]
Cyanure has quit [Ping timeout: 260 seconds]
eni has quit [Ping timeout: 260 seconds]
<tchell>
oi... if I use ocamlbuild to create object files, it likes to put them in _build/foo.cmo, but if I #load "_build/foo.cmo" in the toplevel, somehow it doesn't call the module "Foo".
<tchell>
I can cd to _build to run the repl, but it feels like this strategy will break at some point.
<joelr>
mrvn: but is there a way to grab the envp pointer that was passed to the c main in the ocaml runtime?
<joelr>
mrvn: never mind, it's a whole string array. thanks!
larhat has joined #ocaml
cdidd has quit [Remote host closed the connection]
mononofu has quit [Remote host closed the connection]
roha has joined #ocaml
<joelr>
is anyone using TypeRex?
<joelr>
do you notice a significant lag when editing in emacs?
fraggle_ has joined #ocaml
err404 has quit [Ping timeout: 264 seconds]
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
Drakken has quit [Ping timeout: 256 seconds]
Drakken has joined #ocaml
gnuvince has quit [Ping timeout: 250 seconds]
<mrvn>
Poll: What is your solution to recursive modules/functions? Do you use rec, pass closures around or let fn = ref (fun () -> raise (Invalid_argument "not set yet"))?
<mrvn>
the modules/functions in this case being substantial: 150, 125, 98, 707 lines
tufisi has quit [Ping timeout: 245 seconds]
<hcarty>
mrvn: rec or functors if it helps get rid of the recursion
<hcarty>
mrvn: Or pass around modules in somewhat rare cases
<mrvn>
pass around modules would be the runtime equivalent to functors, right?
<hcarty>
mrvn: Somewhat. You could mix the two.
<hcarty>
Apply the functors in a function and pass the resulting modules around
<mrvn>
I have a graph and not just a simple ring. Might get tricky with functors.
<gildor_>
diml: ping ?
<mrvn>
hcarty: I would pass a module around if I need to pass more than one closur from a module I think. Seems easier than to build a record of closures.
<mrvn>
first class modules are still new
<diml>
gildor_: pong
oriba has joined #ocaml
<hcarty>
mrvn: That's where I have ended up passing modules around. It's a bit more verbose in some cases than records but the intent can be clearer.
<mrvn>
gildor_: any way to remove spaces from empty lines in setup.ml?
<mrvn>
hcarty: can you pass the "self" module around?
<gildor_>
diml: hi, is there a way to know the number of active lwt thread
<gildor_>
mrvn: because it is unnerving to see emacs removing them when you try to edit setup.ml ?
<hcarty>
mrvn: Not that I know of... maybe you could with recursive modules?
<gildor_>
mrvn: I was not aware of this kind of issue before C. Troestler told me
<mrvn>
gildor_: or if they end up in quilt.
<mrvn>
gildor_: overall they are just a waste of good bytes. :)
<gildor_>
mrvn: this is on my todo list (but in my head), open a feature request/bugs if you want to be sure it doesn't get out of my head
<mrvn>
gildor_: how do I tell emacs to remove spaces from empty lines in tuareg mode?
<gildor_>
mrvn: I am already chasing them in commits
<gildor_>
mrvn: don't know, don't use emacs
<mrvn>
I found that sometimes it leaves some behind. And when I grepped for "^ *$" I noticed tons of matches in setup.ml and myocamlbuild.ml. :)
<diml>
gildor_: by active you mean ones that are waiting for an event ?
<gildor_>
diml: I want to know if there are still running threads in ocsigen before deciding that I get an error in the unit test of oasis-db
<gildor_>
diml: I am not really precise about the meaning, because I don't really know
<gildor_>
diml: let says i have bunch of threads that might create a file, and I want to be sure that I fail because this file will never be created
<gildor_>
diml: I want to know which threads are waiting for socket event...
<joelr>
any clues on this? Error: An external function with more than 5 arguments requires a second stub function
<joelr>
for native-code compilation
<gildor_>
joelr: std native/bytecode binding ?
<mrvn>
gildor_: oasis question: Why do I get a settler.native link but no settler link?
<joelr>
gildor_: i'm building for native code, though. hmm… i guess i need to provide the bytecode function too.
<gildor_>
mrvn: you didn't see this 8bit maps on April 1st ?
<gildor_>
mrvn: what is your game about ?
<hcarty>
diml: Do you know of an implementation of Rtime with Lwt's React wrapper?
<mrvn>
gildor_: I did.
<diml>
gildor_: it should be possible to know if threads are waiting on a socket
<mrvn>
gildor_: A clone of Siedler 3
<diml>
hcarty: i don't know Rtime very well
<mrvn>
gildor_: or wideland but without the manual roads Siedler 1/2 had.
fraggle_laptop has quit [Remote host closed the connection]
<gildor_>
mrvn: nice project
<gildor_>
mrvn: I think I played "The Settlers" 10 years ago
<mrvn>
gildor_: I think the last was Settler 7.
<gildor_>
mrvn: ah hem, no... either Settlers 2 or 3 in fact
<gildor_>
surely not after
<mrvn>
gildor_: Settler 7 is younger than 10 years
<mrvn>
I just ment that the franchise is still alive
<gildor_>
mrvn: you know there is time you say something, and realize that 5 years of your life has disappeared in the meantime
<mrvn>
scary, isn't it?
<gildor_>
more than you think
<hcarty>
diml: Ok, just curious. I'd like to have a timeline in an Lwt-using project. Rtime looked potentially interesting since Lwt comes with React support already.
<gildor_>
diml: nevermind, I just realize that I already have a timeout of 60s and it didn't work
<gildor_>
diml: maybe it is just that Inotify is too fast too notify me
<gildor_>
I should wait 1s before reading the file.
<gildor_>
it works when verbose is turned on, must be a timing issue
roha has quit [Ping timeout: 250 seconds]
<mrvn>
gildor_: tomorrow I can add the code for the buildings to do something. The green roofed one is supposed to send out a tux that plants trees and the red one one that chops them down and produces tree trunks.
smondet has quit [Quit: Leaving, happy hacking!]
joelr has quit [Quit: joelr]
cdidd has joined #ocaml
Cyanure has quit [Remote host closed the connection]