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]
<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)