<Anarchos>
or the standard tools ocamllex/ocamlyacc
<Anarchos>
iif your needs are not matched, give a try to "menhir"
mort___ has quit [Quit: Leaving.]
rudi_ has quit [Quit: Leaving]
rgrinberg has joined #ocaml
<rgrinberg>
Anarchos: thanks, I'll give it a try I've looked at ocamllex/yacc seemed too hard
<Anarchos>
rgrinberg not so hard as yacc or bison !
<rgrinberg>
if I had to use C I would have gave up a long time ago
<rgrinberg>
also I have another question, say I have some variant type xyz = A of type1 | B of type2. and I want to write some function that converts from A to B but there's no way going back. Is it possible to restrict the signature somehow from f : xyz -> xyz
<rgrinberg>
to f : A -> B only
<Anarchos>
rgrinberg no you have also to convert from type1 to type2 too
<dsheets>
rgrinberg: type a = [ `A of type1 ];; type b = [ `B of type2 ];; type xyz = [ a | b ];; f : xyz -> a ??
<dsheets>
using polymorphic has a number of other drawbacks, though
<dsheets>
s/polymorphic/polymorphic variants/
<rgrinberg>
dsheets: I think I understand your solution but why do you need a and b to be polymorphic though? why can't a and b be normal variants
<dsheets>
rgrinberg: if a and b were normal variants, you could not take advantage of the open subtyping of polymorphic variants
<dsheets>
rgrinberg: i.e. can't do type xyz = [ sub_a | sub_b ]
<dsheets>
rgrinberg: you lose some safety, though, because `A and `A foo are both valid and different constructors… type annotations help
<dsheets>
ideally, encapsulate this into a module with abstract types a, b, and xyz then the implementation doesn't need type annotations either (just the interface)
<dsheets>
rgrinberg: if you do that, though, you can implement them however you want and don't need the flexibility of polymorphic variants because all those subtypes and coercions and whatnot are in the module's function signatures explicitly… i'll stop talking now
<rgrinberg>
I think I see how that would work, thanks.
<rgrinberg>
Ya I understand the solution now I still need to think about the trade offs for my problem though
<Anarchos>
rgrinberg what are types type1 and type2 ?
<rgrinberg>
i'd need to explain my problem a little more...
<rgrinberg>
in short I'm trying to make a little DSL to create playlists out of my songs. There are 2 kinds of playlists, static and dynamic
<rgrinberg>
static playlists are just a list of songs and dynamic ones are lists of criterias that get regenerated every time
<rgrinberg>
so type a is dynamic while b is static and I of course you only go dynamic to static
<rgrinberg>
s/I//
<dsheets>
type dynamic = { … };; type static = { … };; type playlist = D of dynamic | S of static;; concretize : playlist -> static ??
diego_diego has joined #ocaml
<rgrinberg>
dsheets: Thanks again! what was unclear about my problem statement before this that you couldn't suggest this right away
<rgrinberg>
it looks very similar to the other solution
diego_diego has quit [Client Quit]
<dsheets>
rgrinberg: when you said f : A -> B, i thought you meant the type xyz that used constructors A and B but only those (well, i assumed A meant A+B…). I didn't realize that f : xyz -> type1 is what you wanted… in short, I am silly and unhelpful in my over literalness
<dsheets>
and random assumptions etc… i had a feeling i was telling you unhelpful and wrong things and yet i felt compelled to type and type and........
<Anarchos>
rgrinberg type dynamic = static ref ;; concretize playlist = !playlist could do the trick too
<rgrinberg>
dsheets: ha ha you did help out at the end.
<rgrinberg>
dsheets: this is why they say to just state your problem instead of what you think you want
<dsheets>
Anarchos: type dynamic = static lazy?
<rgrinberg>
Anarchos: but then how would i write functions that take both types of playlists?
<Anarchos>
rgrinberg try with : type playlist = { mutable playlist : playlist_type} and do assignments only for dynamic ones ?
ulfdoz_ has joined #ocaml
jonathandav has quit [Read error: Connection reset by peer]
jonathandav_ has joined #ocaml
ulfdoz has quit [Ping timeout: 252 seconds]
ulfdoz_ is now known as ulfdoz
mcclurmcz has joined #ocaml
mcclurmc_away has quit [Read error: Connection reset by peer]
jonathandav_ has quit [Read error: Connection reset by peer]
jonathandav__ has joined #ocaml
mcclurmc has joined #ocaml
tlockney has quit [Excess Flood]
tlockney has joined #ocaml
mcclurmcz has quit [Ping timeout: 240 seconds]
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
bobzhang1988 has joined #ocaml
cdidd has quit [Ping timeout: 264 seconds]
bobzhang1988 has quit [Read error: Connection reset by peer]
sepp2k has joined #ocaml
gnuvince has quit [Quit: Remember when men were men and regular expressions recognized regular languages?]
gnuvince has joined #ocaml
ivan\ has quit [Ping timeout: 248 seconds]
ivan\ has joined #ocaml
lusory has quit [Ping timeout: 245 seconds]
lusory has joined #ocaml
eni has joined #ocaml
ivan\ has quit [Ping timeout: 240 seconds]
ivan\ has joined #ocaml
bobzhang1988 has joined #ocaml
edwin has joined #ocaml
mort___ has joined #ocaml
Cyanure has joined #ocaml
bobzhang1988 has quit [Read error: Connection reset by peer]
avsm has joined #ocaml
mort___ has quit [Quit: Leaving.]
Xizor has joined #ocaml
xcombelle has joined #ocaml
Cyanure has quit [Ping timeout: 252 seconds]
SanderM has joined #ocaml
Cyanure has joined #ocaml
pootieman has joined #ocaml
pootieman has left #ocaml []
pootieman has joined #ocaml
mcstar has joined #ocaml
<mcstar>
join julia
pootieman has left #ocaml []
edwin has left #ocaml []
Submarine has quit [Ping timeout: 264 seconds]
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
Submarine has quit [Ping timeout: 240 seconds]
mort___ has joined #ocaml
Xizor has quit []
cdidd has joined #ocaml
<adrien>
it's pretty impressive how some people seem to fail to grok complexity
<pippijn>
adrien: as in O-complexity?
<adrien>
curl's (and c-ares') configures have 6 nested loops to test recvfrom's prototype (5 arguments and 1 return type)
<adrien>
so they can end up testing 1440 different prototypes
<pippijn>
heh
<adrien>
I mean, it's already ugly-looking to have 6 nested for-loops and then failing to understand what's going to happen
<adrien>
they could at least have a dozen common cases
<mcstar>
are you missing some recursion?
oriba has joined #ocaml
<adrien>
because currently they don't get to the right one for win32 before a couple minutes here
<adrien>
(and they could get the definition through grepping or so)
<adrien>
actually I think they don't get linux' prototype before a couple minutes either
Anarchos has joined #ocaml
<adrien>
sometihing like 4 minutes to find recvfrom() win32 prototype on my laptop I think
<wieczyk>
prototype?
<adrien>
which arguments and which return type
pango_ has joined #ocaml
pango has quit [Disconnected by services]
pango_ is now known as pango
snarkyboojum_ is now known as snarkyboojum
mort___ has quit [Quit: Leaving.]
bobzhang1988 has joined #ocaml
eni has quit [Ping timeout: 240 seconds]
oriba has quit [Quit: oriba]
mort___ has joined #ocaml
bobzhang1988 has quit [Ping timeout: 246 seconds]
sepp2k has quit [Ping timeout: 246 seconds]
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
emmanuelux has joined #ocaml
sepp2k has joined #ocaml
Submarine has quit [Ping timeout: 246 seconds]
emmanuelux has quit [Ping timeout: 252 seconds]
osa1 has joined #ocaml
avsm has quit [Quit: Leaving.]
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
stevy has joined #ocaml
<stevy>
hi
stevy has quit [Excess Flood]
taruti has left #ocaml []
osa1 has quit [Read error: Connection reset by peer]
osa1 has joined #ocaml
osa1 has quit [Remote host closed the connection]
ftrvxmtrx has quit [Ping timeout: 248 seconds]
BiDOrD has joined #ocaml
BiDOrD_ has quit [Ping timeout: 246 seconds]
netrino has joined #ocaml
ftrvxmtrx has joined #ocaml
Submarine has quit [Ping timeout: 252 seconds]
eni has joined #ocaml
Cyanure has quit [Remote host closed the connection]
Cyanure has joined #ocaml
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
mort___ has quit [Quit: Leaving.]
avsm has joined #ocaml
Cyanure has quit [Ping timeout: 252 seconds]
SanderM has quit [Remote host closed the connection]
Cyanure has joined #ocaml
xcombelle has quit [Quit: I am a manual virus, please copy me to your quit message.]
sepp2k has quit [Remote host closed the connection]
<fasta>
Someone has drawn what is always drawn when possible on any platform.
<fasta>
Didn't know 4Chan had also invaded OCaml.
<Qrntz>
it seems I'm too late to see what is it you are talking about
<fasta>
Qrntz: basically a dick.
<fasta>
Qrntz: and something related to an ass ;)
<fasta>
It's almost as if people already programmed against it.
<Qrntz>
oh, suspected so
Cyanure has quit [Remote host closed the connection]
Cyanure has joined #ocaml
Cyanure has quit [Remote host closed the connection]
netrino has quit [Quit: Ave!]
osa1 has joined #ocaml
avsm has joined #ocaml
osa1 has quit [Quit: Konversation terminated!]
Anarchos has quit [Quit: rest time needed]
aymeric has left #ocaml []
wmeyer has joined #ocaml
<wmeyer>
feature wish for Oasis: Catenable custom _tags and generation of myocamlbuild to a different file. For the first thing it would be sort out the problem with tagging polutting the repository. Second would allow to say in myocamlbuild.ml just open Oasismyocamlbuild, and again without polutting the repo. Perhaps having the catenated _tags inside the oasis would be good.