authentic has quit [Read error: 110 (Connection timed out)]
^authentic is now known as authentic
Tetsuo has quit ["Leaving"]
hsuh has joined #ocaml
ita has quit [Remote closed the connection]
hsuh has quit ["slip"]
seemant has quit [Read error: 110 (Connection timed out)]
imz has joined #ocaml
<imz>
let rec map_pairs f = function
<imz>
a :: (b :: _ as tail) -> f a b :: map_pairs f tail
<imz>
| _ -> []
<imz>
strange question: would there be some way to extend this function to work with "f" of arbitrary arity?
<imz>
that would certainly improve the level of abstraction.
<imz>
(but i doubt it is possible with standard ocaml, of course.)
<mwc>
imz, I think it could be done with p4
<mwc>
rwmjones would know
bzzbzz has quit ["leaving"]
seafood_ has joined #ocaml
imz has quit ["Leaving."]
shortcircuit has joined #ocaml
coucou747 has quit ["bye ca veut dire tchao en anglais"]
netx has quit [brown.freenode.net irc.freenode.net]
petchema has quit [brown.freenode.net irc.freenode.net]
TaXules has quit [brown.freenode.net irc.freenode.net]
Smerdyakov has quit [brown.freenode.net irc.freenode.net]
neale has quit [brown.freenode.net irc.freenode.net]
ikatz has quit [brown.freenode.net irc.freenode.net]
pattern has quit [brown.freenode.net irc.freenode.net]
TaXules has joined #ocaml
netx has joined #ocaml
petchema has joined #ocaml
Smerdyakov has joined #ocaml
ikatz has joined #ocaml
neale has joined #ocaml
pattern has joined #ocaml
evn has left #ocaml []
evn has joined #ocaml
<palomer_>
This expression has type [ `App of Simple_type.function_signature | `Hole ]
<palomer_>
but is here used with type
<palomer_>
[ `App of Simple_type.function_signature | `Hole | `Var of string list ] <--isn't this ok?
<palomer_>
oh, i need to make it explicit
alexyk__ has quit []
alexyk has joined #ocaml
alexyk has quit [Client Quit]
<thelema>
Well, things look pretty simple now that I've investigated git's workings - it doesn't operate on patches as I thought - sanxiyn was right, it works on whole trees, and diffs are optimizations.
<thelema>
So I may need to switch to another SCM...
mikeX_ has joined #ocaml
<mwc>
thelema, what were you trying to do?
<mwc>
It seems to me if you want to be clear you're not forking Caml, you should regularly merge in INRIA's sources
<mwc>
and you can also use git-rebase to move your patch tree to the tip of their work continually
<mwc>
I think that would work quite nicely
<mwc>
plus you can use git's CVS interoperability to pull their source in
<mwc>
The way git stores the revision graph (nodes, instead of edges like other SCMs) is really totally orthogonal to what you're trying to do
<mwc>
plus, it has the advantage of being the RIGHT thing to do, because new change representation techniques automagically work for old commits
mikeX has quit [Read error: 110 (Connection timed out)]
* thelema
pokes the hornets nest with his email...
<thelema>
mwc: I do pull their changes in and merge branches
<thelema>
I don't agree with the rebasing - doesn't it mess with history?
<thelema>
my understanding is that it's great for personal use, but anything you're going to distribute won't sync with others if you rebase.
<mwc>
nah
<mwc>
well, here's what you should do
<mwc>
if/when you sync with INRIA or otherwise publish the set, don't rebase it again
<mwc>
on the other hand, it's great to rebase "private" branches
<mwc>
since then your patches appear as a continuous stream, as opposed to a long run of "stitching"
<mwc>
ie, you end up with development that looks like (pardon the ascii-art-flood:)
<mwc>
_________________________________
<mwc>
\ \ \ \\ \\\ \\ \\ \
<mwc>
_________________________________________
<mwc>
well, you get the idea
<mwc>
so that's stitching
<thelema>
mwc: you're using a variable width font, aren't you...
<mwc>
Nah, just typing them one line at a time, and not paying attention to number of characters
<mwc>
anyhoosenberries
<thelema>
anyway, that's what I'll have to end up with.
<mwc>
rebasing is good for a private branch, since your change appears as a single contiguous (unstitched) block
<thelema>
I did a bunch of rebasing when I worked on gsv's source tree with git-svn.
<mwc>
but yeah, once you publish it to your master branch, your should do your rebase onto the tip of the last thing you published
<thelema>
and that worked pretty well - rebasing before sending in a patch.
jonafan has joined #ocaml
<thelema>
at the moment I'm being quite lax with pushing poor changes... Yes, I know it'll break git bisect...
<thelema>
I just want to get code in there. I'll probably have to discipline things more for a release branch.
<thelema>
otoh, with ocaml there's likely less need for bisect, because changes often have a local effect.
<mwc>
yeah, in fact, I tend to favour committing very small patches while I'm working, then using git-rebase --interactive to "squash" them into an "atomic" commit
<mwc>
so several very small patches get squashed into something like "implemented foo" as opposed to "skeleton for foo"; "test case for foo"; "a little bit of implementation of foo"; "test refinement"; etc
<mwc>
since by themselves, they're very small, uninteresting sub-20 line patches.
<mwc>
so while I still have them cluttering things up, it's great for moving around my work history
<mwc>
right, but I take it to ridiculous extremes, and then use squash to rewrite them into "logically atoms"
<mwc>
ie, the smallest bit of change that's worth mentioning in the change history
<mwc>
sometimes if I even change a line or two, I'll do it, since if I decide that the next thing I did was stupid, I'll do a quick branch and go from there.
* thelema
starts thingking about patching git to force deltafied packs
<thelema>
(to adhere to QPL restriction)
<mwc>
Yeah, that's silly
* thelema
tries #git on freenode...
<mwc>
(the QPL, not your idea)
<thelema>
It does make software open source while still discouraging forks pretty efficiently.
<mwc>
yeah, that you can't distribute your modified version entirely.
<mwc>
To be honest, at one point I really wanted to try hacking in an LLVM backend to the compiler
<mwc>
but the QPL sort of put me off any experimentation there
<mwc>
I think I'd rather do it with something like Mlton if I have some spare time this summer
<thelema>
if you could use git for SCM on the project, would you still be put off?
<mwc>
Well, still a little bit, because the INRIA team seems to be pretty uninterested in any community involvement
<mwc>
it's very ivory tower compared, to say, the MLton or GHC teams
<thelema>
it is, and they like that. What if there were a community group that allowed more involvement in their OCaml distribution?
<mwc>
I think it would end up as a quagmire, like the Java Community Process
<mwc>
Hmmmm
<thelema>
I think that since the community is much smaller, it might be manageable.
<mwc>
you know, rereading their license
<mwc>
I'd think that section 4b might let you get away with distributing the entire modified source tree
<mwc>
and that you could claim 4a just means you can distribute your patches independently of the parent source, unlike the GPL which requires you to provide the entire source when redistrubting
jonafan_ has quit [Read error: 110 (Connection timed out)]
seafood_ has quit []
ygrek has joined #ocaml
evn has quit []
ikaros has joined #ocaml
ygrek has quit [Remote closed the connection]
ygrek has joined #ocaml
glenker has joined #ocaml
<glenker>
is it possible to have either a recursive variable or two mutually recursive variables?
<flux>
you may want to use laziness to accomplish that
ppsmimou has joined #ocaml
ygrek has quit [Remote closed the connection]
OChameau has joined #ocaml
hkBst has joined #ocaml
ttt-- has joined #ocaml
jsk has joined #ocaml
jlouis has quit ["Leaving"]
Tetsuo has joined #ocaml
mikeX_ is now known as mikeX
Yoric[DT] has joined #ocaml
yangsx has quit [Read error: 110 (Connection timed out)]
Demitar has quit [Read error: 110 (Connection timed out)]
goalieca has quit [Remote closed the connection]
ygrek has joined #ocaml
coucou747 has joined #ocaml
ecc_ has quit ["Reconnecting"]
ecc has joined #ocaml
<ecc>
glenker: let rec x = 0 :: y and y = 1 :: x;;
bongy has joined #ocaml
bongy has quit ["Leaving"]
postalchris has joined #ocaml
bluestorm has joined #ocaml
ttt-- has quit [Read error: 110 (Connection timed out)]
ygrek has quit [Remote closed the connection]
delamarche has joined #ocaml
sporkmonger has joined #ocaml
<sporkmonger>
how do you make a method be tail-recursive?
<Smerdyakov>
Make sure nothing else needs to happen after any recursive call.
<sporkmonger>
ok, that's what i thought, just wanted to be sure
<sporkmonger>
so this would be tail-recursive then?
<thelema>
function gives you one more argument with a pattern match on it.
<sporkmonger>
so using function inside something that take three arguments will result in a function that takes four?
<sporkmonger>
or did i misunderstand you
<sporkmonger>
cuz that seems weird
<bluestorm>
(function ...) is equivalent to (fun x -> match x with ...)
<bluestorm>
so
<bluestorm>
let f a b = function ...
<bluestorm>
is like let f a b = fun c -> match c with ...
<bluestorm>
or let f a b c = match c with ...
<bluestorm>
that is, one more argument
<sporkmonger>
ok
<sporkmonger>
so functions always have to take at least one argument then?
postalchris has quit [Read error: 110 (Connection timed out)]
<thelema>
sporkmonger: when you use the function keyword, you get one more argument. functions cab get defined without any keywords, or with the fun keyword or with function
<sporkmonger>
i meant more like... let something = ... <-- not a function?
<thelema>
let x = y <- if y is a function, x is.
<thelema>
ley x a = y <- if y's not a function, x is, and has one argument
<thelema>
*let
<thelema>
let x = fun a -> y <-- same as let x a = y
<thelema>
let x = function a1 -> y | a2 -> z <-- definitely a function, defined "piecewise"
<sporkmonger>
ok, i think i'm getting this
<thelema>
(a1, a2 should be patterns
<sporkmonger>
is there an easy way to tell if i've got a tail-recursive call or not?
<sporkmonger>
or do i have to just throw something big at it and see if the stack blows up
<thelema>
you could drop the stack size, and then big becomes small.
<sporkmonger>
how?
<thelema>
ulimit -s
<sporkmonger>
man ulimit isn't very helpful
<thelema>
on my system, ulimit -s 100 sets the stack size to 100k
<thelema>
the default is 8182k
<thelema>
*8192k
<sporkmonger>
eh, now that i think about it, this thing takes input from stdin, so i'll just pipe an AVI or something into it
<sporkmonger>
when i compile, ocamlopt complains about #install_printer print_t;;
<sporkmonger>
but toplevel doesn't?
<thelema>
sporkmonger: that's a toplevel directive
<thelema>
not something that applies to the compiler.
<sporkmonger>
ok
<bluestorm>
i'm dissatisfied with the ocaml examples in the (french) Wikipedia
<bluestorm>
what do you think would be pertinent example in an encyclopedic article ?
<thelema>
bluestorm: wiki-improve them
<thelema>
quicksort?
<thelema>
algebraic expression evaluator?
<sporkmonger>
blar, ok, so even with the aid of ulimit -s, i'm not sure how to tell if i'm looking at tail-recursion or not
<thelema>
if you can't break it with large input, it's most likely tail recursive.
<flux>
"I am pleased to announce the release of darcs 2.0.0!"
<flux>
looks pretty much like a release to me :)
<flux>
unfortunately the announcement, as noted on #haskell, has a pretty sad tone
<flux>
I wonder if things are still going on with it
<flux>
because it's my #1 pick for small projects, of which I have many :)
<thelema>
well, then someone needs to update their web page...
<thelema>
We are happy to announce the third prerelease version of darcs 2!
<flux>
maybe he stopped doing that too ;)
goalieca has joined #ocaml
ttt-- has quit [Read error: 110 (Connection timed out)]
<thelema>
it seems he quit just about everything else.
jprieur has quit [Read error: 110 (Connection timed out)]
jprieur has joined #ocaml
<sporkmonger>
people still use darcs? thought everyone had jumped on the git bandwagon by now
<flux>
perhaps git is just as great, atleast it has interactive commit these days
<flux>
I haven't really given it a real spin
<flux>
but it's hard to beat darcs init; darcs add *.ml; darcs record
<flux>
and after that you can just copy the tree somewhere and push and pull individual patches between the directories (that could be on different hosts)
<qwr>
hmm? git init; git add .; git commit
<flux>
well, commit is slightly more complex, and darcs' commit is interactive by default
<flux>
and darcs has a couple dozen subcommands, versus nhundred ;)
<flux>
155 apparently on my debian
<flux>
well, 33 subcommands in darcs also
* qwr
won't comment since he haven't used darcs. It could be great. ;)
<flux>
well, it's simple enough to just try out by trying out the commands
<flux>
s/try out by/learn by just/
<flux>
in my experience git is more complicated. haven't tried mercurial.
<pango_>
mercurial seems more like darcs on that respect, a handful of commands
<pango_>
quite easy to master
<thelema>
pango_: and unix is bad too because it's got so many commands, and is hard to master.
<pango_>
I recognize trolls when I see one
<pango_>
also, even if I don't care much about win32, it seems that using a scm that works poorly on that environment to manage a software that supports that platform is not a very good choice
<thelema>
just pointing out (in a trollish way) that many like unix exactly because it has many commands.
<thelema>
You lose out on win32-only developers, yes.
<pango_>
there's win32-only bugs, it seems
<pango_>
thinking of ocamlwinplus (sp?) the other day, for example
<qwr>
maybe. there are rumors about working mingw builds of git ported to win32 ;)
<thelema>
git's architecture in certain points assumes some unixisms.
<thelema>
and it's implementation assumes many more.
* ertai
still use darcs
<Jedai>
thelema: But you don't have to know all the commands of Unix to use it effectively (I suppose it's the same for git, but still, it's a monolithic tool whereas Unix is an OS, is change perspective somewhat)
<flux>
thelema, I for one wouldn't mind if unix had less commands with more consistency
<flux>
even might prefer it!
Snark_ has quit ["Ex-Chat"]
jprieur_ has joined #ocaml
<ertai>
being able to do the same job in less commands seems to be just better design choices
<ertai>
moreover it's a good day to try out darcs, since today darcs 2.0.0 has just been released!
<flux>
which is exactly where the discussion begun at :)
<thelema>
ertai: the git people would just respond that more porcelain is needed.
<ertai>
thelema: yes but they don't hide the plumbing so it's even more confusion :)
<thelema>
i.e. a nice wrapper over the low-level plumbing that does this common task easily in one step.
<thelema>
ertai: only confusing if you're looking through the big list of commands wondering which to use. Just like confusing looking through 'ls /usr/bin' to find a command.
* ertai
have written *numerous* of SCM wrappers
<ertai>
thelema: right but can me point out a good documentation about up2date porcelains comands?
<thelema>
ertai: up2date - the redhat RPM upgrader?
<ertai>
thelema: :)
* ertai
needs very fewer script while using darcs
<thelema>
and in exchange you lose some ability to script low-level actions.
<ertai>
thelema is trying to gain some time by making jokes while right the documentation
<thelema>
would it suffice if the git docs segregated the plumbing?
<ertai>
no but it would help
<thelema>
? you think I'm writing documentation for up2date? (and what does that have to do with git?)
<thelema>
a saparate git-low command for plumbing subcommands?
<ertai>
by up2date I meant up-to-date
<ertai>
renaming git-onelowcommand into gitlow-onelowcommand would also help
<thelema>
just so you don't get distracted by all the different options?
<ertai>
I also find more pleasant to write haskell code than shell scripts to imprve my SCM
jprieur has quit [Read error: 110 (Connection timed out)]
<thelema>
to each their own.
<flux>
even unix has separate manual page sections for system calls and library calls ;)
<ertai>
thelema: git should continue to copy some darcs elements of UI
<ertai>
flux: 1 point
kotarak has joined #ocaml
<flux>
not to mention the bin/sbin separation
<flux>
(darn, I mentioned it..)
<flux>
mm, me like pa_refutable.ml: let refutable [Values [`String name]] = find "NODE_NAME" mesh
<thelema>
feh, what's wrong with _ -> assert false?
jprieur_ is now known as jprieur
<flux>
it's not a let, it indents in a wrong way :)
<flux>
let name = match find "NODE +
<flux>
argh
* thelema
finds that when he needs to do something like that, his types can be massaged to not require refutable
<flux>
``let name = match find "NODE_NAME" mesg with [Values [`String name]] -> name | _ -> assert false in'' is really nicer?
<thelema>
i.e. the return type for find might not fit.
<flux>
unfortunately pattern matching trees where nodes may be in indeterminate order is not something ocaml's pattern matching would not readily do?
<flux>
now, if there were views or a similar mechanism..
<thelema>
let find_name s m = match find s m with [Values [`String n]] -> n | _ -> assert false
<flux>
I do that particular search exactly once
<thelema>
let name = find_name "NODE_NAME" mesg in
<flux>
so I would have finds for all data types?
<flux>
or constructors, that is
<flux>
well, I suppose I could compose the searchers
<flux>
but then again I don't even do that a lot
<flux>
(so perhaps for those little amounts verbose approaches wouldn't hurt)
sporkmonger has quit [Read error: 110 (Connection timed out)]
<flux>
another one might be let refutable [Values [`Int x; `Int y; `Int z]] = .., which again would need a new function
<flux>
but now I'll be off to sleep, happy hacking