flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | Grab OCaml 3.10.2 from http://caml.inria.fr/ocaml/release.html (featuring new camlp4 and more!)
Jessehk has joined #ocaml
<aheller> I'm sort of stumped. What does this mean:
<aheller> Type Type.var = [ `Var ] is not compatible with type Type.any = [> ]
<aheller> The second variant type does not allow tag(s) `Var
<Smerdyakov> I guess the second type is occurring in a "rigid" context, where it can't be instantiated to a particular set of variant cases.
<aheller> What makes a context rigid?
<Smerdyakov> It's not a technical term. Maybe it would help for you to give your example program.
<aheller> sure thing;
<aheller> I have I Type.mli containing:
<aheller> type +'a ty
<aheller> type var = private [< `Var ]
<aheller> type tuple = private [< `Tuple ]
<aheller> type any = private [> `Any ]
<aheller> val tvar : string -> var ty
<aheller> val fn : any ty * any ty -> any ty
<aheller> (relevantly)
<aheller> (type tuple shouldn't be important there, actually)
<Smerdyakov> OK..
<aheller> and type.ml containing
<aheller> module I = Ident
<aheller> type var = private [< `Var ]
<aheller> type tuple = private [< `Tuple ]
<aheller> type any = private [> `Any ]
<aheller> type +'a ty = | TyVar of string | TyRow of (I.label * any ty) list | TyCon of any ty list * I.longtycon | TyTup of any ty list | TyFun of any ty * any ty
<aheller> And then definitions of tvar and fn that just call the constructors (tvar checks to make sure its argument starts with ')
<aheller> The goal is to make sure I don't screw up and put a type which isn't a type variable in a place where my AST demands that it be.
<Smerdyakov> I'm waiting to hear which piece of code elicits the error message....
<aheller> Oops, sorry: let foo = Type.tvar "'foo" in fn (foo,foo);;
<aheller> that gives:
<aheller> Type Ml.var = [< `Var ] is not compatible with type Ml.any = [> `Any ]
<aheller> The second variant type does not allow tag(s) `Var
<Smerdyakov> It's pretty obvious that a [Type.var Type.var] can never be used as a [Type.any Type.var].
<Smerdyakov> I think your use of private row types is not helping at all.
<aheller> I'm pretty slow, I guess. Why's that?
<aheller> That was cargo-cult programming.
<Smerdyakov> [var] must be [ [ `Var ] ], since you can't have empty polymorphic variant types.
<aheller> I've gone through a bunch of iterations of this trying to get things working, that's what the code looked like when I copied it.
<Smerdyakov> Clearly that type doesn't contain [`Any], which would be required to unify with [any].
<aheller> My impression was that [any] had a hidden type variable inside it.
<Smerdyakov> Yup, and you get the constructors of [any] by adding [`Any] to the fields of that hidden variable.
<Smerdyakov> So [`Any] is always included.
<Smerdyakov> Do you understand what the tokens beginning with backticks are?
<aheller> I presumed they were global, unary value constructors.
<aheller> err, nullary.
<Smerdyakov> Then you understood that [any] must take the form [ [ `Any | other stuff here ] ]?
<aheller> Are you saying I have things upside down?
<Smerdyakov> I don't know. I'm just saying that it's obvious why your code doesn't type-check, and I'm asking you a question that you haven't answered yet. :P
<aheller> I won't say I understood, then, but that's what I thought was going on.
<Smerdyakov> This is just getting confusing for me. I'm going to leave soon, but I suggest coming up with an explanation of why you think your code should work.
<aheller> Fair enough.
<aheller> Thanks for the help.
redocdam has quit [Remote closed the connection]
Morphous has joined #ocaml
Jessehk has quit ["Leaving"]
Morphous_ has quit [Connection timed out]
Kopophex has joined #ocaml
sponge45 has left #ocaml []
Axioplase has joined #ocaml
jlouis has quit [Read error: 110 (Connection timed out)]
Associat0r has joined #ocaml
Kopophex has quit [Read error: 110 (Connection timed out)]
Kopophex_ has joined #ocaml
Kopophex_ is now known as Kopophex
seafood has joined #ocaml
bluestorm has joined #ocaml
ygrek has joined #ocaml
RobertFischer has quit []
Kopophex has quit [Read error: 110 (Connection timed out)]
Proteus_ has quit [Read error: 110 (Connection timed out)]
Proteus_ has joined #ocaml
seafood has quit []
bluestorm has quit [Remote closed the connection]
seafood has joined #ocaml
Axioplase has quit ["leaving"]
hkBst has joined #ocaml
Linktim has joined #ocaml
ulfdoz has quit [clarke.freenode.net irc.freenode.net]
ecc has quit [clarke.freenode.net irc.freenode.net]
mbishop has quit [clarke.freenode.net irc.freenode.net]
Ugarte has quit [clarke.freenode.net irc.freenode.net]
dellsuck1 has quit [clarke.freenode.net irc.freenode.net]
dellsuck1 has joined #ocaml
ecc has joined #ocaml
ulfdoz has joined #ocaml
mbishop has joined #ocaml
Ugarte has joined #ocaml
pango_ has quit [Remote closed the connection]
pango_ has joined #ocaml
hkBst has quit ["Konversation terminated!"]
tomh has joined #ocaml
ygrek has quit [Remote closed the connection]
rwmjones has joined #ocaml
ygrek has joined #ocaml
asmanur has joined #ocaml
Proteus_ has quit [Read error: 113 (No route to host)]
seafood_ has joined #ocaml
seafood has quit [Read error: 104 (Connection reset by peer)]
ofaurax has joined #ocaml
jlouis has joined #ocaml
asmanur has quit [Read error: 110 (Connection timed out)]
munga_ has quit ["Ex-Chat"]
Yoric[DT] has joined #ocaml
pattern has quit [Read error: 110 (Connection timed out)]
seafood_ has quit []
Proteus has joined #ocaml
asmanur has joined #ocaml
asmanur has quit [Read error: 110 (Connection timed out)]
strangy has joined #ocaml
jlouis has quit ["Leaving"]
ygrek has quit [Remote closed the connection]
ygrek has joined #ocaml
sporkmonger has joined #ocaml
jjido has joined #ocaml
<jjido> Hello. Anyone familiar with the Aurochs parser?
<jjido> Uh, I'd like to use a source-to-XML parser like the one on the Aurochs web site. I found an example of it in the Aurochs java folder, but it does not compile. I wonder if there is an O'caml version?
<tsuyoshi> what is aurochs? never heard oif it before
<xevz> I guess. :)
<jjido> I thought it was not that unknown. http://caml.inria.fr/cgi-bin/hump.en.cgi?contrib=609
<jjido> yes xevz that is the one
seafood has joined #ocaml
<jjido> the sample I was talking about is http://aurochs.fr/cgi/demo.cgi
<flux> I've used aurochs
<flux> it comes with an application that does that source-to-xml transformation?
<flux> it's been some time I've used it though
<jjido> I think that the O'Caml version will work just fine. I just didn't look well in the examples folder.
<tsuyoshi> wow that uses a lot of memory for a parser
<flux> but it's convenient :)
Morphous is now known as Amorphous
<jjido> What is that error? File "calculator.ml", line 3, characters 0-17: Unbound module Aurochs_pack
<jjido> do I need an env variable or something?
<Smerdyakov> jjido, the official abbreviation is "OCaml." No apostrophe.
<jjido> Smerdyakov: are you sure? OK must be too long I used it. Sorry
<Smerdyakov> jjido, I'm sure. You can find a FAQ entry on the Caml web site.
<jjido> cool. Aurochs is impressive when it works, but the -parse option does not give good error messages.
ChristopheT has joined #ocaml
ChristopheT has left #ocaml []
redocdam has joined #ocaml
<flux> error messages are definitely the worst feature of aurochs
<flux> or perhaps one should say: the error message :). (well, there may be two distinct ones..)
<jjido> Actually, once you have a grammar it seems quite easy to extend it. (Trying to fix the provided Java grammar now)
<flux> yes, but sitting down, writing a complete grammar, and then starting to debug it will be painful :)
jlouis has joined #ocaml
Linktim_ has joined #ocaml
Jedai has joined #ocaml
Linktim has quit [Read error: 110 (Connection timed out)]
sporkmonger has quit []
Linktim_ has quit [Read error: 110 (Connection timed out)]
kryptiskt has joined #ocaml
ygrek has quit ["Leaving"]
pattern has joined #ocaml
ygrek has joined #ocaml
pango_ has quit [Remote closed the connection]
pango_ has joined #ocaml
pattern has quit [Remote closed the connection]
pattern has joined #ocaml
kryptiskt has left #ocaml []
marmotine has joined #ocaml
<Yoric[DT]> Well, my paper was rejected :(
Linktim has joined #ocaml
ofaurax has quit ["Leaving"]
vixey has joined #ocaml
seafood has quit []
sporkmonger has joined #ocaml
Mr_Awesome has quit ["aunt jemima is the devil!"]
|jeremiah has joined #ocaml
asmanur has joined #ocaml
thermoplyae has joined #ocaml
<flux> paper on what?
<flux> verifying c-programs?
<Yoric[DT]> No, monadic exceptions in OCaml.
thermoplyae is now known as SPACEBABY
SPACEBABY is now known as thermoplyae
GustNG1 has joined #ocaml
RobertFischer has joined #ocaml
ygrek has quit [Remote closed the connection]
asmanur has quit [Remote closed the connection]
OChameau has quit ["Leaving"]
dellsuck1 has left #ocaml []
Smerdyakov has left #ocaml []
Smerdyakov has joined #ocaml
Smerdyakov has quit ["Leaving"]
Smerdyakov has joined #ocaml
RobertFischer has quit ["Taking off -- check out http://smokejumperit.com and http://enfranchisedmind.com/blog/"]
vixey has quit ["* I'm too lame to read BitchX.doc *"]
mishok13 has joined #ocaml
strangy has quit ["Leaving"]
marmotine has quit [Read error: 60 (Operation timed out)]
Yoric[DT] has quit ["Ex-Chat"]
vixey has joined #ocaml
sporkmonger has quit []
marmotine has joined #ocaml
Linktim has quit ["Quitte"]
<fremo> 'lo, is it a problem to read a fd using a channel and writing on it with Unix.write ?
<fremo> I have a bug around "Buffer.add_channel buffer channel len"
<fremo> When I strace my program, the bug doesn't appear...
<fremo> If I replace this by "for i = 0 to len-1 do Buffer.add_channel buffer channel 1", it doesn't appear
<fremo> I have no clue on how to investigate more :/
<Smerdyakov> Why are you using a loop?
<fremo> just to try,
<fremo> the fact is that it workaround the problem
<fremo> ...It's a network socket...
<Smerdyakov> I can't help you with your question. Sorry. I just like to complain when people use loops. ;)
<fremo> :)
<fremo> I used the loop to see if there is enought data to read
<fremo> Maybe there is a race thing, I have a select behind that and maybe all the data isn't available when it says they are (at least after several read notifications)
<fremo> I hope this is my fault...
tomh has quit ["http://www.mibbit.com ajax IRC Client"]
<mfp> fremo: how do you know the appropriate len argument to add_channel?
<mfp> the docs say it'll try to read exactly len bytes, not at most len bytes
<fremo> it is the len I need, it's on a nonblock fd so I got Sys_blocked_io if there is not enough data
<fremo> then I try at the next select read notification
<fremo> I know that the data are here thanks to tcpdump
<fremo> I am not sure at 100% but a 99.9% that the data arrives
<mfp> I see. Are you getting an End_of_file exception or is it a different error?
<fremo> not in this precise case
<fremo> but the documentation is only mentionning End_of_file
<mfp> and you're getting something else?
<fremo> that's something to investigate
<fremo> other exceptions ?
<mfp> yes, what are you observing?
<fremo> I got something like Sys_error("connection closed") when the other side close the socket
<fremo> but I dont know how to observes more
<fremo> when I use strace or tcpdump, things go all right
<mfp> ouch
Associat0r has quit []
<mfp> My best guess was that the system might not be delivering the received data at once (maybe because it came in different packets?), but this doesn't explain the Sys_error.
thermoplyae has left #ocaml []
<fremo> the Sys_error is ok, it is to significate that the other side close the socket and that is expected,
<mfp> but is it when there's still buffered data?
<fremo> I am reading buffer.ml and pervasives.ml, add_channel call really_input...
<mfp> if it really signals EOF, it's OK, of course
<fremo> it is when I close it by myself on the other side
<vixey> Why aren't there linear types in ml?
<vixey> is it because type inference cannot be done or they are not useful or another reason?
<mfp> vixey: maybe because aliases are deemed useful?
<vixey> what is that
<mfp> according to http://en.wikipedia.org/wiki/Linear_type, linear types allow references but not aliases
<mfp> so you couldn't do let a = ... in f a; other_thing_with a
seafood has joined #ocaml
<mfp> doesn't seem to mix well with impurity
<fremo> which language use linear types ?
sbok has quit [Nick collision from services.]
<mfp> IIRC Clean
<vixey> I don't think Clean has linear types
<fremo> " * Clean Language is a questioning technique that is used especially in psychotherapy and coaching."
<fremo> :)
<mfp> hmm Clean uses uniqueness types which are somehow related to linear types
sbok has joined #ocaml
<fremo> I have to sleep now, cannot continue with eyes closed, thanks.
<mfp> sorry I couldn't help you, fremo
<fremo> no problem, I will try to figure that out tomorrow, I'll tell you if I got something interesting... thanks again
mtrimpe has joined #ocaml