<orbitz>
I want the return type to be the [>] so it composes well. This will actually be the error type in a result where I'm doing a bunch of operations
<Drup>
haesbaert: yes, it's tailrec. If you are unsure, try to add some [@tailcall] and the compiler will warn if they are not (cf the doc for the good place for the attribute)
ansiwen has quit [Read error: Connection reset by peer]
ansiwen has joined #ocaml
ygrek has quit [Ping timeout: 264 seconds]
oschwald has quit [Quit: Leaving.]
copy` has quit [Quit: Connection closed for inactivity]
ansiwen has quit [Ping timeout: 260 seconds]
infinity0 has joined #ocaml
sz0 has joined #ocaml
ansiwen has joined #ocaml
govg has quit [Ping timeout: 245 seconds]
etc has quit [Remote host closed the connection]
nomicflux has joined #ocaml
nomicflux has quit [Quit: nomicflux]
<cheater>
if in my module at the top level i have two lines like this: type t; type foo = t; then are t and foo exactly interchangeable?
shinnya has joined #ocaml
fre has quit [Ping timeout: 245 seconds]
wolfcore is now known as Guest91983
fre has joined #ocaml
ygrek has joined #ocaml
FreeBirdLjj has joined #ocaml
rgrinberg has quit [Remote host closed the connection]
philtor has quit [Ping timeout: 252 seconds]
cataska has joined #ocaml
cataska has quit [Client Quit]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
MercurialAlchemi has joined #ocaml
slash^ has joined #ocaml
FreeBirdLjj has joined #ocaml
ziyourenxiang has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
Algebr has quit [Ping timeout: 252 seconds]
Simn has joined #ocaml
peddie_ is now known as peddie
freusque has joined #ocaml
govg has joined #ocaml
malina has joined #ocaml
ziyourenxiang has quit [Quit: Leaving]
_whitelogger has joined #ocaml
mfp has joined #ocaml
<haesbaert>
Drup: thanks, that's very helpful
govg has quit [Ping timeout: 276 seconds]
freusque has quit [Ping timeout: 245 seconds]
mengu has joined #ocaml
rand__ has joined #ocaml
FreeBirdLjj has joined #ocaml
malina has quit [Ping timeout: 255 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
jnavila has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
mengu has quit [Remote host closed the connection]
orbifx has joined #ocaml
zpe has joined #ocaml
silver has joined #ocaml
FreeBirdLjj has joined #ocaml
orbifx has quit [Ping timeout: 255 seconds]
FreeBirdLjj has quit [Ping timeout: 276 seconds]
tobast has quit [Quit: WeeChat 1.0.1]
mengu has joined #ocaml
tobast has joined #ocaml
mengu has quit [Ping timeout: 264 seconds]
average has joined #ocaml
zpe has quit [Remote host closed the connection]
ziyourenxiang has joined #ocaml
zpe has joined #ocaml
<flux>
cheater, yes
zpe has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
seangrove has joined #ocaml
govg has joined #ocaml
shinnya has quit [Read error: Connection reset by peer]
shinnya has joined #ocaml
sfri has quit [Ping timeout: 255 seconds]
govg has quit [Ping timeout: 276 seconds]
shinnya has quit [Ping timeout: 260 seconds]
seangrove has quit [Ping timeout: 240 seconds]
seangrov` has joined #ocaml
seangrov` has quit [Ping timeout: 276 seconds]
tobast has quit [Quit: WeeChat 1.0.1]
tobast has joined #ocaml
<Simn>
I'm porting a camlp4o parser to menhir. It's going quite well but there's a special case because our grammar distinguishes `@:meta (1)` from `@:meta(1)` by considering the position of the `(`. This is one of the few places where whitespaces influence the grammar like that and I'm not wondering how to express that without making a huge mess.
oschwald has joined #ocaml
<flux>
how about lexing whitespace( and ( as separate tokens?
<flux>
or possibly even provide whitespace from lexer but only if followed by (
<Simn>
Hmm, interesting idea!
<Drup>
Simn: have a separate token for "meta(" ?
<Simn>
meta can be any identifier unfortunately
sfri has joined #ocaml
<Drup>
then have a separate token for "@:identifier("
sh0t has joined #ocaml
<Simn>
That's another interesting idea, thanks!
<Drup>
that's probably the easiest way, it sucks, but honestly, so does your grammar ^^'
orbifx has joined #ocaml
jnavila has quit [Ping timeout: 252 seconds]
nomicflux has joined #ocaml
<orbitz>
Drup: is there a less awkward way to express that? That's what I ended up on but the types can be so long. I ended up doing something like let foo' f = f () let foo f = (foo f : blah :> blah), it just gets long
FreeBirdLjj has quit [Remote host closed the connection]
jnavila has joined #ocaml
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
freusque has quit [Ping timeout: 256 seconds]
nomicflux has joined #ocaml
jao has joined #ocaml
jnavila has quit [Ping timeout: 240 seconds]
<cheater>
flux: thank you
<cheater>
i have had another question if i may
<cheater>
i have a parameter i have to pass around everywhere, it contains stuff like info on logging etc, what's the best way to do that in ocaml? in haskell i'd use a Reader monad
<companion_cube>
I just use a state parameter
<flux>
well, you could use a reader monad in ocaml as well. personally I would probably just go with a parameter. if more shared state needs to be added, use the same state parameter. so what companion_cube said ;).
<flux>
in principle you could also write a functorized module that takes the logger via a module
<companion_cube>
if the state is really pervasive in one module, you can go with a functor, too
<companion_cube>
yeah
<companion_cube>
I do that sometimes
govg has joined #ocaml
<companion_cube>
kind of like dependency injection
<chindy>
http://pastebin.com/Yg4sAW0D Can someone explain what a finite partial functin does and what this tree does?
<companion_cube>
it's probably a function that is defined only on a finite set of values
<companion_cube>
(hence "partial", because it's not defined over the whole type)
<companion_cube>
as for the tree, it's not really clear to me what the integers are
<companion_cube>
but it's a mapping from 'a to 'b
<Drup>
polymorphic comparison ? :D
<companion_cube>
no but the leaves are associations lists, it seems
<Drup>
to go down in the tree, I meant
<companion_cube>
anyway, magic integers + no comments = bleh
<companion_cube>
ah it must be a patricia tree on polymorphic hash
<companion_cube>
from the comment above
jhaberku has joined #ocaml
yomimono has joined #ocaml
jao has quit [Ping timeout: 245 seconds]
nomicflux has quit [Quit: nomicflux]
<chindy>
companion_cube: yea must be thanks... Its from John Harrisons book btw.
evanjb has joined #ocaml
evanjb has quit [Client Quit]
vramana1 has joined #ocaml
vramana has quit [Ping timeout: 264 seconds]
vramana1 is now known as vramana
<cheater>
companion_cube: OK
<cheater>
thanks
<cheater>
i have another question too :D
<cheater>
i have foo/bar_baz.ml with foo/bar_baz.mli and they contain a function called corge. now in quux/quuz.ml i'm trying to call Bar_baz.corge but ocaml says "Unbound module Bar_baz". How do I go about solving this?
Algebr has joined #ocaml
<cheater>
ah found it, there's like a .depend file. is this standard in ocaml build systems?
<Drup>
cheater: I guess you are working on a pre-existing project ?
<cheater>
hmm no that's not it
<cheater>
Drup yeah
<cheater>
are .ml.deps files autogenerated or are they a "standard" thing?
<cheater>
autogenerated by make it would seem...
AlexDenisov has joined #ocaml
yomimono has quit [Ping timeout: 240 seconds]
nomicflux has joined #ocaml
jnavila has joined #ocaml
hyperboreean has joined #ocaml
nomicflux has quit [Quit: nomicflux]
infinity0 has quit [Remote host closed the connection]
zpe has joined #ocaml
freusque has joined #ocaml
oschwald has quit [Quit: Leaving.]
oschwald has joined #ocaml
copy` has joined #ocaml
octachron has joined #ocaml
wolfcore has quit [Ping timeout: 255 seconds]
govg has quit [Ping timeout: 240 seconds]
govg has joined #ocaml
vramana1 has joined #ocaml
wolfcore has joined #ocaml
vramana has quit [Ping timeout: 260 seconds]
vramana1 is now known as vramana
AlexDeni_ has joined #ocaml
AlexDenisov has quit [Ping timeout: 255 seconds]
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Read error: Connection reset by peer]
kakadu has joined #ocaml
philtor has joined #ocaml
sh0t has quit [Ping timeout: 260 seconds]
hyperboreean has quit [Quit: Lost terminal]
octachron has quit [Quit: Leaving]
slash^ has quit [Read error: Connection reset by peer]
orbifx has joined #ocaml
orbifx has quit [Client Quit]
ollehar has joined #ocaml
<ollehar>
anyone knows about pre-condition and weakest liberal pre-condition? (F*)
<ollehar>
there's some notation I don't understand in the F* tutorial
<ollehar>
let
<ollehar>
then
<ollehar>
b ::= x | true | false
<ollehar>
WP b P = P b
<ollehar>
?
<ollehar>
P is the post-condition?
rand__ has joined #ocaml
<average>
what's ocaml's approach to writing long-running programs?
<average>
how is the gc in terms of memory usage for long-running programs?
<average>
can one expect ocaml's gc to allow having a long-running program live for a long time without constantly piling up memory blocks and running out of them?
<ollehar>
average: afaik, ocaml's gc is much more memory conservative than e.g. java's
<ollehar>
that's also why it's a bit slower
<ollehar>
(this can be tuned, of course)
<average>
ollehar: that sounds good
<ollehar>
iirc, real world ocaml has a chapter about it
<ollehar>
:P
<average>
i wonder if someone had some writeup about this
<ollehar>
only one way to find out...
<ollehar>
check out the debian benchmark games for memory comparison
<ollehar>
the binary-tree benchmark tests the gc
<average>
well, finding out for myself is very expensive, I was hoping to read about it
<ollehar>
I meant google ;)
<average>
oh
<haesbaert>
I think the best answer you can get is: "there are long running applications in ocaml, and they work fine."
<ollehar>
depends on the application, of course
<haesbaert>
all the rest I'd wage you have to figure yourself
<ollehar>
but isn't all generational gcs constantly piling up memory blocks?
<ollehar>
I mean, you'd have to use a pool-based system if you only want to allocate once.
<haesbaert>
allocating a block is moving one pointer
<ollehar>
yeah, but then you copy the memory to the long living heap
<haesbaert>
sure, but most allocations never end in the living heap
jhaberku has quit [Remote host closed the connection]
<ollehar>
I guess
<haesbaert>
my point is this is a discussion that, unless you really really understand the innerworkings of it, it's a bit moot
<haesbaert>
(I don't btw, not even close)
<haesbaert>
so I'd look at the real world usages, and since there are, I'd say that's the answer you/I can get
<ollehar>
again I think it depends on the application. but unless it's very resource demanding, then yes, I agree. nothing to worry about.
<haesbaert>
ack
<ollehar>
?
<haesbaert>
agreed
<ollehar>
ah
<haesbaert>
if his application doesn't work as expected, he will have to figure it out, antecipating is moot
mengu has joined #ocaml
segmond has quit [Quit: l8r]
cross has joined #ocaml
freehck has quit [Remote host closed the connection]
sh0t has joined #ocaml
jnavila has quit [Quit: Konversation terminated!]
orbifx has joined #ocaml
calculemus has quit [Ping timeout: 256 seconds]
MercurialAlchemi has quit [Ping timeout: 255 seconds]
<orbifx>
would the compiler be able to optimise lens calls if it knows all values at compile time?
vramana1 has joined #ocaml
vramana has quit [Ping timeout: 240 seconds]
vramana1 is now known as vramana
<ollehar>
orbifx: what's lens calls?
<ollehar>
ah
<ollehar>
oops
<orbifx>
?
<ollehar>
wrong chat
<ollehar>
but question still holds
freusque has quit [Ping timeout: 264 seconds]
<orbifx>
indeed :)
<orbifx>
see if any of the compilation gurus are about
<ollehar>
orbifx: easy to test, no? spit out byte code and inspect it
<orbifx>
even easier to ask
<ollehar>
but no one is answering...
<orbifx>
also I've not done any byte inspection, so there is an overhead there
<ollehar>
turn on and off optimization, see if the code is different
freusque has joined #ocaml
<companion_cube>
orbifx: if it's immutable, flambda might
<orbifx>
it its, thanks companion_cube
mengu has quit [Remote host closed the connection]
kakadu has quit [Remote host closed the connection]
ollehar has quit [Quit: ollehar]
govg has quit [Ping timeout: 260 seconds]
freechips has quit [Read error: Connection reset by peer]
govg has joined #ocaml
malina has joined #ocaml
fre2 has joined #ocaml
freusque has quit [Ping timeout: 276 seconds]
mengu has joined #ocaml
rand__ has quit [Quit: leaving]
AlexDeni_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jao has joined #ocaml
govg has quit [Read error: Connection reset by peer]