adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.02.3 announced http://ocaml.org/releases/4.02.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nullcatxxx_ has joined #ocaml
nullcatxxx_ has quit [Read error: Connection reset by peer]
AltGr has joined #ocaml
nullcatxxx_ has joined #ocaml
madroach has quit [Ping timeout: 260 seconds]
madroach has joined #ocaml
bobajett has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
keen___________1 has joined #ocaml
keen___________0 has quit [Ping timeout: 250 seconds]
nullcatxxx_ has quit [Quit: gone...]
antkong_ has joined #ocaml
djellemah_ has joined #ocaml
djellemah has quit [Ping timeout: 250 seconds]
rand has quit [Quit: leaving]
tmtwd has joined #ocaml
rgrinberg has quit [Ping timeout: 260 seconds]
FreeBirdLjj has joined #ocaml
TBads has joined #ocaml
tmtwd has quit [Ping timeout: 246 seconds]
TBads has quit [Ping timeout: 252 seconds]
mahem1 has joined #ocaml
<mahem1> Hmmm, what can prevent me from doing this<paste.debian.net/318953> every time i start a new project?
<mahem1> (Of course, other than creating my own special package just for printing stuff how I like it?)
<mahem1> I've checked batteries and it doesn't look too helpful in this regard.
<Enjolras> i don't know any lib with such a function
<Enjolras> maybe you can check deriving
<Enjolras> (this a code generation tool based on syntax extension)
<mahem1> Enjolras: Cool, that looks pretty helpful. I'll have to take a better look at it.
<mahem1> Thakns.
python476 has joined #ocaml
<Enjolras> other option maybe is to use Format
<Enjolras> (Format.pp_print_list)
orbifx has quit [Ping timeout: 272 seconds]
f[x] has quit [Ping timeout: 260 seconds]
TBads has joined #ocaml
<mahem1> Enjolras: Hmmm, that is built in it seems, so perhaps slightly better.
<mahem1> Though, the Format.pp_print_list function says that it's not found... I wonder.
toomuchtvrotsurb has quit []
antkong_ has quit [Ping timeout: 240 seconds]
antkong_ has joined #ocaml
<Enjolras> mahem1: what is not found ?
TBads has quit [Quit: WeeChat 1.1.1]
<Enjolras> mahem1: are you using latest ocaml ?
djellemah_ is now known as djellemah
tmtwd has joined #ocaml
rgrinberg has joined #ocaml
jimt has quit [Ping timeout: 272 seconds]
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
KDr2 has quit [Ping timeout: 246 seconds]
jimt has joined #ocaml
swgillespie has joined #ocaml
psy_ has joined #ocaml
psy_ has quit [Max SendQ exceeded]
psy_ has joined #ocaml
pierpa has quit [Ping timeout: 240 seconds]
<rgrinberg> seliopou: what's ailing you with cohttp
<seliopou> was gonna comment on the specific commit
<seliopou> basically, cohttp should have a parse_form function
<rgrinberg> Why not just use uri though?
<rgrinberg> on the body that is
<seliopou> it's a pretty common use case that not everybody knows how to do without looking up
mac10688 has quit [Ping timeout: 265 seconds]
<seliopou> i mean i don't actually know how to do it without looking it up becasuse I rely on libraries to do it for me
<seliopou> in other languages, that it
<seliopou> is*
<rgrinberg> I acommplish this with: body |> Body.to_string >>| Uri.query_of_ecnoded
<seliopou> yeah, so that should be in the library somewhere
psy_ has quit [Ping timeout: 264 seconds]
patronus has quit [Read error: Connection reset by peer]
patronus has joined #ocaml
darkf has joined #ocaml
<rgrinberg> ok sure, but copy pasting this isn't so bad. I'm just a bit uneasy making it so easy for users to just slurp an http body into a string that easily..
<rgrinberg> Maybe i'm overly cautious though
KDr2 has joined #ocaml
<seliopou> yeah that's a legit concern in general but i think with forms it's safe to say that if you want part of it, you want it all
<rgrinberg> it's a 1 liner helper so I don't mind exposing this in both the lwt and async backends. Just make an issue for this because that PR you commented includes other stuff.
<rgrinberg> You could of course even make a PR to fix this as well :)
<seliopou> of course, I can do that
<seliopou> should this not go into the body signature?
<seliopou> ah of course, the whole pure/async thing
<rgrinberg> it can go in the pure body signature but it should handle the backend specific cases of string Pipe.Reader.t and string Lwt_stream.t
rgrinberg has quit [Ping timeout: 240 seconds]
shinnya has quit [Ping timeout: 264 seconds]
rgrinberg has joined #ocaml
rgrinberg has quit [Ping timeout: 255 seconds]
michael_lee has joined #ocaml
michael_lee has quit [Client Quit]
AltGr has left #ocaml [#ocaml]
tmtwd has quit [Ping timeout: 272 seconds]
MercurialAlchemi has joined #ocaml
obadz- has joined #ocaml
obadz has quit [Ping timeout: 272 seconds]
obadz- is now known as obadz
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
slash^ has joined #ocaml
kalzz has quit [Ping timeout: 264 seconds]
xet7 has joined #ocaml
rgrinberg has joined #ocaml
kalzz has joined #ocaml
native_killer has joined #ocaml
rgrinberg has quit [Ping timeout: 260 seconds]
sz0 has joined #ocaml
python476 has quit [Ping timeout: 246 seconds]
jimt has quit [Ping timeout: 255 seconds]
xificurC has joined #ocaml
xificurC has quit [Client Quit]
xificurC has joined #ocaml
MasseR has quit [Quit: WeeChat 1.1.1]
Kakadu has joined #ocaml
ggole has joined #ocaml
pyon is now known as macro-pyon
Haudegen has quit [Ping timeout: 240 seconds]
zpe has joined #ocaml
Haudegen has joined #ocaml
huza has joined #ocaml
native_killer has quit [Ping timeout: 244 seconds]
FreeBirdLjj has quit [Ping timeout: 240 seconds]
zpe has quit [Remote host closed the connection]
jimt has joined #ocaml
native_killer has joined #ocaml
orbifx has joined #ocaml
native_killer has quit [Read error: Connection reset by peer]
native_killer has joined #ocaml
^elyse^ has joined #ocaml
ollehar has joined #ocaml
^elyse^ has quit [Client Quit]
macro-pyon has quit [Quit: Angels fall, all for you, heretic! Demon heart, bleed for us! (My soul is yours, Dark Master. I will fight for you.)]
ollehar has quit [Ping timeout: 240 seconds]
native_killer has quit [Ping timeout: 265 seconds]
^elyse^ has joined #ocaml
ollehar has joined #ocaml
huza has quit [Quit: WeeChat 0.3.8]
sz0 has quit [Quit: Connection closed for inactivity]
ollehar has quit [Ping timeout: 250 seconds]
mort___ has joined #ocaml
mearnsh has quit [Ping timeout: 250 seconds]
^elyse^ has quit [Quit: Leaving]
<Kakadu> folks
<Kakadu> Let's say I use js_of_ocamlbuild plugin which says that I should use `dispatch` function only once
<Kakadu> Let's say I want to call `dispatch` once more to add my custom rules
<Kakadu> I can't do it straightforward because last `disaptch` call overrides previous one
<Kakadu> How can I solve this?
ollehar has joined #ocaml
<Kakadu> I probably should explain why I need this
<Kakadu> I need custom ocamlbuild flag
<Kakadu> to be able to pass some plugin files to camlp5
<Kakadu> using -pp option
^elyse^ has joined #ocaml
sternenseemann has quit [Quit: Changing server]
mort___ has quit [Quit: Leaving.]
pacmann has joined #ocaml
ollehar has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
sternenseemann has joined #ocaml
rgrinberg has quit [Ping timeout: 252 seconds]
pyon has joined #ocaml
mort___ has joined #ocaml
sternenseemann has quit [Quit: leaving]
sternenseemann has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 260 seconds]
mearnsh has joined #ocaml
<jmasseo> hm
antkong_ has quit [Quit: antkong_]
sz0 has joined #ocaml
<jmasseo> There are some restrictions concerning polymorphism and mutable data structures. One cannot
<jmasseo> enclose polymorphic objects inside mutable data structures.
<jmasseo> but i can have a Type which happens to be polymorphic and have a list of it.
<jmasseo> but i can't have ["Cat";7]
<jmasseo> but i can have ['String "Cat"; 'Int 7]
<companion_cube> `String and `Int, I suppose
<jmasseo> so if i have type foo = [ `String of string | `Int of int ]
<jmasseo> i could have a list of type foo
<jmasseo> this is more of a 'multivariant' than a 'polymorphism'
<jmasseo> or something
<jmasseo> i should have gone to college
obadz has quit [Ping timeout: 252 seconds]
<jmasseo> my type can be foo&int, or foo&string, but never string&int.
obadz has joined #ocaml
<companion_cube> I don't know what you mean by string&int
<companion_cube> but indeed, you can never have a list of values that do not have the same type
<companion_cube> foo is one type, but it's useful because it's easy to build from string and from int
<jmasseo> what is the term for what type of type foo is?
<companion_cube> it's a polymorphic variant, although the name does not matter much
<pacmann> I need help to implement the traverse function (line 50). http://pastebin.com/5jPKXvKB
<pacmann> I can't figure out how to write it correctly
<companion_cube> you need to explore h first, then explore ls
<jmasseo> on line 55 what is the @ shorthand for?
<companion_cube> it's list concatenation
<jmasseo> groovy
<companion_cube> h :: ls -> List.fold_right traverse h (h::mvs)? or something like this, pacmann
<companion_cube> jmasseo: there also is List.append
<companion_cube> oh wait, it should still be List.fold_left if you start with h, but then you need to reverse the arguments
<pacmann> I need to apply the function traverse to each element of h::ls (each visitable node)
mort___ has quit [Quit: Leaving.]
<jmasseo> what is this graph implementation for?
<pacmann> didactic purpose
<jmasseo> roger
<companion_cube> http://paste.isomorphis.me/gPg smething like this, if you write it manually
<pacmann> I spent like 2h behind this function. Can't believe you did it in just a second.
<pacmann> Thank you
<companion_cube> test it first!
<companion_cube> but the idea is that you need a list of vertices to explore, not just a single "current vertex"
<pacmann> Seems to work
<companion_cube> :)
<companion_cube> great
<companion_cube> so now you should make sure you understand the function
<pacmann> The idea "you need a list of vertices to explore" is illuminating
<companion_cube> :)
<companion_cube> the list here behaves like a stack
obadz has quit [Ping timeout: 240 seconds]
obadz has joined #ocaml
<pacmann> I don't get this: traverse (h::ls @ l') (h::mvs) (last line)
<pacmann> What's the meaning of the first argument?
mac10688 has joined #ocaml
<companion_cube> it's "the list composed of: h, then ls, then l')
<companion_cube> h :: (ls @ l')
<pacmann> Yes, I know the syntax, but I don't get what are you doing
<Kakadu> Folks, anybody have seen a when a case when we install cmo in the directory `ocamlfind query packagename`/somedirectory?
<Kakadu> I want to hide this cmo somehow because it is called `map.cmo` and I have problems with Map.Make when it is in the search path
t4nk516 has joined #ocaml
<companion_cube> pacmann: so, there's h :: ls which is a list of vertices to explore
<companion_cube> but l' should also be explored
<t4nk516> Hi, in some sequential code, I'm seeing a strange behavior with printf: I have two printf statements, one after the other, with the second flushing the buffer (via "%!"), and sometimes the second output displays before the first
<t4nk516> Is this to be expected?
<companion_cube> so (h :: ls @ l') is the reunion of all those vertices to explore
<jmasseo> h being a single vertex and ls and l being lists of vertices
<companion_cube> t4nk516: are they both printf, not eprintf/fprintf?
<t4nk516> Yes, both Printf.printf
<pacmann> companion_cube: why is h a vertex to explore? aren't you exploring it right now? (you're adding it to the marked vertices)
<t4nk516> if I add "%!" to the end of the first printf format string as well, then it appears in the correct order
<companion_cube> pacmann: oh right, maybe it's useless
<companion_cube> I didn't think this for long :)
<companion_cube> you can probably write ls @ l'
<pacmann> it's not. if i remove it doesn't works anymore
BitPuffin|osx has joined #ocaml
<companion_cube> oh no wait
<companion_cube> we're visiting s, not h
<companion_cube> that's why
<pacmann> so we also need to add s to the marked vertices
<t4nk516> Ah! there was a lurking "open Format" in the module containing the first printf - So one of the statements is Format.printf, the other is Printf.printf
<t4nk516> Situation understood. Thank you :-)
<companion_cube> pacmann: yeah, this was just a quick example of how to manage a list of vertices to be explored
<companion_cube> you can improve on this, clearly
<pacmann> ok, thanks. maybe it's just a coincidence it works correctly in my example and it should be improved a little.
<companion_cube> yep
<companion_cube> also, at some point you might want to use Set for representing the set of already explored vertices
<companion_cube> but take it slow
t4nk516 has quit [Ping timeout: 246 seconds]
mort___ has joined #ocaml
ncthom91 has joined #ocaml
ncthom91 has quit [Client Quit]
MercurialAlchemi has joined #ocaml
pierpa has joined #ocaml
shinnya has joined #ocaml
obadz has quit [Ping timeout: 244 seconds]
obadz has joined #ocaml
mac10688 has quit [Ping timeout: 256 seconds]
rgrinberg has joined #ocaml
Haudegen has quit [Ping timeout: 260 seconds]
Haudegen has joined #ocaml
mort___ has quit [Quit: Leaving.]
lobo has joined #ocaml
mort___ has joined #ocaml
mort___ has quit [Quit: Leaving.]
^elyse^ has quit [Quit: Leaving]
tane has joined #ocaml
tmtwd has joined #ocaml
ingsoc has joined #ocaml
nullcatxxx_ has joined #ocaml
jeroud has quit [Ping timeout: 240 seconds]
dch has quit [Ping timeout: 240 seconds]
pacmann` has joined #ocaml
MeanMankyKITTEH has quit [Ping timeout: 240 seconds]
NhanH has quit [Ping timeout: 240 seconds]
Asmadeus has quit [Ping timeout: 240 seconds]
sspi has quit [Ping timeout: 240 seconds]
yminsky has quit [Ping timeout: 240 seconds]
pacmann has quit [Ping timeout: 240 seconds]
dexterph has quit [Ping timeout: 240 seconds]
chris2 has quit [Ping timeout: 240 seconds]
nullcatxxx_ has quit [Client Quit]
Asmadeus has joined #ocaml
jeroud has joined #ocaml
MeanMankyKITTEH has joined #ocaml
NhanH has joined #ocaml
sspi has joined #ocaml
dch has joined #ocaml
yminsky has joined #ocaml
chris2 has joined #ocaml
dexterph has joined #ocaml
nullcatxxx_ has joined #ocaml
pierpa has quit [Ping timeout: 264 seconds]
orbifx has quit [Ping timeout: 252 seconds]
jonasac has joined #ocaml
ohama has quit [Ping timeout: 244 seconds]
darkf has quit [Quit: Leaving]
ohama has joined #ocaml
sz0 has quit [Quit: Connection closed for inactivity]
tmtwd has quit [Ping timeout: 265 seconds]
larhat1 has quit [Remote host closed the connection]
JuggleTux has joined #ocaml
antkong_ has joined #ocaml
Kakadu has quit [Quit: Page closed]
<nullcatxxx_> don't quite understand what's going on here...
JuggleTux has quit [Quit: leaving]
JuggleTux has joined #ocaml
larhat1 has joined #ocaml
antkong_ has quit [Quit: antkong_]
pierpa has joined #ocaml
rgrinberg has quit [Ping timeout: 264 seconds]
masse has joined #ocaml
^elyse^ has joined #ocaml
larhat2 has joined #ocaml
larhat1 has quit [Read error: Connection reset by peer]
martintrojer has joined #ocaml
JuggleTux has quit [Quit: leaving]
Kakadu has joined #ocaml
breadmonster has joined #ocaml
monsterbread has joined #ocaml
jonasac has quit [Remote host closed the connection]
struk|desk2 has quit [Remote host closed the connection]
jonasac has joined #ocaml
jonasac has quit [Ping timeout: 246 seconds]
struk|desk2 has joined #ocaml
struk|desk2 has quit [Read error: Connection reset by peer]
keen___________1 has quit [Ping timeout: 240 seconds]
keen___________1 has joined #ocaml
ingsoc has quit [Remote host closed the connection]
BitPuffin|osx has quit [Remote host closed the connection]
BitPuffin|osx has joined #ocaml
rpg has joined #ocaml
f[x] has joined #ocaml
obadz has quit [Ping timeout: 240 seconds]
shinnya has quit [Ping timeout: 272 seconds]
obadz has joined #ocaml
monsterbread has quit [Ping timeout: 246 seconds]
Algebr has joined #ocaml
struk|desk2 has joined #ocaml
^elyse^ has quit [Quit: Leaving...]
keen___________1 has quit [Ping timeout: 260 seconds]
destrius_ has quit [Ping timeout: 240 seconds]
destrius has joined #ocaml
tane has quit [Quit: Verlassend]
jonasac has joined #ocaml
tane has joined #ocaml
jonasac has quit [Ping timeout: 246 seconds]
Algebr has quit [Remote host closed the connection]
<breadmonster> How similar are F# and OCaml?
<tane> rather similar regarding basics
<tane> ocaml has a module system while F#'s object system and .Net integration are stronger (imho)
<tane> so, the resulting code structure is different
xet7 has quit [Remote host closed the connection]
slash^ has left #ocaml [#ocaml]
BitPuffin|osx is now known as BitPuffin
BitPuffin has quit [Ping timeout: 252 seconds]
ril has joined #ocaml
<Drup> seliopou: so, the tyxml stuff :3
<Kakadu> let's say I have a dozen mutally recursive functions (parser combinators for example) which do something with `state`, i.e. every function takes state and something and return state. I need to implement kind of logger for function calls
<Kakadu> I can change type of `state` as I wish
<Kakadu> And I want to disable logging to make it very lightweight
<Kakadu> only solution which comes to min mind is to parametrize module where my functions are defined by another module and declare loggin primitives there
<Kakadu> and change state to make it contain logging info
<Kakadu> Any other ideas?
<Drup> why make a functor instead of just calling the logging functions ?
^elyse^ has joined #ocaml
<Kakadu> How to disable them?
breadmonster has quit [Ping timeout: 246 seconds]
<Kakadu> I mean, how to disable logging
<Drup> if do_logging then ... ?
<Kakadu> it will evaluate arguments anyway
<Drup> Not really ..
<Kakadu> do you mean something like `let log fmt = if do_log then fprintf fmt else ifprintf fmt`, Drup?
rgrinberg has joined #ocaml
<Drup> kakadu: please just read https://github.com/mirage/ocaml-git/pull/130
struk|desk2 has quit [Remote host closed the connection]
<Drup> kakadu: also, if you are using lwt, just use Lwt_log
<Drup> (the syntax extension takes care of removing debug statements at compile time)
<^elyse^> morning
<nullcatxxx_> GMT+9 ?
<Kakadu> Drup: looks interesting, thanks
<Drup> kakadu: if you are not affraid of bleeding edge, there is also last bunzli's library.
dexterph has quit [K-Lined]
dexterph has joined #ocaml
ril is now known as ril[away]
ril[away] has quit [Read error: No route to host]
shinnya has joined #ocaml
ril has joined #ocaml
jonasac has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 240 seconds]
struk|desk2 has joined #ocaml
jonasac has quit [Ping timeout: 240 seconds]
ggole has quit []
Algebr has joined #ocaml
struk|desk2 has quit [Ping timeout: 268 seconds]
obadz has quit [Ping timeout: 265 seconds]
struk|desk2 has joined #ocaml
struk|desk2 has quit [Remote host closed the connection]
obadz has joined #ocaml
BitPuffin|osx has joined #ocaml
keen___________1 has joined #ocaml
^elyse^ has quit [Quit: Leaving...]
rpg has quit [Quit: rpg]
f[x] has quit [Ping timeout: 250 seconds]
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
Lis has joined #ocaml
ygrek has joined #ocaml
ingsoc has joined #ocaml
Kakadu has quit [Remote host closed the connection]
tane has quit [Quit: Verlassend]
^elyse^ has joined #ocaml
jonasac has joined #ocaml
jonasac has quit [Ping timeout: 246 seconds]