SEcki has quit [Read error: Connection reset by peer]
yakischloba has quit [Quit: Leaving.]
enthymeme has quit [Quit: rcirc on GNU Emacs 23.1.1]
Associat0r is now known as fsharp
philtor has joined #ocaml
ztfw has quit [Read error: Operation timed out]
ztfw has joined #ocaml
yakischloba has joined #ocaml
boscop_ has joined #ocaml
philtor has quit [Ping timeout: 258 seconds]
eb4890 has quit [Remote host closed the connection]
netytan has joined #ocaml
maskd has quit [Quit: leaving]
<netytan>
Hi guys. It's been a while since I used Ocaml so I wanted to check something before I make myself look like an idiot :)
<thelema>
go ahead
<netytan>
With pattern matching, cases are tested top-to-bottom yes?
<thelema>
yup
<netytan>
thelema: So cases are certainly not matched simultaneously (at least from a semantic point of view)
<netytan>
?
<thelema>
otherwise match cases like [| _ -> foo] wouldn't be useful
<netytan>
Thelema: that was my thinking :).
<thelema>
yes, the semantics is to check each case top to bottom.
<netytan>
thelema: One last thing if you don't mind.
<netytan>
Is there any truth to the following statements – The match cases are completely independent. They will be matched simultaneously using a dispatch table and not sequentially. Later match cases are not dependent upon earlier match cases at all.
<thelema>
umm... when possible, the compiler builds a dispatch table.
<netytan>
thelema: but that's an implementation detail for optimisation and doesn't effect the semantics correct?
<thelema>
but I often have patterns that could match the same data, and it's always the first one that gets run
<thelema>
yes, it's just an implementation detail
<netytan>
thelema: Thanks a lot :).
<thelema>
n/p
<netytan>
You've been most helpful
<netytan>
Goodnight
<thelema>
cheers
netytan has quit [Quit: netytan]
struktured_ has left #ocaml []
Shoggoth has joined #ocaml
drk-sd has quit [Quit: {'EXIT', drk-sd, "bye"}]
enthymeme has joined #ocaml
tmaedaZ has quit [Ping timeout: 260 seconds]
tmaedaZ has joined #ocaml
ulfdoz has joined #ocaml
mrvn has quit [Ping timeout: 245 seconds]
mrvn has joined #ocaml
tps_ has joined #ocaml
fsharp is now known as Associat0r
thrasibule has quit [Ping timeout: 260 seconds]
jcaose has joined #ocaml
avsm has quit [Ping timeout: 245 seconds]
jcaose has left #ocaml []
avsm has joined #ocaml
avsm has quit [Client Quit]
thrasibule has joined #ocaml
myu2 has joined #ocaml
linus5 has quit [Ping timeout: 245 seconds]
linus5 has joined #ocaml
valross has quit [Remote host closed the connection]
ygrek has joined #ocaml
ttamttam has joined #ocaml
joewilliams is now known as joewilliams_away
ulfdoz has quit [Ping timeout: 276 seconds]
enthymeme has quit [Quit: g'night world. Rest in Peace, Jaime Escalante :<]
yakischloba has quit [Quit: Leaving.]
f[x] has joined #ocaml
ikaros has joined #ocaml
myu2 has quit [Remote host closed the connection]
Submarine has quit [Ping timeout: 246 seconds]
BiscuitsLap has joined #ocaml
Shoggoth has quit [Quit: Ex-Chat]
myu2 has joined #ocaml
Yoric has joined #ocaml
myu2 has quit [Remote host closed the connection]
ygrek has quit [Remote host closed the connection]
Associat0r has quit [Ping timeout: 265 seconds]
myu2 has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
ygrek has joined #ocaml
_zack has joined #ocaml
ikaros has quit [Quit: Leave the magic to Houdini]
oc13 has joined #ocaml
rwmjones is now known as rwmjones_afk_all
rwmjones_afk_all is now known as rwmjones|afk_tod
rwmjones|afk_tod is now known as rwmjones_afk
_zack has quit [Quit: Leaving.]
BiscuitsLap has quit [Ping timeout: 276 seconds]
_zack has joined #ocaml
Snark has joined #ocaml
Snark_ has joined #ocaml
Snark__ has joined #ocaml
Snark has quit [Remote host closed the connection]
Snark_ has quit [Read error: Connection reset by peer]
Snark__ has quit [Read error: Connection reset by peer]
Snark has joined #ocaml
Associat0r has joined #ocaml
BiscuitsLap has joined #ocaml
Yoric has quit [Quit: Yoric]
ftrvxmtrx has joined #ocaml
myu2 has quit [Ping timeout: 276 seconds]
tmaedaZ has quit [Read error: Operation timed out]
myu2 has joined #ocaml
BiscuitsLap has quit [Ping timeout: 265 seconds]
tmaedaZ has joined #ocaml
humasect has joined #ocaml
Yoric has joined #ocaml
pimmhogeling has joined #ocaml
myu2 has quit [Read error: No route to host]
myu2 has joined #ocaml
pimmhogeling has quit [Ping timeout: 265 seconds]
pimmhogeling has joined #ocaml
boscop_ has left #ocaml []
boscop has joined #ocaml
myu2 has quit [Read error: No route to host]
myu2 has joined #ocaml
dv_ has quit [Remote host closed the connection]
Associat0r has quit [Quit: Associat0r]
myu2_ has joined #ocaml
dark has joined #ocaml
myu2 has quit [Ping timeout: 265 seconds]
myu2_ has quit [Remote host closed the connection]
barismetin has joined #ocaml
barismetin has quit [Changing host]
barismetin has joined #ocaml
oc13 has quit [Ping timeout: 245 seconds]
myu2 has joined #ocaml
tps_ has quit [Ping timeout: 252 seconds]
tps_ has joined #ocaml
_andre has joined #ocaml
smimou has quit [Ping timeout: 246 seconds]
smimou has joined #ocaml
f[x] has quit [Ping timeout: 276 seconds]
drk-sd has joined #ocaml
_zack has quit [Quit: Leaving.]
f[x] has joined #ocaml
spearalot has joined #ocaml
fraggle_ has quit [Ping timeout: 276 seconds]
fraggle_ has joined #ocaml
fraggle_ has quit [Read error: Connection reset by peer]
myu2 has quit [Remote host closed the connection]
ztfw has quit [Read error: Operation timed out]
myu2 has joined #ocaml
dark has quit [Remote host closed the connection]
humasect has quit [Quit: Leaving...]
ztfw has joined #ocaml
myu2 has quit [Remote host closed the connection]
drk-sd has quit [Quit: {'EXIT', drk-sd, "bye"}]
mrvn has quit [Ping timeout: 248 seconds]
mrvn has joined #ocaml
vdrab has joined #ocaml
Submarine has joined #ocaml
ikaros has joined #ocaml
avsm has joined #ocaml
ikaros has quit [Quit: Leave the magic to Houdini]
ikaros has joined #ocaml
mjonsson has quit [Ping timeout: 246 seconds]
eldragon has joined #ocaml
drk-sd has joined #ocaml
joewilliams_away is now known as joewilliams
pimmhogeling has quit [Remote host closed the connection]
_unK has joined #ocaml
f[x] has quit [Read error: Connection reset by peer]
bmp has quit [Quit: bmp]
lokydor has joined #ocaml
pimmhogeling has joined #ocaml
ccasin has joined #ocaml
SEcki has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
eb4890 has joined #ocaml
f[x] has joined #ocaml
f[x] has quit [Client Quit]
f[x] has joined #ocaml
spearalot has quit [Quit: -arividerchi]
rwmjones_afk is now known as rwmjones
<flux>
thelema, hmm.. how would one suspend ParserCo parsing? I'd like to return a return value immediately I have something to return
<flux>
ParserCo.Source looks relevant
<flux>
or maybe not
oc13 has joined #ocaml
derdon has joined #ocaml
yakischloba has joined #ocaml
f[x] has quit [Ping timeout: 268 seconds]
krankkatze has joined #ocaml
chupish has joined #ocaml
BiscuitsLap has joined #ocaml
avsm has quit [Quit: Leaving.]
ttamttam has quit [Quit: Leaving.]
lokydor has quit [Quit: leaving]
tps_ has quit [Quit: Leaving]
ftrvxmtrx has joined #ocaml
ulfdoz has joined #ocaml
ikaros has quit [Quit: Leave the magic to Houdini]
<flux>
whee
<flux>
thelema, I made a patch that makes this work: let rec parser_test () = any >>= function | 'X' -> return `Fin | ch -> suspend (parser_test ()) >>= fun suspension -> return (`Suspend suspension)
barismetin has quit [Quit: Leaving...]
yakischloba has quit [Quit: Leaving.]
lokydor has joined #ocaml
<flux>
thelema, I pushed such a change (along with min_binding/max_binding addition to Map) to http://www.modeemi.fi/~flux/software/git/batteries-included.git/, commit e1ef067df7484b9a9f26d453c796e643a130dc44 for suspend and 2cda2389d1fbe87ff49d721254046961c73777a8 for Map
lokydor has quit [Client Quit]
_zack has joined #ocaml
lokydor has joined #ocaml
lokydor has quit [Client Quit]
lokydor has joined #ocaml
lokydor has quit [Client Quit]
lokydor has joined #ocaml
<derdon>
noooooooooooooooooo
<derdon>
fuck fuck fuck
<derdon>
I didn'T want to remove this directory!
<derdon>
damn
<julm>
duh :/
<derdon>
and no backup
<derdon>
no DVCS yet
ulfdoz has quit [Ping timeout: 265 seconds]
avsm has joined #ocaml
<Camarade_Tux>
ext3?
<derdon>
alias rm='rm -i' will help in future :/
<derdon>
Camarade_Tux: yes
<derdon>
Camarade_Tux: do you know how to restore it then?
chupish has left #ocaml []
<Camarade_Tux>
I think you can recover your files to some extent but I don't use ext*
<Camarade_Tux>
try 'undelete'
lokydor has quit [Client Quit]
jonafan has joined #ocaml
<derdon>
Camarade_Tux: this command doesn'T exist here. shall I install it? or simply start the project again? :D
<derdon>
it wasn't much. not more than 200 LOC
lokydor has joined #ocaml
<eb4890>
How big is the partition it was on? You could make a copy of it then use a hexeditor to search through it for the know strings...
<eb4890>
known*
munga has quit [Quit: Ex-Chat]
<Camarade_Tux>
derdon: is the partition where you stored your data the system partition?
<derdon>
Camarade_Tux: yes, there's only one partition in my HD
<derdon>
Camarade_Tux: it's a vmware image. maybe that helps
ikaros has quit [Quit: Leave the magic to Houdini]
smimou has quit [Ping timeout: 276 seconds]
smimou has joined #ocaml
sepp2k has joined #ocaml
krankkatze has joined #ocaml
avsm has quit [Ping timeout: 246 seconds]
smimou has quit [Ping timeout: 276 seconds]
smimou has joined #ocaml
smimou has quit [Changing host]
smimou has joined #ocaml
mrvn has quit [Ping timeout: 276 seconds]
oc131 has joined #ocaml
oc13 has quit [Ping timeout: 252 seconds]
Dawrk-Side has joined #ocaml
Dawrk-Side has quit [Client Quit]
<thelema>
flux: I can't get your commits off your repo - even if I clone, the newest commits I see are feb 27. Can you create a patch for your commits with [git format-patch -2] ?
<thelema>
if I try to do [git cat-file commit <commit id>], it tells me "bad file"
<thelema>
for [git log <commit id>], I get "bad object"
avsm has joined #ocaml
<thelema>
apparently it didn't download the last two packs...
<thelema>
maybe I'll try downloading them and... I dunno.
<julm>
or download a recent pack and run git index-pack on it
<thelema>
ah, index-pack. great.
Yoric has joined #ocaml
<thelema>
aha, downloading those files in objects/pack has made that commit accessible
<julm>
:)
<julm>
flux: what version of git are you using?
<thelema>
julm: "repositoryformatversion=0"
<julm>
hmm
Submarine has joined #ocaml
smimou has quit [Ping timeout: 276 seconds]
<flux>
thelema, I had missing hooks/post-update, ran it manually
<flux>
works now?
pimmhogeling has quit [Ping timeout: 245 seconds]
<thelema>
got the suspend patch, looking for the min/max patch
* julm
don't like git over HTTP: it does not show the cloning progress
<thelema>
ah, found it.
<julm>
flux: got the recent commits this time
<thelema>
the ugly merge
<thelema>
I wonder why the min/max key were dropped - maybe someone thought they wouldn't be useful for maps... lol
<flux>
well, they are :). but the commit message that dropped them makes me think it was a mistake anyway.
<flux>
also the polymorphic version provided by BatMap has them as well
<thelema>
yes, there's a number of differences between the polymorphic map/set and functorized map/set that I'd love to get rid of
<thelema>
functions in one and not in the other
<thelema>
iirc, Set.intersect will be nontrivial to write
<flux>
well, if you want it to be more efficient than O(n log m) that is?
<thelema>
flux: I cleaned up the way those commits got applied so the official tree has a cleaner history. Thanks for the patches.
<flux>
otherwise it's a Set.fold..
<thelema>
Set.union and Set.diff are folds - how to do intersect via fold?
<flux>
let intersect a b = Set.fold (fun el'a set -> if Set.mem el'a b then Set.add el'a set else set) a Set.empty?
<thelema>
oh yeah. duh
<thelema>
well, I'll add that, with a note that it's not efficient at the moment.
<flux>
I'm not sure if a tree-based merge could be guaranteed to be faster in all cases
<thelema>
That's worse than O(n log m), as each add takes log time. O(n log m log n)?
<flux>
hmm. O(n(log m + log n))?
smimou has joined #ocaml
<thelema>
and where did you come up with the horrible variable name [el'a]?
<flux>
:-)
<flux>
element of a :)
<flux>
perhaps for my 'own code' I would've just reused the name a
<thelema>
hmm, what does intersect mean for maps?
<flux>
good question. it needs a merge strategy.
<thelema>
the same key=value pair, or is matching key enough...
<flux>
for same keys, insert the value returned by the merge function.
<thelema>
ok, can pred
<thelema>
merge function returns 'a option
<flux>
hm?
<flux>
so merge results in no key to be inserted?
<thelema>
if the merge function returns None, don't insert
<flux>
I suppose that's more general, although I'm not sure if I'd expect that :)
<thelema>
n/m, probbaly too general
<flux>
there is no Map.filter though, so the equivalent is difficult to implement (although Map.filter on the other hand is trivially implemented with a fold)
lokydor has joined #ocaml
<thelema>
let intersect merge m1 m2 =
<thelema>
foldi (fun k v acc -> try add k (merge v (find k m2)) acc
<thelema>
with Not_found -> acc) m1 empty
<flux>
hmm
<flux>
so is it intentional that throwing Not_found from merge results in the pair being skipped?
<thelema>
no, but that's a nice side effect
<flux>
better document it as well :)
<thelema>
yup.
Demitar has quit [Quit: Bubbles!]
pimmhogeling has joined #ocaml
<thelema>
intersect pushed - tear it apart.
Demitar has joined #ocaml
brooksbp has joined #ocaml
Snark has quit [Quit: Ex-Chat]
smimou has quit [Ping timeout: 240 seconds]
thieusoai has quit [Remote host closed the connection]
Demitar has quit [Quit: Bubbles!]
smimou has joined #ocaml
Demitar has joined #ocaml
<flux>
hmm.. I wonder how difficult it would be to add high-perforance chunk-reading support to ParserCo? like ParserCo.read 1024 >>= fun str -> ..
smimou has quit [Ping timeout: 246 seconds]
smimou has joined #ocaml
enthymeme has joined #ocaml
<thelema>
flux: How's the performance if you build your ParserCo.Source on top of an enum that does buffered IO?
<thelema>
or if you build it on top of a LazyList with input coming from a Stream, which also does buffered reads?
<thelema>
It'd probably be reasonable to have a Source.of_stream or Source.of_input to cut out the middle man.
<flux>
I haven't measured, but it's a quite an amount of work per character
<thelema>
there's a ton of ugly conversions going on in the input side. Maybe a clean Source.of_input would be what you want. Although the capability of backtracking might require a seekable input.
<flux>
I think building a big list of lazyly read chunks and letting gc expire old blocks would work as well
<thelema>
mmap?
_andre has quit [Quit: *puff*]
Submarine has quit [Read error: Operation timed out]
brooksbp_ has joined #ocaml
<flux>
it wouldn't work for data coming from stdin anyway
<thelema>
true.
rwmjones has quit [Ping timeout: 245 seconds]
<thelema>
not in a streaming sense, of course you could read it all in and then parse it from memory
<flux>
in that case you can just use CharSource.source_of_string
<orbitz>
.ml files have an implicit module <filename> = struct ... end around them right?
<flux>
in certain sense, yes
<thelema>
orbitz: more or less, yes
<orbitz>
when do you guys actually use module?
<orbitz>
I'm poking around Core and I have only really seen it to rename a module inside another module
<flux>
for submodules
<orbitz>
module Thread = Core_thread
brooksbp has quit [Ping timeout: 265 seconds]
<flux>
and functors obviously require modules
<orbitz>
yeah
<thelema>
same for me - functors and submodules and renaming.
<orbitz>
I'm still not groking Functors yet, but trying to get when I would expliclty use module Foo =
<orbitz>
ok
<thelema>
But that's all the possible things you can do with it.
<orbitz>
by submodules do you mean ifyou want to do Foo.Bar?
<orbitz>
by submodules do you mean ifyou want to do Foo.Bar.thing?
<thelema>
yes, if you want a module inside another module.
<orbitz>
if in file foo.ml i do module Bar = struct .. end, do i acecs sit as Foo.Bar now (as in the module doesn't superseed the file name)
<flux>
yes
avsm1 has joined #ocaml
Associat0r has joined #ocaml
avsm has quit [Ping timeout: 258 seconds]
jeddhaberstro has joined #ocaml
<orbitz>
thanks
rwmjones has joined #ocaml
<orbitz>
are functors comparable to C++ templates in any way? Is thare functor metaprogramming out there?
<thelema>
kind of. It's not quite metaprogramming in ocaml.
<thelema>
it's normal programming.
<flux>
well, you can create new types out of other types in declarative fashion without spelling out the new types
<flux>
so that part is compile time. but it's of course not turing complete like C++ templates are.
<orbitz>
yeah ok
<thelema>
are you familiar with generics from .net/java/ada?
<orbitz>
Yes
<thelema>
very similar, just different syntax.
<orbitz>
Right, i get that part, I was more wondering if fucntors were like templates in terms of metaprogramming ability
<thelema>
not so much.
<orbitz>
hwo do you guys feel abotu camlp4
* thelema
dislikes
<flux>
it's teh shit. wish it was documented..
<thelema>
that said, I've not written any camlp4, I just find the way it's integrated (specifically that it's not) horrible
<thelema>
but I'll have to complete this thought later.
rwmjones has quit [Ping timeout: 245 seconds]
rwmjones has joined #ocaml
<derdon>
the lexical conventions are partly ambigous