<Yoric[DT]>
It's just somewhat-manual inlining, in addition to type constraints, in addition to the fact that inlining monad transformers is not completely trivial.
<vixey>
oh what type constraints?
<Yoric[DT]>
The point is a large gain of performance on my benchmark.
<vixey>
oh cool
<flux>
yoric[dt], how about doing it, say, in the compiler?
<Yoric[DT]>
flux: I don't know how to code monad transformers inside the compiler...
<flux>
or would that be too hard-coded and license-encumbered
<Yoric[DT]>
I need some modularity.
<flux>
oh, that too is a good reason :)
<Yoric[DT]>
:)
acatout has quit [No route to host]
szell has quit [Connection timed out]
jonafan has quit [Connection timed out]
<vixey>
a monad transformer stack is a monad though
<vixey>
so where is the compilation?
ikatz has quit [clarke.freenode.net irc.freenode.net]
LordMetroid has quit [clarke.freenode.net irc.freenode.net]
Jedai has quit [clarke.freenode.net irc.freenode.net]
ppsmimou has quit [clarke.freenode.net irc.freenode.net]
pattern has quit [clarke.freenode.net irc.freenode.net]
Snrrrub has quit [clarke.freenode.net irc.freenode.net]
jeremiah has quit [clarke.freenode.net irc.freenode.net]
guillem has quit [clarke.freenode.net irc.freenode.net]
<Yoric[DT]>
vixey: what do you mean?
Jedai has joined #ocaml
guillem has joined #ocaml
LordMetroid has joined #ocaml
Snrrrub has joined #ocaml
ppsmimou has joined #ocaml
jeremiah has joined #ocaml
ikatz has joined #ocaml
pattern has joined #ocaml
<vixey>
I mean if you got monads to inline, wouldn't it also work for a transformer stack?
<vixey>
or is there more inlining to be done
<Yoric[DT]>
Well, at the moment, I have 4 functions.
<Yoric[DT]>
these three functions define the inline monad
<Yoric[DT]>
And then I have my transformer function, which take these three arguments with these types and returns...
<Yoric[DT]>
Well, I'm not completely sure what it should return, but for the moment, it creates a local module.
<vixey>
this is great, I had no idea you could do these things with ocaml
<Yoric[DT]>
pre-processing is fun:)
<vixey>
I just wish I could have found ocaml earlier
LordMetroid has quit ["Leaving"]
<bluestorm>
Yoric[DT]: the problem is that you can't ensure that your monad operations are well-typed
<Yoric[DT]>
Indeed.
<bluestorm>
from the little i've seen, MetaOCaml might allow one to do that
<Yoric[DT]>
I think MetaOCaml could help me there.
<Yoric[DT]>
:)
<bluestorm>
(but i've never used it and have no idea, it's on my todo-list though :-' )
<flux>
is it still being maintained?
<bluestorm>
flux: i think so
<bluestorm>
there was a rebirth some months ago and i think they offered a job position to maintain it
<flux>
did someone take the job?-)
<Yoric[DT]>
Oh, and I just had confirmation.
<Yoric[DT]>
Oleg did the same thing 3 years ago...
<Yoric[DT]>
mmhhhh....
<Yoric[DT]>
No, actually not the exact same thing.
<bluestorm>
are you speaking of the Gaussian Elimination paper ?
<Yoric[DT]>
yep
<bluestorm>
i looked at it recently and he actually doesn't stage monads
<Yoric[DT]>
In that paper, he uses monads to stage stuff, rather than the opposite.
<bluestorm>
they're used to ease CPS-transform wich is useful for staging
<bluestorm>
lunch time
hordf has quit ["Bye"]
ikatz has quit [clarke.freenode.net irc.freenode.net]
guillem has quit [clarke.freenode.net irc.freenode.net]
ppsmimou has quit [clarke.freenode.net irc.freenode.net]
Jedai has quit [clarke.freenode.net irc.freenode.net]
jeremiah has quit [clarke.freenode.net irc.freenode.net]
Snrrrub has quit [clarke.freenode.net irc.freenode.net]
pattern has quit [clarke.freenode.net irc.freenode.net]
Jedai has joined #ocaml
guillem has joined #ocaml
Snrrrub has joined #ocaml
ppsmimou has joined #ocaml
jeremiah has joined #ocaml
ikatz has joined #ocaml
pattern has joined #ocaml
seafood has joined #ocaml
guillem has quit [Remote closed the connection]
guillem has joined #ocaml
johnnowak has quit []
Linktim has joined #ocaml
vixey has quit ["* I'm too lame to read BitchX.doc *"]
Linktim_ has joined #ocaml
vixey has joined #ocaml
Linktim- has joined #ocaml
Linktim has quit [Read error: 110 (Connection timed out)]
acatout_ is now known as acatout
Linktim_ has quit [Read error: 110 (Connection timed out)]
Linktim_ has joined #ocaml
RobertFischer has joined #ocaml
seafood has quit []
Linktim- has quit [Read error: 110 (Connection timed out)]
Linktim_ has quit [Read error: 110 (Connection timed out)]
struktured has joined #ocaml
tsuyoshi has joined #ocaml
<tsuyoshi>
can you compile bytecode programs on linux and run them on windows?
yziquel has joined #ocaml
yziquel has quit [SendQ exceeded]
yziquel has joined #ocaml
<RobertFischer>
tsuyoshi: Theoretically, yes. Although I've never tried it
<tsuyoshi>
I'm working on getting a cross compiler working and just wondering if I should bother with the bytecode compiler at all
<tsuyoshi>
I guess the linking step is different.. the final product is supposed to actually be an executable, right?
<bluestorm>
hm
<bluestorm>
bytecode are not
<bluestorm>
(only if you use -custom, wich is probably not portable)
<yziquel>
Quick question: is it possible to declare an enumerated type (type t = Alpha | Beta, for instance) in some module A, and do some stuff in module B so that you can refer to B.Alpha instead of A.Alpha?
<tsuyoshi>
put "include A" in B
<yziquel>
tsuyoshi: thanks a lot...
Associat0r has quit []
<jynxzero>
yziquel: If you don't want everything from A in B you can also do "type t = A.t = Alpha | Beta" in B.
<jynxzero>
Though it's a bit of a PITA IMHO coz every time you modify T in A you need to make the same change in B.
<tsuyoshi>
oh I didn't know about that
LordMetroid has joined #ocaml
vixey has quit [Read error: 113 (No route to host)]
Jeff_123 has joined #ocaml
RobertFischer has quit []
RobertFischer has joined #ocaml
tomh has joined #ocaml
authentic has quit [Read error: 110 (Connection timed out)]
LordMetroid has quit ["Leaving"]
guillem has quit [Remote closed the connection]
authentic has joined #ocaml
postalchris has joined #ocaml
<postalchris>
Is here a way to test if a command foo is in the system path, short of "try Sys.command foo; true with _ -> false"?
<flux>
search the path yourself?
johnnowak has joined #ocaml
jonas_e has quit [No route to host]
<postalchris>
flux: I meant an easy way...
<postalchris>
Also, platform-neutral would be good
<tsuyoshi>
autoconf can do it
<postalchris>
tsuyoshi: I need a sanity-check at runtime...
<tsuyoshi>
searching the path is the only way then
<tsuyoshi>
not really the hardest thing in the world to do...
<postalchris>
tsuyoshi: agreed...
jonafan_ is now known as jonafan
<postalchris>
Well, now... is there a utility for working with Windows vs. Unix-style PATHs?
<flux>
there's module Filename
Ched- has quit [Remote closed the connection]
Ched- has joined #ocaml
<postalchris>
flux: doesn't handle ':' vs. ';'
Ched- has left #ocaml []
<RobertFischer>
postalchris: Sounds like a simple but nifty utility you could put up on OcamlForge.
tsuyoshi has quit ["Lost terminal"]
<flux>
postalchris, you could use Sys.os_type and handle it yourself
<postalchris>
Hm. Unix filenames can have ':' in them...
<flux>
yes, not very pretty, but doable
<postalchris>
This is getting complicated, fast.
<flux>
I wonder if that's incompatible with PATHs then
<postalchris>
flux: No, filenames can have ':', but their presence in PATH confuses the shell...
<postalchris>
So I guess it can confuse me too...
<flux>
zsh apparently can handle it, sortof
<flux>
almost :)
<flux>
path=(foo:plap $path) appears to work
<flux>
but launching zsh then will mess it up; obviously it uses PATH for that purpose
<flux>
I think it's a great idea that file names can contain evreything but /, but it hasn't been pulled through all the way :)
vixey has joined #ocaml
<postalchris>
Hm, "does the current user have execute permissions on file foo" isn't such an easy matter either.
<postalchris>
Sys.command "test -x foo" may be the easy way out
<postalchris>
I am trying to minimize dependencies on external libraries, though... :-(
<flux>
why?
<postalchris>
Hm, godi-ocaml-fileutils tries to install in /usr/local and not GODI_DIR...
<postalchris>
flux: Preparing for a release, want untar-config-make to go as smoothly as possible...
<flux>
yeah, there is that..
<flux>
I woudln't mind if there was a tool to package a program so that chosen dependencies would go in also
<postalchris>
Well.. godi.
<flux>
but I heard there are some people that don't run godi!
<flux>
actually godi could enable that
<flux>
retrieving sources and building a self-contained mini-godi perhaps :)
<flux>
hey, that would be an interesting project for someone ;)
<flux>
you could package all the way up to the compiler also.. think, easy distribution to people who know nothing of ocaml!
<flux>
it would be one big tarball though..
<postalchris>
:-D
<gildor>
postalchris: you can embed the tarball in ext/ and provide a way to begin building ocaml-fileutils
<gildor>
from that directory in you source
<gildor>
and you just add the tarball in version you distribute
<gildor>
i.e. your source doesn't contains it
<gildor>
contain
Chile`_ is now known as Chile`
<postalchris>
gildor: That's some software engineering kung fu you've got there...
marmotine has joined #ocaml
guillem has joined #ocaml
Axioplase has joined #ocaml
bluestorm has quit ["Konversation terminated!"]
<flux>
can someone explain me how to make use of type + 'a?
<flux>
does it mean using classes or polymorphic variants?
<mfp>
flux: it's used to indicate that the type is covariant with regard to 'a
nuncanada has joined #ocaml
<mfp>
flux: e.g. module A : sig type +'a t val make : 'a -> 'a t end = struct type 'a t = 'a list let make x = [x] end;;
<mfp>
let b : [`A] A.t = A.make `A;;
<mfp>
# (b :> [`A | `B] A.t);;
<mfp>
- : [ `A | `B ] A.t = <abstr>
<flux>
hmm.. so 'a list is covariant with regard to 'a also?
<flux>
but I suppose mutable types cannot be covariant?
<flux>
Queue.t doesn't appear to have +
Associat0r has joined #ocaml
<mfp>
flux: 'a list is covariant because the compiler knows that it's type 'a list = Nil | :: of 'a * 'a list
<mfp>
if it were abstract, +'a would have been required
<mfp>
ref is invariant
<mfp>
roughly, something you read from is covariant; something you write to is contravariant
<mfp>
when you do both, it's invariant
Jedai has joined #ocaml
jlouis has quit ["Leaving"]
<Yoric[DT]>
(unlike Java, where some things are weirdo-variant)
<gildor>
postalchris: nope, this is really simple
<gildor>
postalchris: you just have to untar/gunzip the tarball and include the *.ml file in your own build
<gildor>
it just add some more file to build
<gildor>
using ocamlbuild it means just adding directories to look for sources
jlouis has joined #ocaml
<flux>
mfp, thank you, that clears things up
<flux>
I was wondering why it didn't appear in actual struct part of the modules..
struktured has quit [Read error: 110 (Connection timed out)]
Jeff_123 has quit [Read error: 104 (Connection reset by peer)]
pango has joined #ocaml
<postalchris>
It seems there's a conflict in GODI between using Str and using godi-inifiles... The versions of PCRE don't agree? Is this a FAQ?
struktured has joined #ocaml
yziquel has quit ["Leaving"]
struktured has quit [Read error: 110 (Connection timed out)]
RobertFischer has quit []
coucou747 has quit [Read error: 113 (No route to host)]
nuncanada has quit ["Leaving"]
bluestorm has joined #ocaml
johnnowak has quit []
Axioplas1 has joined #ocaml
Axioplase has quit [Nick collision from services.]
Axioplase has joined #ocaml
Axioplase has quit [Nick collision from services.]
Axioplas1 is now known as Axioplase
yallop has joined #ocaml
Axioplas1 has joined #ocaml
Axioplas1 has quit [Client Quit]
<yallop>
I'm looking for help with using a custom lexer in Camlp4
<yallop>
In particular, I want to use a different lexer for code, not for quotations
<yallop>
has anyone done this?
* Yoric[DT]
hasn't tried.
<Yoric[DT]>
Hi, btw, Patterns 0.4 looks great.
<yallop>
thanks!
<Yoric[DT]>
I haven't found the time to adapt our code to use Patterns 0.4 instead of our custom stuff for the paper we're currently working on, but that will probably happen before we release anything.
<Yoric[DT]>
A bit of documentation for writing new extensions would be appreciated, though.
<bluestorm>
yallop:
<bluestorm>
talking of patterns, i was thinking
<bluestorm>
could you not include the camlp4 AST and do the traverse.ml generation at compile time ?
<bluestorm>
i think it would actually be more informative and shorter than distributing the mechanically generated code
<yallop>
ah, right
<yallop>
that's a good idea
<yallop>
Yoric: I'll put some documentation up soon
<yallop>
at least, in the next couple of weeks or so
<yallop>
if there's anything particular I can help with in the meantime, please let me know
<yallop>
incidentally, I've also wondered whether the polymorphic-variants-as-effects-witness idea could be pulled off
<yallop>
being able to extend the types of values in that way could be useful for other things as well
<yallop>
e.g. possibly for registering some kind of type classes
<bluestorm>
Yoric[DT]: i'm not sure patterns would be useful for the exception-pattern parts i've seen
<Yoric[DT]>
yallop: that was my second idea :)
<Yoric[DT]>
bluestorm: I'm not sure it would be necessary, but it seems to me that it would be interesting for the sake of uniformization.
<bluestorm>
from what i understand, the main use is when you need to compute some expressions inside the pattern branching, and it provides no particular facility for pure pattern-to-pattern transformation
<Yoric[DT]>
yallop: I've been toying with this kind of ideas for type classes for some time.
<Yoric[DT]>
For the moment, I can't think of any better way than Camlp4-style module registration.
<Yoric[DT]>
But this would be rather unusable without a main entry point.