adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | Upcoming OCaml MOOC: https://huit.re/ocamlmooc | OCaml 4.03.0 release notes: http://ocaml.org/releases/4.03.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
kv has joined #ocaml
agarwal1975 has joined #ocaml
haelix has quit [Quit: Lost terminal]
d0nn1e has quit [Ping timeout: 252 seconds]
d0nn1e has joined #ocaml
shinnya has quit [Ping timeout: 252 seconds]
groovy2shoes has joined #ocaml
tmtwd has joined #ocaml
agarwal1975 has quit [Quit: agarwal1975]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
frankpf has joined #ocaml
frankpf is now known as jsqa
FreeBirdLjj has joined #ocaml
jsqa has quit [Remote host closed the connection]
frankpf has joined #ocaml
kv has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kv has joined #ocaml
mcc has joined #ocaml
ygrek_ has quit [Ping timeout: 244 seconds]
damason_afk__ has quit [Ping timeout: 240 seconds]
bruce_r has joined #ocaml
pierpa has quit [Ping timeout: 250 seconds]
tmtwd has quit [Ping timeout: 240 seconds]
Heasummn has joined #ocaml
tmtwd has joined #ocaml
NJBS has joined #ocaml
NJBS has quit [Quit: Catastrophic failure.]
FreeBirdLjj has quit [Read error: Connection reset by peer]
FreeBirdLjj has joined #ocaml
tmtwd has quit [Ping timeout: 264 seconds]
groovy2shoes has quit [Ping timeout: 265 seconds]
MercurialAlchemi has joined #ocaml
tmtwd has joined #ocaml
Heasummn has quit [Read error: Connection reset by peer]
groovy2shoes has joined #ocaml
DmZDsfZoQv has quit [Remote host closed the connection]
nicholasf has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
groovy2shoes has quit [Ping timeout: 252 seconds]
frankpf has quit [Ping timeout: 260 seconds]
kdas__ has joined #ocaml
kdas__ is now known as kushal
kushal has quit [Changing host]
kushal has joined #ocaml
Xizor has joined #ocaml
FreeBirdLjj has joined #ocaml
Xizor has quit [Client Quit]
Xizor has joined #ocaml
rgrinberg has quit [Ping timeout: 250 seconds]
copy` has quit [Quit: Connection closed for inactivity]
<Algebr`> bruce_r: could always do `ocamlfind remove <pkg>`
<bruce_r> I tried that but it didn't work
<bruce_r> I had to manually remove it from the filesystem
<Algebr`> when that happens, then I check `opam switch` and see if the env is messed up
<bruce_r> it was not, I also checked
<Algebr`> :(
<bruce_r> I know. I must have done something wrong to end up in that state, but I don't know what
<Algebr`> I wouldn't blame you, if the build stuff/build tools are making you jump through these hoops, then blame the build tools.
<bruce_r> I don't like to blame others :)
pyon has quit [Quit: fix config]
<Algebr`> its not any particular person
Mercuria1Alchemi has joined #ocaml
<Algebr`> I know for a fact that we lose many, many people because of the icky build situation
Xizor has quit [Read error: Connection reset by peer]
pyon has joined #ocaml
tmtwd has quit [Ping timeout: 276 seconds]
nicholasf has quit [Ping timeout: 244 seconds]
tmtwd has joined #ocaml
Ravana has quit [Ping timeout: 276 seconds]
fraggle-boate has joined #ocaml
Ravana has joined #ocaml
kushal has quit [Quit: Leaving]
kushal has joined #ocaml
Simn has joined #ocaml
sdothum has joined #ocaml
mcc has quit [Quit: Connection closed for inactivity]
edwin has quit [Quit: ZNC - http://znc.in]
Distortion has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
Distortion has joined #ocaml
toolslive has joined #ocaml
Distortion has quit [Client Quit]
ygrek_ has joined #ocaml
tmtwd has quit [Ping timeout: 276 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
tane has joined #ocaml
<toolslive> I'm using: git://github.com/janestreet/opam-repository.git but it seems to be broken: installing core fails with # Error: Unbound module Jane_street_ocamlbuild_goodies
<toolslive> for plenty of packages (fieldslib, ppx_core, variantslib, ...)
<Algebr`> no solution, but interesting module name
<companion_cube> o/
bruce_r has quit [Ping timeout: 260 seconds]
bruce_r has joined #ocaml
nicholasf has joined #ocaml
FreeBirdLjj has joined #ocaml
ggole has joined #ocaml
nicoo has quit [Ping timeout: 244 seconds]
larhat has quit [Quit: Leaving.]
nicholasf has quit [Remote host closed the connection]
nicholasf has joined #ocaml
tmtwd has joined #ocaml
<toolslive> well, I used a specific commit and pinned to that version, but Yesterday, it started failing on travis....
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
f[x] has joined #ocaml
sdothum has joined #ocaml
kushal has quit [Quit: Leaving]
ygrek_ has quit [Ping timeout: 252 seconds]
Simn has quit [Quit: Leaving]
Algebr` has quit [Ping timeout: 265 seconds]
nicholasf has quit [Remote host closed the connection]
zpe has joined #ocaml
nicoo has joined #ocaml
bruce_r has quit [Ping timeout: 250 seconds]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
qln` has quit [Ping timeout: 276 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
tmtwd has quit [Ping timeout: 240 seconds]
picolino has joined #ocaml
manizzle has quit [Ping timeout: 265 seconds]
jwatzman|work has joined #ocaml
f[x] has quit [Ping timeout: 250 seconds]
larhat has joined #ocaml
manizzle has joined #ocaml
manizzle has quit [Max SendQ exceeded]
manizzle has joined #ocaml
manizzle has quit [Max SendQ exceeded]
manizzle has joined #ocaml
jackweirdy has joined #ocaml
<reynir> this ocaml install doesn't have ocamlfind!
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
kushal has joined #ocaml
FreeBirdLjj has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
nicholasf has joined #ocaml
<brab> opam install ocamlfind
FreeBirdLjj has quit [Remote host closed the connection]
ggole_ has joined #ocaml
rks`_ is now known as rks|
ggole has quit [Ping timeout: 250 seconds]
jmiven has quit [Quit: co'o]
jmiven has joined #ocaml
kushal has quit [Excess Flood]
kushal has joined #ocaml
antiRNM has joined #ocaml
<antiRNM> Any on?
TheLemonMan has joined #ocaml
<zozozo> antiRNM: sure, what's your question ?
ggole__ has joined #ocaml
ggole_ has quit [Ping timeout: 250 seconds]
govg has quit [Ping timeout: 240 seconds]
govg has joined #ocaml
antiRNM has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
antiRNM has joined #ocaml
silver has joined #ocaml
FreeBirdLjj has joined #ocaml
antiRNM has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
toolslive has quit [Ping timeout: 250 seconds]
jackweirdy has quit [Read error: Connection reset by peer]
antiRNM has joined #ocaml
antiRNM has quit [Client Quit]
domsj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
larhat has quit [Quit: Leaving.]
larhat has joined #ocaml
larhat has quit [Remote host closed the connection]
kushal has quit [Ping timeout: 260 seconds]
FreeBirdLjj has joined #ocaml
_andre has joined #ocaml
kushal has joined #ocaml
Algebr` has joined #ocaml
<reynir> brab: can't, it's too ancient for opam ;)
fraggle_ has quit [Remote host closed the connection]
sdothum has joined #ocaml
fraggle_ has joined #ocaml
Algebr` has quit [Read error: Connection reset by peer]
Algebr` has joined #ocaml
average has joined #ocaml
Simn has joined #ocaml
yomimono has joined #ocaml
dakk has quit [Ping timeout: 250 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
kushal has quit [Read error: Connection timed out]
kushal has joined #ocaml
two_wheels has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
two_wheels has joined #ocaml
nicholasf has quit [Remote host closed the connection]
malc_ has joined #ocaml
kushal has quit [Max SendQ exceeded]
nicholasf has joined #ocaml
<brab> reynir: ouch … I guess you need to install from source then. Or maybe have a look at godi, if it still exists
kushal has joined #ocaml
two_wheels has quit [Ping timeout: 265 seconds]
kdas__ has joined #ocaml
kushal has quit [Ping timeout: 250 seconds]
fluter has quit [Ping timeout: 260 seconds]
kdas__ is now known as kushal
kushal has quit [Changing host]
kushal has joined #ocaml
agarwal1975 has joined #ocaml
fluter has joined #ocaml
dakk has joined #ocaml
<Drup> reynir: I'm afraid to ask but: how old ?
rgrinberg has joined #ocaml
fluter has quit [Ping timeout: 250 seconds]
<Algebr`> What code is this?
<reynir> Drup: 3.11.2. It's the version shipped in latest Solaris, even :-)
<Drup> have you tried to add it to opam ?
<reynir> Anyway, I just didn't use ocamlfind
fraggle-boate_ has joined #ocaml
agarwal1975 has quit [Quit: agarwal1975]
<reynir> I think struktured put some effort in trying to get opam working without much luck(?)
fraggle-boate_ has quit [Client Quit]
fraggle-boate_ has joined #ocaml
fraggle-boate has quit [Ping timeout: 244 seconds]
fraggle-boate_ has quit [Client Quit]
dakk has quit [Ping timeout: 250 seconds]
fraggle-boate has joined #ocaml
Trou has joined #ocaml
<Trou> hello, I have trouble understanding what doc is http://caml.inria.fr/pub/docs/manual-ocaml/libref/
<Trou> I'm looking for Array.map2
<Trou> which exists here but not in my ocaml runtime
<Trou> and I do not understand what lib I should include to add it
<Algebr`> Trou: what version of ocaml do you have
<brab> I don’t have it either on 4.02.1
<companion_cube> it's probably 4.03
<Algebr`> !manual
<companion_cube> ✔
<cube_bot> done.
<companion_cube> I guess we will need a search function at some point, if the bot is to stay
<Trou> ah damn
<companion_cube> oh my, I didn't include it in containers yet
<Algebr`> if its pure ocaml, then copy paste backport it
<Trou> Algebr`: could you elaborate please ?
<companion_cube> wow, I missed the next one about `--flag=foo` in Arg
<companion_cube> amazing
<Algebr`> Trou: look up the implementation in the ocaml source copy, in array.ml, then copy paste it in your code
<companion_cube> yeah, it's probably small enough that the license doesn't carry over ^^
<companion_cube> a few lines...
<Algebr`> companion_cube: not bad, still not really a competitor to cmdliner
<Trou> ah yeah Algebr` sorry
<brab> Here is the implementation: https://github.com/ocaml/ocaml/pull/230/files
<companion_cube> Algebr`: meh, I generally use Arg and it's largely sufficient for my needs
<ggole__> I'm so happy that Array has the usual sequence functions.
<companion_cube> (I don't write stuff with sub-commands)
<Trou> I'm a bit of a noob in ocaml, can I add it to Array namespace easily ?
sh0t has joined #ocaml
<Algebr`> companion_cube: I more like getting the man page
<Trou> so I can be "transparent" when using 4.03
<Algebr`> module Array = struct include Array let map2 .... = end
fluter has joined #ocaml
<Trou> thanks !
<companion_cube> it's nice, but not sufficiently so that I consider the dependency worth it
<flux> you can even do a trick that uses the compiler version if it exists, I guess just only reversing the let map2 and include?
<Algebr`> 1 self contained thing is a dependency?? says the author of containers lol
<flux> or was a bit more complicated than that..
kushal has quit [Ping timeout: 260 seconds]
<companion_cube> well, I use containers because I would rewrite it in any case, whereas for the programs I write Arg is good enough
dakk has joined #ocaml
<ggole__> You just put let map2 first.
pierpa has joined #ocaml
<Algebr`> right
<ggole__> If it doesn't exist in the module you include it doesn't get shadowed
<ggole__> Oh, that's what flux said
<flux> but will it complain?
<companion_cube> but for instance I depend on menhir, because it's really worth it
ggole__ is now known as ggole
<ggole> flux: multiple bindings of the same name is fine
<brab> Algebr`: how about the module signature? Can you pull the same trick?
mcspud has quit [Ping timeout: 260 seconds]
<ggole> It's types and modules that are an error to duplicate
<Drup> only types
<ggole> The include trick does work for signatures
<Drup> modules are fine
<brab> ggole: cool, thanks
<ggole> Oh, hmm. Is it classes that I'm thinking of?
<Algebr`> hmm, include (module type of ...)
<Algebr`> i think I used that trick once
<Drup> classes ≈ types
<Drup> (declaring a classe creates a new type)
<ggole> module T = struct module M = struct end module M = struct end end => Error: Multiple definition of the module name M
<ggole> And constructor names, too
<Drup> huum, weird
<ggole> In fact, of all the bindings, I think only values are allowed to duplicate. (I could be wrong.)
<Drup> constructor names are just a warning since constructor disambiguation, no ?
nicholas_ has joined #ocaml
<ggole> Oh, good point.
<ggole> Ah, I didn't type that correctly - *exception* constructor names
<Drup> ah, yes
<ggole> Constructor names can duplicate, as you say
<brab> It depends: you cannot have two contructors of the same name in the same type
nicholasf has quit [Read error: Connection reset by peer]
<Drup> well, not in the same type
<brab> # type test = Foo | Foo ;;
<Drup> eh :p
<brab> Error: Two constructors are named Foo
<mrvn> brab: type t = Foo type x = Foo
<ggole> And extensible variants too
<ggole> (As you would expect)
<brab> mrvn: yes, I know. They’re not in the same type though
mcspud has joined #ocaml
<ggole> Hmm type t = [`Foo | `Foo]
<Drup> ggole: that's okay, since it's equivalent to [ `Foo ]
<ggole> Yeah, I was wondering if it would suggest a warning
<ggole> Because it would almost certainly be a typo
<mrvn> Much funnier is: # let f : [< `Foo of int | `Foo of float] -> unit = function _ -> ();;
<mrvn> val f : [< `Foo of int & float ] -> unit = <fun>
<brab> Waow
<brab> I did not know you could have such intersection types
<ggole> I have yet to produce that type (except deliberately, for fun)
<mrvn> brab: you can have such a type but try creating an instance of it
<companion_cube> reaching for such types should probably be a red flag in your brain
<companion_cube> I've never seen a legit use for those
<mrvn> I think you can do it with objects if you inherit both types.
<brab> mrvn: I can see that. I’d love to see actual use cases
<companion_cube> maybe as phantom types...
kushal has joined #ocaml
<mrvn> companion_cube: since they have no instances, sure.
<Algebr`> mrvn: wait a second, what is this &
<Algebr`> is that a typo
<mrvn> Algebr`: no. it's an "and". You need something that is both int and float.
<mrvn> Algebr`: that's the fun part
<Algebr`> ...
<companion_cube> sounds like a job for... not a number!!!
<Drup> brab: it's mostly an artefact of how unification works for poly variants ...
<Algebr`> never saw this before
FreeBirdLjj has joined #ocaml
<Algebr`> looking in manual
<companion_cube> well it should work in js_of_ocaml
<Algebr`> trying an example in utop
<Drup> Algebr`: You can't actually use it
<Algebr`> I'm not understanding its utility then
<Drup> As I said, it's an artefact of the unification algorithm
<Algebr`> f (`Foo 1);; doesn't work
<Algebr`> yea
<Drup> It probably shouldn't be in the surface language
<Algebr`> at first I'm like, poor man's GADT?
<mrvn> Algebr`: I think you can only use it in 2 ways: phantom types and objects.
<Algebr`> what's an objects example?
<Algebr`> based
<brab> Here is an example that is capilotracté but usable
<brab> # let f : [< `Foo of [< `Bar | `Baz] | `Foo of [< `Baz | `Fob] ] -> unit = function _ -> ();;
<brab> val f : [< `Foo of [< `Bar | `Baz ] & [< `Baz | `Fob ] ] -> unit = <fun>
<brab> # f (`Foo `Baz);;
<brab> - : unit = ()
<Algebr`> companion_cube: did the introduction of the bot also introduce the repl?
<mrvn> # let f : [< `Foo of <x : int; ..> | `Foo of <y : int; ..> ] -> unit = fun _ -> ();;
<mrvn> val f : [< `Foo of < x : int; .. > & < y : int; .. > ] -> unit = <fun>
<Algebr`> what does capilotracté mean
<lyxia> tracté par les capillaires
<brab> Algebr`: pulled by the hair
<brab> meaning it’s borderline useless
<companion_cube> Algebr`: no, no repl
<brab> mrvn: nice
<Algebr`> nuts example
<companion_cube> also, a repl is harder to do safely and leads to spam
<Algebr`> (Who introduced the repl)?
<companion_cube> rather use try.ocaml.org or something like that
<brab> we’re copying and pasting
<brab> (well, at least I am)
<Algebr`> ah
<mrvn> Algebr`: think: [< `Foo of comparable & printable ]
<Algebr`> mrvn: yea, groking that easier
<Algebr`> why even allow this though
<Algebr`> was it necessary?
<mrvn> But it's nice to see it works for the intersection of polymophic variants too
<mrvn> Algebr`: side effect of the unification
<mrvn> Algebr`: and usefull
<ggole> Subtracting constructors would be more useful
nicholas_ has quit [Remote host closed the connection]
<mrvn> [< a - `Foo ]?
<ggole> Yeah
evhan has quit [Ping timeout: 264 seconds]
<mrvn> damn
al-damiri has joined #ocaml
evhan has joined #ocaml
hyperbor1ean has quit [Read error: Connection reset by peer]
hyperboreean has joined #ocaml
Simn has quit [Quit: Leaving]
Algebr` has quit [Ping timeout: 276 seconds]
copy` has joined #ocaml
agarwal1975 has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
zpe has quit [Remote host closed the connection]
ebird has joined #ocaml
ebird has left #ocaml [#ocaml]
toolslive has joined #ocaml
kushal has quit [Ping timeout: 252 seconds]
<tormen> What is the best way to PGOCaml support PostgreSQLs pg_enum type ?
<tormen> s/to/for having/
Mercuria1Alchemi has quit [Ping timeout: 258 seconds]
kushal has joined #ocaml
<tormen> ... I wonder why this did not get merged in in February (for the release of 2.3)...
<tormen> Looking at : https://github.com/darioteixeira/pgocaml/pull/3/commits/95aa9667a3dc11678672cfe4f934dae8e28c81c9 I wonder : In camlp4 "flags = LIST0 [ x = STRING -> x ]" means ... a list of ... string -> x ... with x being ... the Variant ?
jwatzman|work has quit [Quit: jwatzman|work]
pyon has quit [Quit: fix config]
<tormen> ok LIST0 = list of symbols, possibly empty...
sh0t has quit [Ping timeout: 240 seconds]
bruce_r has joined #ocaml
fraggle-boate has quit [Read error: Connection reset by peer]
fraggle-boate has joined #ocaml
<tormen> so now "[ x = STRING -> x]" ...
<tormen> [ list-of-rules-separated-by-bars ] and rule = list-of-symbols-separated-by-semicolons -> action
<tormen> ... so "x = STRING -> x" is a rule (no bar ;)) ?
<tormen> ... and the action is to return "x" ... and I suppose "x = STRING" means "x is of type STRING" ?
<tormen> ... so a list of Strings (possibly empty ... even though I wonder if this makes sense for a pg_enum... hmm maybe they can be empty too)
<tormen> am I getting warmer ?
pyon has joined #ocaml
seangrove has joined #ocaml
shinnya has joined #ocaml
bruce_r has quit [Ping timeout: 258 seconds]
pyon has quit [Quit: fix config]
mcspud has quit [Ping timeout: 250 seconds]
pyon has joined #ocaml
jwatzman|work has joined #ocaml
mcspud has joined #ocaml
bruce_r has joined #ocaml
Trou has left #ocaml [#ocaml]
strykerkkd has joined #ocaml
Heasummn has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
thizanne has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
nicoo has quit [Ping timeout: 260 seconds]
nicoo has joined #ocaml
<j0sh> angstrom is very nice. can references to 'char' in the documentation be safely generalized to 'byte' or is 'char' actually encoding dependent?
<companion_cube> in OCaml, `char` is actually a byte
<companion_cube> (strings are bytestrings; encodings should be handled by libraries but I'd recommend utf8 anyway)
<j0sh> thats what i figured, just wanted to double check
<j0sh> so val take : int -> string t will actually take however many bytes that's asked for
<companion_cube> indices in strings are indeed byte indices
<companion_cube> (anyway, codepoint indicing is slow and complicated…)
<j0sh> (when writing parsers, i'm usually thinking in terms of bits and bytes not characters :) )
<j0sh> yup, alright
<j0sh> doing a STUN parser using angstrom
<j0sh> maybe it'll turn into a full fledged ICE implementation one day, who knows
<j0sh> NAT in OCaml :)
tane has quit [Quit: Leaving]
jwatzman|work has quit [Quit: jwatzman|work]
toolslive has quit [Remote host closed the connection]
k1000 has quit [Quit: Lost terminal]
k1000 has joined #ocaml
domsj has quit [Ping timeout: 250 seconds]
qdwang has joined #ocaml
<qdwang> Is there any way to pretty print the variable content which is defined by some type or record?
<Leonidas> qdwang: not really a generic one unless you use ppx_deriving_show
qdwang has quit [Ping timeout: 264 seconds]
<Heasummn> Is there a data type like Map that can store more than one of a type?
<Heasummn> err
<Heasummn> Something like Map, but with multiple entries
<Heasummn> and I can use something like find_all
<Drup> Heasummn: store a list ?
<Heasummn> yeah I guess that works
<chelfi> you can use a Map of Sets
<chelfi> if you like that kind of things
<companion_cube> or a multimap abstraction
<companion_cube> (funny, in containers I have both multimaps and helpers for `'a list Map.t`)
<Heasummn> does Batteries have something like that built in, as I'd rather not rewrite it.
<companion_cube> !batteries
<companion_cube> !batteries_doc
<companion_cube> BatMultiPMap
<Heasummn> thanks, the one google gives is a bit outdated
<companion_cube> yeah
<companion_cube> hence the alias here
<companion_cube> weird that batteries only has a polymorphic multimap though
<companion_cube> https://c-cube.github.io/ocaml-containers/0.19/CCMultiMap.html for the self-promotion part :]
<Heasummn> Same as the Map.Make functor though right? I provide it a type, and it maps each type to a Set?
<companion_cube> the polymorphic one should be functor-free
<companion_cube> argh, got to go
d0nn1e has quit [Ping timeout: 260 seconds]
d0nn1e has joined #ocaml
<Heasummn> I used a MultiMap instead, but they make no difference in my use case
<Heasummn> Anyone code with Menhir?
f[x] has joined #ocaml
<Heasummn> I want to allow operator overloading, and to make it easier on me, I want to define a set of operators, and a general OP token.
<Heasummn> In my Compiler. I want to be able to parse that using Menhir
<Heasummn> hmm
<Heasummn> nvm
thizanne has quit [Quit: WeeChat 1.5]
thizanne has joined #ocaml
<Heasummn> How is Camlp4 comapred to Menhir?
<Heasummn> I might move my Parser to that
yomimono has quit [Ping timeout: 276 seconds]
<zozozo> Heasummn: use menhir, camlp4 is dying
<Heasummn> why is it dying?
<zozozo> Because it should be, :p
<zozozo> More seriously, camlp4 has been replaced by ppx
<Heasummn> I'd like to do dynamic parsing, but that's not possible in menhir
<zozozo> Why would you need dynamic parsing ?
<Heasummn> operators
<zozozo> Can't you just parse any operator, and then eventually reject some construction when typing ?
<Heasummn> That's what I intended to do, but it becomes a pain when it comes to precedence and associativity
Simn has joined #ocaml
<zozozo> Users of the language can dynamically change precedence of operators ?
<zozozo> Seems rather ambitious
johnf has joined #ocaml
kushal has quit [Ping timeout: 252 seconds]
<Heasummn> that, or users can create operators themselves, as can be done in ocaml. The problem comes with special cases such right associative operators or what precedence each operator takes
thizanne has quit [Read error: Connection reset by peer]
thizanne has joined #ocaml
<zozozo> Well, if every definable operators have the same precedence (or rather precedence can be determined syntactically) as is done in ocaml afaik, there should be no problem
<Heasummn> what about overloading operators, which can't be done in Ocaml? Say I want to overload unary minus, but keep it at the same precedence as the normal unary minus
<Heasummn> I don't want to switch to something new, as a lot of the code is already written in Menhir, and I'd have to rewrite the whole parsing stage. But I can't seem to find any simple way to do what I want
<zozozo> I'd say special case the minus in the parser and forbid custom operators from having that same complex behavior ?
<Heasummn> alright.
<Heasummn> what about + - being lower than * and /, or should that be special case too
kushal has joined #ocaml
<Heasummn> zozozo, Any guidance on that?
rgrinberg has quit [Quit: WeeChat 1.5]
<lyxia> Heasummn: does overloading affect precedence in your language?
<Heasummn> I guess it shouldn't. That'll make parsing a hell lot easier, and doesn't lose much
<Heasummn> But I would like to overload built in operators, such as +
sepp2k has joined #ocaml
<lyxia> so + should have dynamic precedence or something?
kakadu has joined #ocaml
soupault has joined #ocaml
<Heasummn> not sure what you mean. + should be overloadable, but it has a different precedence than other operators, same idea with -, *, /, and really all arithmetic ops
<lyxia> I'm confused, because you mention both precedence and overloading, and I don't see how they should be related in any way.
Gueben has joined #ocaml
<lyxia> Do you have an example?
<Heasummn> sure
<zozozo> Overloading should be resolved during typing, precedence during parsing
<Heasummn> so I want the user to be able to define an operator such as ->, and do whatever they'd like. I'd also like them to be able to overload say + upon two strings, or upon some BigInt type or whatever
rgrinberg has joined #ocaml
<Heasummn> I do this by making a general op type that takes a string and two expressions
Gueben has quit [Client Quit]
<Drup> Heasummn: this is not a parsing problem
<Drup> (if you were to do agda/coq-level crazyness, that would be a different mater ...)
<Heasummn> what is the general solution to that then?
<lyxia> what zozozo said
strykerkkd has quit [Quit: Leaving]
<Heasummn> I made a generic Op type, which takes an op and two expressions. The problem is that some arithmetic operators have different precedence. For example, + isn't at the same level as *. How would I deal with that, and still allow user defined operators to have a precedence?
antiRNM has joined #ocaml
antiRNM has quit [Client Quit]
<Heasummn> I think I'm confused in terms of wording
ggole has quit []
<lyxia> So you want users to be able to specify the precedence of operators?
<Heasummn> I want all operators to have the same precedence. But their are some common exceptions to that rule, such as arithmetic operators
thizanne has quit [Ping timeout: 240 seconds]
<Heasummn> I'm sorry if I'm doing something facepalm worthy.
<zozozo> Treat arithmetic operators separately from user defined operators
<Heasummn> and then handle overloading of them at Type Checking?
<zozozo> Yup
<Heasummn> I believe I was over thinking that a bit
<Drup> overloading is pretty much exactly name resolution, and that's a typechecking-time concern
malc_` has joined #ocaml
malc_ has quit [Ping timeout: 240 seconds]
shinnya has quit [Ping timeout: 250 seconds]
zpe has joined #ocaml
Heasummn has quit [Quit: Leaving]
zxygentoo has joined #ocaml
SpiceGuid has joined #ocaml
zxygentoo has quit [Client Quit]
sfri has quit [Remote host closed the connection]
rgrinberg has quit [Ping timeout: 250 seconds]
pyon has quit [Ping timeout: 265 seconds]
sfri has joined #ocaml
octachron has joined #ocaml
TheLemonMan has quit [Remote host closed the connection]
MercurialAlchemi has quit [Ping timeout: 240 seconds]
TheLemonMan has joined #ocaml
TheLemonMan has quit [Remote host closed the connection]
TheLemonMan has joined #ocaml
rgrinberg has joined #ocaml
pyon has joined #ocaml
_andre has quit [Quit: leaving]
zpe has quit [Remote host closed the connection]
seangrove has quit [Ping timeout: 258 seconds]
infinity0 has quit [Remote host closed the connection]
nicholasf has joined #ocaml
infinity0 has joined #ocaml
georgios1 has joined #ocaml
malc_` has quit [Quit: ERC (IRC client for Emacs 25.0.50.2)]
kakadu has quit [Remote host closed the connection]
<georgios1> Hey guys and girls, hope you don't mind a quick question from an OCaml beginner: Which one is considered more idiomatic, chaining or piping? E.g. `data |> someFunction |> anotherFunction` vs `anotherFunction @@ someFunction data`? Thanks in advance :-)
<rgrinberg> georgios1: |> is preferred by me
<rgrinberg> but i don't even hate parentheses at all :P
<Drup> georgios1: I prefer @@ :p
<Drup> (and in general, I think people tend to overuse |> a bit)
<rgrinberg> |> splits into multiple lines nicelyb
<rgrinberg> but i agree, it's a little too popular
srcerer_ has joined #ocaml
srcerer has quit [Ping timeout: 276 seconds]
srcerer_ is now known as srcerer
<georgios1> I think the case for `|>` is that it corresponds nicely to the way you think about your data, i.e. it works in the same direction as you read it while `a (b (c d))` requires you to read "inside out"
<Drup> georgios1: the issue is that it's quite easy to overuse it to the point that the code is less readable
<Drup> I have seen several people do that
<Drup> Using a lot for just one application, or use it in combination with various flip combinators
<georgios1> Hmm, I see...
<georgios1> Coming from imperative languages the temptation to `|>` everything is just too strong ;)
rgrinberg has quit [Ping timeout: 258 seconds]
<Drup> that's fine :p
tof has joined #ocaml
tof has quit [Client Quit]
<georgios1> Well, thank you then for your opinions, I appreciate that
<Drup> (my opinion is probably in minority)
seangrove has joined #ocaml
rgrinberg has joined #ocaml
<Leonidas> I like it a lot, though I suppose Drup would call it overuse
<Leonidas> (avoiding flipping though as it makes code read like stack based languages which is usually tricky)
bruce_r has quit [Ping timeout: 250 seconds]
<companion_cube> stuff like `a |> (f |> flip) |> (g |> flip)` ? :]
sepp2k has quit [Ping timeout: 265 seconds]
rgrinberg has quit [Ping timeout: 244 seconds]
nicholasf has quit [Ping timeout: 244 seconds]
k1000 has quit [Remote host closed the connection]
agarwal1975 has quit [Quit: agarwal1975]
k1000 has joined #ocaml
k1000 has quit [Remote host closed the connection]
shinnya has joined #ocaml
copy` has quit [Quit: Connection closed for inactivity]
k1000 has joined #ocaml
cthuluh has quit [Ping timeout: 258 seconds]
cthuluh has joined #ocaml
nicholasf has joined #ocaml
georgios1 has quit [Quit: WeeChat 1.5]
manizzle has quit [Read error: Connection reset by peer]
manizzle has joined #ocaml
octachron has quit [Quit: Leaving]
average has quit [Quit: leaving]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
SpiceGuid has quit [Quit: ChatZilla 0.9.92 [SeaMonkey 2.40/20160120202951]]
adelbertc has joined #ocaml
al-damiri has quit [Quit: Connection closed for inactivity]
nicholasf has quit [Remote host closed the connection]
nicholasf has joined #ocaml
Simn has quit [Read error: Connection reset by peer]
bruce_r has joined #ocaml
mcc has joined #ocaml
Nahra has quit [Quit: ERC (IRC client for Emacs 24.5.1)]