adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.02.2 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
sp0on has quit [Ping timeout: 246 seconds]
dmh has quit [Quit: dmh]
ollehar has quit [Read error: Connection reset by peer]
sp0on has joined #ocaml
ollehar has joined #ocaml
tmtwd has quit [Ping timeout: 256 seconds]
toomuchtvrotsurb has quit [Remote host closed the connection]
jao has quit [Ping timeout: 256 seconds]
toomuchtvrotsurb has joined #ocaml
toomuchtvrotsurb has quit [Remote host closed the connection]
haesbaer1 has joined #ocaml
<struktured> :)
keen__________21 has quit [Ping timeout: 250 seconds]
haesbaert has quit [Ping timeout: 250 seconds]
keen__________21 has joined #ocaml
pkrnj has joined #ocaml
toomuchtvrotsurb has joined #ocaml
toomuchtvrotsurb has quit [Ping timeout: 248 seconds]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Denommus` has joined #ocaml
tmtwd has joined #ocaml
tmtwd has quit [Remote host closed the connection]
hay207 has joined #ocaml
tmtwd has joined #ocaml
swgillespie has joined #ocaml
relrod has quit [Ping timeout: 256 seconds]
toomuchtvrotsurb has joined #ocaml
swgillespie has quit [Client Quit]
Denommus` has quit [Ping timeout: 252 seconds]
toomuchtvrotsurb has quit [Remote host closed the connection]
Algebr has joined #ocaml
monoprotic has quit []
badkins has quit []
shinnya has quit [Ping timeout: 246 seconds]
manizzle has quit [Ping timeout: 252 seconds]
sailorswift has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ericsmithvt has joined #ocaml
monoprotic has joined #ocaml
Denommus` has joined #ocaml
ericsmithvt has quit [Quit: Textual IRC Client: www.textualapp.com]
obadz has quit [Ping timeout: 246 seconds]
obadz has joined #ocaml
fraggle-boate_ has joined #ocaml
fraggle-boate has quit [Ping timeout: 248 seconds]
sailorswift has joined #ocaml
cxfreeio has joined #ocaml
ericsmithvt has joined #ocaml
hay207 has quit [Ping timeout: 264 seconds]
Denommus` has quit [Quit: going to sleep]
ericsmithvt has quit [Quit: Textual IRC Client: www.textualapp.com]
meiji11 has joined #ocaml
rgoulter has joined #ocaml
pyx has joined #ocaml
pyx has quit [Client Quit]
mcclurmc has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
rgoulter has quit [Quit: Leaving]
rgoulter has joined #ocaml
manizzle has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
hay207 has joined #ocaml
darkf has joined #ocaml
tmtwd has quit [Remote host closed the connection]
ygrek has quit [Ping timeout: 264 seconds]
psy_ has quit [Ping timeout: 265 seconds]
manizzle has quit [Ping timeout: 255 seconds]
cxfreeio has quit [Read error: No route to host]
samrat has joined #ocaml
MercurialAlchemi has joined #ocaml
IbnFirnas has quit [Ping timeout: 244 seconds]
Mass321 has quit [Read error: Connection reset by peer]
eventualbuddha has quit [Read error: Connection reset by peer]
steshaw has quit [Read error: Connection reset by peer]
seako has quit [Read error: Connection reset by peer]
l1x has quit [Ping timeout: 240 seconds]
S11001001 has quit [Ping timeout: 246 seconds]
strmpnk has quit [Ping timeout: 240 seconds]
ggherdov has quit [Ping timeout: 252 seconds]
sspi has quit [Ping timeout: 246 seconds]
yminsky has quit [Ping timeout: 252 seconds]
msch has quit [Ping timeout: 252 seconds]
Sorella has quit [Ping timeout: 240 seconds]
jeroud has quit [Ping timeout: 248 seconds]
cojy has quit [Ping timeout: 240 seconds]
Sorella has joined #ocaml
bitbckt_ has quit [Ping timeout: 248 seconds]
bobpoekert has quit [Ping timeout: 248 seconds]
samrat has quit [Ping timeout: 240 seconds]
lambdahands has quit [Read error: Connection reset by peer]
samrat has joined #ocaml
samrat has quit [Read error: Connection reset by peer]
msch has joined #ocaml
cojy has joined #ocaml
steshaw has joined #ocaml
l1x has joined #ocaml
strmpnk has joined #ocaml
lambdahands has joined #ocaml
manud has quit [Quit: manud]
IbnFirnas has joined #ocaml
toomuchtvrotsurb has joined #ocaml
Mass321 has joined #ocaml
BitPuffin|osx has joined #ocaml
jeroud has joined #ocaml
manud has joined #ocaml
mcclurmc has joined #ocaml
sailorswift has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
samrat has joined #ocaml
samrat has quit [Read error: Connection reset by peer]
samrat has joined #ocaml
S11001001 has joined #ocaml
eventualbuddha has joined #ocaml
toomuchtvrotsurb has quit [Ping timeout: 256 seconds]
rgoulter has quit [Quit: Leaving]
bobpoekert has joined #ocaml
samrat has quit [Ping timeout: 248 seconds]
yminsky has joined #ocaml
sp0on has quit [Ping timeout: 246 seconds]
Akshay has joined #ocaml
sspi has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
swgillespie has joined #ocaml
seako has joined #ocaml
pkrnj has quit [Quit: Textual IRC Client: www.textualapp.com]
meiji11 has quit [Remote host closed the connection]
matason has joined #ocaml
bitbckt has joined #ocaml
sp0on has joined #ocaml
ygrek has joined #ocaml
ggherdov has joined #ocaml
<jyc> is there a way to debug why merlin says "failed to load some packages: pcre" ?
<jyc> I'm able to build my project using pcre through ocamlbuild/ocamlfind just fine, and I can #require "pcre" in utop
<jyc> ocamlfind query pcre works as expected too :(
Denommus` has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 252 seconds]
Denommus has quit [Ping timeout: 246 seconds]
<jyc> updated my version of merlin and the problem went away
<jyc> must have been a bug that was fixed
<struktured> nice
fyolnish has left #ocaml ["Leaving..."]
manud has quit [Quit: manud]
hay207 has quit [Ping timeout: 244 seconds]
ldopa has quit [Ping timeout: 264 seconds]
BitPuffin|osx has quit [Ping timeout: 246 seconds]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
relrod_ has joined #ocaml
relrod_ has quit [Changing host]
relrod_ has joined #ocaml
relrod_ is now known as relrod
rgoulter has joined #ocaml
siddharthv_away is now known as siddharthv
kushal has quit [Ping timeout: 256 seconds]
rgoulter has quit [Quit: Leaving]
siddharthv is now known as siddharthv_away
kushal has joined #ocaml
swgillespie has joined #ocaml
matason has quit [Ping timeout: 265 seconds]
lewis1711 has joined #ocaml
carc has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Haudegen has quit [Ping timeout: 264 seconds]
martinium_ has quit [Quit: Leaving]
martinium_ has joined #ocaml
martinium_ has quit [Client Quit]
Haudegen has joined #ocaml
martinium has joined #ocaml
<def`> jyc: is ocamlmerlin built with the same compiler ?
darkf has quit [Read error: Connection reset by peer]
darkf has joined #ocaml
keen__________21 has quit [Read error: Connection reset by peer]
keen__________21 has joined #ocaml
NingaLeaf has quit [Read error: Connection reset by peer]
vodkaInferno has quit [Read error: Connection reset by peer]
vodkaInferno has joined #ocaml
zpe has joined #ocaml
Kakadu has joined #ocaml
Kakadu has quit [Remote host closed the connection]
sh0t has joined #ocaml
matason has joined #ocaml
ggole has joined #ocaml
hannes has quit [Read error: Connection reset by peer]
hannes has joined #ocaml
sh0t has quit [Ping timeout: 265 seconds]
ygrek has quit [Ping timeout: 248 seconds]
jonludlam has joined #ocaml
kushal has quit [Ping timeout: 256 seconds]
creichert has quit [Ping timeout: 240 seconds]
siddharthv_away is now known as siddharthv
siddharthv is now known as siddharthv_away
yomimono has joined #ocaml
kushal has joined #ocaml
<lewis1711> so I made a couple of functions of "a -> option b". let's call them f1 and f2.
<lewis1711> Is there some kind of higher order thing that says "put the string in f1, if that returns none, try f2"
<lewis1711> (I know I could write it myself but I am suspecting it's in core. actually I am not even sure if Option is core or stdlib. this was a terribly formulated question)
voglerr has joined #ocaml
<dmbaturin> lewis1711: You can try searching http://ocamloscope.herokuapp.com/ for ('a -> 'b option) -> (a' -> 'b option) -> 'b option
voglerr has left #ocaml [#ocaml]
<lewis1711> thanks dmbaturin. doesn't exist, so I'll write it
voglerr has joined #ocaml
<flux> probably a list of functions would be more generally applicaple (instead of exactly two)
<dmbaturin> * string -> ('a -> 'b option) -> (a' -> 'b option) -> 'b option
<dmbaturin> Yeah, and still it's hardly all that common.
<flux> maybe some extended standard library has a List.find_map which could be applied here
<voglerr> why is `assert` special syntax? `assert (exp)` works but `assert @@ exp` is a syntax error.
<flux> assert is not a function
<lewis1711> voglerr, presumably because it by-passes the type system
<voglerr> when does it need to by-pass it?
<flux> because it is able to retrieve the current call site location, and secondly because of the special handling of 'assert false'
<voglerr> what do you mean by special handling?
<lewis1711> dmbaturin, wouldn't it quite be common in parsing? "checking to see if the string is this. Nope? then we'll try this".
<flux> the return type of assert false is 'a, so it's compatible with all other types
<flux> very useful as a place holder
<flux> or sign of a place that should never be arrived at.. like assert false should be used ;)
<companion_cube> about ocamloscope, any way to know which libraries it indexes?
<voglerr> `let ass x = if x then Obj.magic 42 else failwith "nope";;`
<voglerr> that does the same thing, but is a normal function
<flux> voglerr, and does it tell you where it was called?
<flux> not to mention the unsafety if you accidentally use its result
<voglerr> ok, that I can understand, but still I don't see why it can't be a normal function.
<flux> your function: ass true +. 5.0 -> crash
<flux> ocaml assert: assert true +. 5.0 -> type error
<voglerr> mh, ok. that makes sense.
<lewis1711> you could just write some function that takes a "unit -> bool" and does whatever to it
<lewis1711> if you want to throw around something assert-like
<lewis1711> let ass x = if x () then Obj.magic 42 else fail with "nah"
<companion_cube> dmbaturin: do you know if it's ok to suggest new libraries to be added to ocamloscope?
<flux> in fact, I suppose if you enable backtraces in said assert-like function, you would most likely get the line number information as well
<flux> lewis1711, isn't this almost exactly like the fragment we were discussing?-)
<lewis1711> right, but you could pass it in without evaluating it
<dmbaturin> companion_cube: Not sure, I've never tried. But I doubt its maintainers has any reasons not to include them.
<flux> sure, that's a fine feature if you want to disable the asserts later on.
<dmbaturin> It would be cool if they had some inclusion guidelines.
<dmbaturin> lewis1711: Ah, true. Not sure if it can be made generic enough to work for other cases, since use in parser combinators requires very specific return type. :)
<lewis1711> I am not really sure what a parser combinator is. I am just trying to blindly hack my way into parsing, rather than reading about it, and chaining functions that are "string -> a option" seems to be what I come up with
<lewis1711> though "parser combinator" does sound familiar - perhaps that is what I am greenspunning
<flux> lewis1711, what kind of parsing problem do you have?
sp0on has quit [Ping timeout: 255 seconds]
<lewis1711> flux, just a little lisp type thing. https://gist.github.com/anonymous/78bd0e92df236919a58e this is hopefully pretty readable, and thankfully short. I want to write a function Sexp.t -> internal_representation
<lewis1711> (you always find little errors right after pasting..)
Bhavya has joined #ocaml
sp0on has joined #ocaml
<flux> so you need to parse a tree to a program?
<dmbaturin> lewis1711: Are you familiar with classic parsing algorithms?
<lewis1711> flux, pretty much yeah. just flatten out the s-expression into some things I can eval
<lewis1711> dmbaturin, not so much. which should I be looking at?
<lewis1711> I've only ever done an RPN interpreter.
<dmbaturin> lewis1711: LALR(1) is the one used by most parser generators, including menhir (the most popular one in ocaml world).
<lewis1711> would it be overkill to use such a thing for a lisp?
<flux> but those are used for going from a stream of octets or lexemes into an abstract syntax tree
<flux> here we already have a tree
<dmbaturin> It's relatively easy to produce from grammar specification but it's annoying to write by hand. For handwritten parser many people go for recursive descent.
<flux> I don't think LALR etc are applicaple here?
<dmbaturin> Well, I thougt he wants to write Sexps from plaintext.
<lewis1711> sorry, write them?
<dmbaturin> * read
<flux> lewis1711, so where do strings come into play? I think your tree parser would look like: let rec parse_tree tree = match tree with List (List ("define"::define)::rest) -> parse_define define; parse_tree rest | ..
<lewis1711> flux, Sexp.t has the "Atom string" node
<flux> yes, forgot that
<flux> so Atom "define"
<flux> and you need to carry state along and combine the results
<lewis1711> for now I am just trying to program arithmetic
ggole has quit [Ping timeout: 255 seconds]
<companion_cube> arithmetic in prefix form, such as (+ 1 (* 2 3)) ?
<lewis1711> yeah
<lewis1711> first thing is first
<companion_cube> then you can parse it as List [Atom "+"; Atom "1"; List [Atom "*"; Atom "2"; Atom "3"]]
<companion_cube> and then traverse this tree in OCaml and evaluate
<companion_cube> (parse using sexplib, I mean)
KDr2 has quit [Ping timeout: 265 seconds]
<lewis1711> that's what I am trying to do
rand000 has joined #ocaml
<lewis1711> or maybe my way is over complex..
<lewis1711> but I figure there are three cases, which is why I made type expression
ggole has joined #ocaml
KDr2 has joined #ocaml
iorivur has joined #ocaml
nullcat has joined #ocaml
nullcat__ has joined #ocaml
nullcat has quit [Ping timeout: 255 seconds]
hay207 has joined #ocaml
nullcat__ has quit [Client Quit]
<jyc> def`: might not have been until I updated/rebuilt, maybe that was the real reason
_andre has joined #ocaml
iorivur has quit [Ping timeout: 248 seconds]
madroach has joined #ocaml
gargawel has quit [Ping timeout: 264 seconds]
<voglerr> concerning the assert from before: type _ t = True : unit t | False : 'a t;; let ass : type r. r t -> r = function True -> () | False -> failwith "nope";;
Drup has quit [Ping timeout: 256 seconds]
<voglerr> that behaves the same as assert
Haudegen has quit [Ping timeout: 244 seconds]
<voglerr> let h = function true -> True | false -> False
<voglerr> assert False can be used as a placeholder+exception, everything else leads to type unit
<lewis1711> voglerr, curious about the use-case (:
<voglerr> haha, no use case :)
<voglerr> just wanted to see if it's possible
iorivur has joined #ocaml
Haudegen has joined #ocaml
gargawel has joined #ocaml
Drup has joined #ocaml
tmtwd has joined #ocaml
voglerr_ has joined #ocaml
voglerr has quit [Read error: Connection reset by peer]
voglerr has joined #ocaml
voglerr_ has quit [Ping timeout: 244 seconds]
voglerr_ has joined #ocaml
walter|r has joined #ocaml
<Maelan> struktured, as this was a trivial change to do, I just left a comment on the relevant commit.
rand000 has quit [Quit: leaving]
voglerr has quit [Read error: Connection reset by peer]
voglerr has joined #ocaml
<Maelan> I hope this is visible enough.
voglerr_ has quit [Ping timeout: 250 seconds]
obadz has quit [Remote host closed the connection]
grouzen has joined #ocaml
tmtwd has quit [Ping timeout: 244 seconds]
jtfmumm has joined #ocaml
AlexRussia has quit [Ping timeout: 246 seconds]
keen__________22 has joined #ocaml
keen__________21 has quit [Ping timeout: 248 seconds]
walter|r has quit [Remote host closed the connection]
grouzen has quit [Quit: leaving]
grouzen has joined #ocaml
sepp2k has joined #ocaml
jtfmumm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Akshay has quit [Ping timeout: 244 seconds]
Hannibal_Smith has joined #ocaml
lewis1711 has quit [Ping timeout: 255 seconds]
Denommus has joined #ocaml
tmtwd has joined #ocaml
yomimono has quit [Ping timeout: 240 seconds]
jrslepak has quit [Ping timeout: 240 seconds]
Akshay has joined #ocaml
jrslepak has joined #ocaml
AlexRussia has joined #ocaml
jtfmumm has joined #ocaml
Bhavya has quit [Quit: Quit the channel]
iorivur has quit [Ping timeout: 246 seconds]
<bernardofpc> Oh, dang
freehck has joined #ocaml
<bernardofpc> suppose I try to install coqide, which requires lablgtk
<freehck> Hi
<bernardofpc> but unfortunately I've been stupid enough not to check for gtk headers in my system
jrslepak has quit [Ping timeout: 248 seconds]
<bernardofpc> then goes opam and will recompile a LOT of my packages since all of them have optional support for lablgtk (most of it indirect through lwt, for example)
jrslepak has joined #ocaml
<bernardofpc> but this will not work, since compilation will fail
<freehck> People, I want to say to Merlin in Emacs to look for definitions for current project in a local folder, but i don't know how to do it. Could anyone give me some advice?
<bernardofpc> now, after I've installed the right headers, I can either retry opam install coqide, but it will NOT redo the old packages it has removed (since it HAS removed them beforehand)
<bernardofpc> or I can opam swith import the old status, compiling all packages without lablgtk, and then AGAIN all packages with lablgtk
sailorswift has joined #ocaml
<bernardofpc> is there any less stupid way of doing things?
<freehck> Now merlin-mode marks with red all functions I imported via "open".
<freehck> rks`: thx a lot!
noze has joined #ocaml
<noze> hey, when switching compiler version with opam, how can I reinstall all the packages that were installed explicitly?
<companion_cube> opam switch export /tmp/foo
<companion_cube> opam sw 4.02.3+yolo
<companion_cube> opam switch import /tmp/foo
<companion_cube> something like this
iorivur has joined #ocaml
noze has quit [Ping timeout: 256 seconds]
contempt has quit [Ping timeout: 256 seconds]
contempt has joined #ocaml
ferseiti has joined #ocaml
jrslepak has quit [Ping timeout: 244 seconds]
jrslepak has joined #ocaml
<bernardofpc> companion_cube: do you have any sane idea about opam destroying my installed base ?
<bernardofpc> (big bug rant ^)
<companion_cube> in the messages of opam, when it fails, it should mention a backup export
<companion_cube> and the corresponding `opam switch import` command
<bernardofpc> yeah, but it's senseless
<companion_cube> really? it should point to a backup of the list of installed packages
<bernardofpc> It does
<bernardofpc> but then I'd compile all libs without lablgtk
<bernardofpc> and then it will recompile again when lablgtk gets installed
<companion_cube> if you install lablgtk first, it might work? I don't know
<bernardofpc> don't know
<bernardofpc> maybe the switch import will remove lablgtk ?
<companion_cube> I don't think so
<companion_cube> it just tries to install all the listed packages
<companion_cube> (btw I agree that removing everything beforehand is annoying)
<bernardofpc> well, it's not documented, but apparently the switch import does indeed only install, not remove
<bernardofpc> I wonder how much undefined behaviour creeps opam+-cudf
Denommus has quit [Ping timeout: 265 seconds]
iorivur has quit [Ping timeout: 244 seconds]
Hannibal_Smith has quit [Quit: Leaving]
ousado has quit [Ping timeout: 264 seconds]
<freehck> Is there any ready to use functions to open documentation for ocaml modules/functions in emacs? It'd just be very useful to type something like "C-h f" in tuareg/merlin-mode to get a documentation.
yomimono has joined #ocaml
<Akshay> i'n new to ocaml and error reporting is really shit. what can i do ?
badkins has joined #ocaml
<Leonidas> rejoice that you're not dealing with the clojure parser
<flux> rejoice that it has improved during the years.. :)
<Leonidas> actually, I think the error reporting is mostly ok. It used to be "expected type x got type x" where both x were the same.
<Leonidas> Akshay: your question is kinda broad, hard to say what you should specifically do.
<Akshay> right
sh0t has joined #ocaml
hay207 has quit [Quit: Leaving]
paddymahoney has joined #ocaml
BitPuffin|osx has joined #ocaml
Denommus` is now known as Denommus
MercurialAlchemi has joined #ocaml
<rks`> freehck: try "M-x merlin-document"
<rks`> it might work if you compiled with -bin-annot
<flux> akshay, well, the scope of some top-level errors can be limited by using ;;
<flux> akshay, also type errors can be narrowed down by defining types, ie. let foo (bar : int) = (baz : int)
<freehck> btw, is there analog for lisps' cond in ocaml?
<freehck> rks`: thx again
<ggole> if or match, depending on the use case
uris77 has joined #ocaml
<rks`> you're welcome
tmtwd has quit [Ping timeout: 248 seconds]
sailorswift has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jtfmumm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Maelan> Does Merlin use .cmt files?
<ggole> Yes.
zpe has quit [Remote host closed the connection]
<Maelan> But what is it for? :TypeOf (Vim command) seems to work out of the box without those files.
<thizanne> even if the type of your expressin depends on a module in another file ?
ousado has joined #ocaml
<ggole> Locations, iirc
ollehar1 has joined #ocaml
jtfmumm has joined #ocaml
sailorswift has joined #ocaml
<Maelan> thizanne, good point.
rgrinberg has joined #ocaml
<Maelan> Actually it worked for me, but it seems that’s because it used the .cmx or .cmi files I kept in _build in replacement.
psy has joined #ocaml
psy has quit [Max SendQ exceeded]
psy has joined #ocaml
tmtwd has joined #ocaml
struktured has quit [Ping timeout: 246 seconds]
sh0t has quit [Ping timeout: 240 seconds]
voglerr has quit [Remote host closed the connection]
<flux> I think you will need either .cmt-files or .annot-files for that to work
<flux> if it works by other means, I don't know what they could be
ollehar1 has quit [Ping timeout: 244 seconds]
creichert has joined #ocaml
<Maelan> I am absolutely sure it works with .cmi.
<Maelan> as well
darkf has quit [Quit: Leaving]
grouzen has quit [Ping timeout: 248 seconds]
tashjash has joined #ocaml
ousado has quit [Changing host]
ousado has joined #ocaml
<flux> what exactly works?
<flux> I mean, .cmi doesn't know anything about the .ml-file.. you can compile an .mli to .cmi without the .ml existing..
<flux> what works in emacs is that I can have let a b = b + c and I can find the types of each a (int -> int), b (int) and c (int) by moving my cursor over them and invoking merlin-type-enclosing
ygrek has joined #ocaml
<flux> merlin does include that functionality nowadays, but I doubt that comes with vim..
sailorswift has quit [Ping timeout: 246 seconds]
zpe has joined #ocaml
tashjash has quit [Quit: Leaving]
carc has quit [Ping timeout: 246 seconds]
carc has joined #ocaml
psy has quit [Disconnected by services]
Akshay has quit [Ping timeout: 246 seconds]
psy_ has joined #ocaml
grouzen has joined #ocaml
Haudegen has quit [Ping timeout: 256 seconds]
sailorswift has joined #ocaml
jtfmumm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
shinnya has joined #ocaml
rand000 has joined #ocaml
Haudegen has joined #ocaml
jtfmumm has joined #ocaml
jonludlam has quit [Ping timeout: 246 seconds]
boegel is now known as boegel|afk
dalastboss has joined #ocaml
sh0t has joined #ocaml
matason has quit [Ping timeout: 255 seconds]
<dalastboss> Does anyone here use sublime text 3 for ocaml work?
<dalastboss> Trying to figure out how to fix the syntax highlighting
<dalastboss> It doesn't do local open correctly, for example
jbrown has quit [Ping timeout: 264 seconds]
jbrown has joined #ocaml
uris77 has quit [Ping timeout: 256 seconds]
toomuchtvrotsurb has joined #ocaml
sailorswift has quit [Quit: Textual IRC Client: www.textualapp.com]
<Denommus> dalastboss: are you using ocp-indent?
Hannibal_Smith has joined #ocaml
<Drup> rgrinberg: AOT rebasing :3
<dalastboss> @Denommus, no I am not
<Denommus> dalastboss: does sublime text 3 support it? If so, use it
<rgrinberg> Drup: JIT merging
<dalastboss> I will look into it
MrScout has joined #ocaml
ygrek_ has joined #ocaml
ygrek has quit [Ping timeout: 246 seconds]
ggole has quit []
Hannibal_Smith has quit [Quit: Leaving]
dalastboss has quit [Ping timeout: 246 seconds]
mort___ has joined #ocaml
sgnb has quit [Ping timeout: 246 seconds]
sivoais has quit [Ping timeout: 252 seconds]
<Maelan> flux, but .cmi does contain publicly defined types, as well as names and types of public values, that’s enough to address the “modules defined in other files” issue.
sivoais has joined #ocaml
<flux> maelan, but to find them, you need to parse the current file..
<flux> module A = OtherModule and then referring to A.x
<flux> so basically you need a compiler.
<flux> or: let foo x = x.y - what is the type of that function?
<Maelan> For local things, I guess Merlin parses the current file.
<Maelan> You were quicker than me. :-)
sgnb has joined #ocaml
<Maelan> And, why not?
<flux> merlin deals with all this yes :)
<Maelan> If, as you said, Merlin does this in Emacs, why not in Vim?
<flux> it most certainly does, but I understood you referred to functionality that comes with vim, and merlin doesn't come with vim..
<Maelan> My observation is: it works even without .cmi files for things related to the current file.
<flux> "out of the box" sounded like "no merlin" to me :)
<Maelan> Oh, sorry for that.
<flux> with merlin I don't even need to save and it can find the types
ygrek_ has quit [Ping timeout: 248 seconds]
<flux> but it cannot find types from other files if they are not compiled
<Maelan> Yes, that was my observations too.
jtfmumm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<flux> and when if finds a symbol, it is able to use the .cmi files for finding their types. of course, it cannot find where it's defined.
zpe has quit [Remote host closed the connection]
<flux> for finding locations the .cmt-files the -bin-annot switch is required
<Maelan> If you use .cmt files, does that mean that you need to save your source and regenerate the .cmt each time you want to use Merlin’s typing feature?
<flux> typing feature works with merlin without the .cmt-files, but the location finding doesn't
zpe has joined #ocaml
<Maelan> Oh OK, it’s for browsing the code.
jwatzman|work has joined #ocaml
<flux> the annotations were more useful at the time before merlin (TBM)
<flux> because they allowed merlin-like type information by simpler programs
zpe has quit [Ping timeout: 240 seconds]
jtfmumm has joined #ocaml
badkins has quit []
toomuchtvrotsurb has quit [Ping timeout: 255 seconds]
Gonzih has joined #ocaml
yomimono has quit [Ping timeout: 244 seconds]
Gonzih has quit [Client Quit]
ygrek_ has joined #ocaml
mcclurmc has joined #ocaml
mort___ has quit [Quit: Leaving.]
cdidd_ is now known as cdidd
Kakadu has joined #ocaml
lobo has joined #ocaml
jtfmumm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jao has joined #ocaml
jtfmumm has joined #ocaml
mort___ has joined #ocaml
jtfmumm has quit [Client Quit]
manizzle has joined #ocaml
toomuchtvrotsurb has joined #ocaml
jtfmumm has joined #ocaml
jtfmumm has quit [Client Quit]
struktured has joined #ocaml
kushal has quit [Ping timeout: 252 seconds]
TheLemonMan has joined #ocaml
mort___ has quit [Quit: Leaving.]
zpe has joined #ocaml
kushal has joined #ocaml
MrScout has quit [Remote host closed the connection]
zpe has quit [Ping timeout: 244 seconds]
uris77 has joined #ocaml
MrScout has joined #ocaml
MrScout has quit [Ping timeout: 248 seconds]
mcclurmc has quit [Remote host closed the connection]
jtfmumm has joined #ocaml
mcclurmc has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
MrScout has joined #ocaml
badkins has joined #ocaml
matason has joined #ocaml
srcerer has quit [Quit: ChatZilla 0.9.91.1 [Firefox 39.0/20150630154324]]
srcerer has joined #ocaml
Submarine has joined #ocaml
Submarine has joined #ocaml
Anarchos has joined #ocaml
<MercurialAlchemi> I have a silly question
<MercurialAlchemi> how can OUnit's assert_equal work with abstract datatypes unless you feed it its ~cmp function?
<adrien_znc> like (=) ?
Anarchos has quit [Read error: Connection reset by peer]
<Leonidas> isn't it using =?
obadz has joined #ocaml
jtfmumm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<MercurialAlchemi> yes, it seems so
<Drup> rgrinberg: "opam pin add cohttp --dev"
<Drup> upgrade from lwt
<Drup> all the world recompiling
<Drup> *gasp*
uris77 has quit [Ping timeout: 240 seconds]
mort___ has joined #ocaml
sepp2k has quit [Quit: Leaving.]
sepp2k has joined #ocaml
sepp2k has quit [Client Quit]
sepp2k has joined #ocaml
sepp2k has quit [Client Quit]
obadz- has joined #ocaml
sepp2k1 has joined #ocaml
obadz has quit [Ping timeout: 250 seconds]
<MercurialAlchemi> Drup: congrats, you upgraded to gentoo
<MercurialAlchemi> now install libreoffice and kde
<rgrinberg> Drup: yeah, i feel sorry for the people who develop cohttp, re, and lwt
<Drup> rgrinberg: and js_of_ocaml
<Drup> hey, know I'm a contributor of the three of them, yay!
<rgrinberg> 4 if you include jsoo :D
<Drup> now*
<Drup> ah yes, I meant 4 x)
<Drup> [recompiling intensifies]
<companion_cube> opam should print this message
* MercurialAlchemi is doing ocaml again, it's been a long while
<companion_cube> o/ MercurialAlchemi
* MercurialAlchemi ponders about ocamlers' obsession with single letter variables and two-letter functions
<Drup> MercurialAlchemi: and puns.
<Drup> don't forget puns
<MercurialAlchemi> yeah
<MercurialAlchemi> well, the puns are easier to understand
<MercurialAlchemi> the function "bk", less so
<rgrinberg> MercurialAlchemi: let me guess, jsonm
<MercurialAlchemi> er, I shouldn't say, but that's from a toml branch
<MercurialAlchemi> fortunately, it's only in the test code
<Drup> MercurialAlchemi: something I tried, recently, is to document my convention in shortname variables
tmtwd has quit [Ping timeout: 246 seconds]
<companion_cube> toml's code is a bit weird overall
<MercurialAlchemi> it means "bare_key_of_string"
<MercurialAlchemi> well
<MercurialAlchemi> the new interface is verbose
<Drup> I'm not sure how successful it is, considering nobody made comment on the implementation.
<MercurialAlchemi> you mean toml or furl?
<Drup> furl
<MercurialAlchemi> I'm sticking to "verbose when needed"
<Drup> I think I already voiced my feelings about toml's interface not-so-long ago
<Drup> probably to you, even
<MercurialAlchemi> like a year ago :)
<MercurialAlchemi> but you're not wrong
<Drup> ok, maybe
<Drup> (the tl;dr was: it sucks and you can do much better without that many difficulties)
<MercurialAlchemi> well, you'd need to either go back to non-abstract datatypes
<MercurialAlchemi> or do something clever like a zipper
<rgrinberg> Drup: imagine the reinstall hell once assemblage takes off
<rgrinberg> and of course you will be the prime victim
<companion_cube> \o/
<MercurialAlchemi> I'm open to alternative suggestions
<Drup> aaaaah
<companion_cube> if it's the price to pay to get a good build system
<companion_cube> I'll reinstall happily all my packages
<Drup> I will invest in an army of build bot
<rgrinberg> Drup: #ocaml has spoken. we'd gladly sacrifice you to reinstall hell for a good build system
uris77 has joined #ocaml
<Drup> well, I'm doing mirage things atm anyway, so it'll wait
<MercurialAlchemi> I think I'd settle for a graphical debugger
<MercurialAlchemi> (or an ncurses one)
<companion_cube> Drup: aww, so you're not working on assemblage in the end
<Drup> apparently not
QuanticPotato has joined #ocaml
mcclurmc has joined #ocaml
tmtwd has joined #ocaml
<adrien_znc> pffft
<adrien_znc> slacker
MrScout has quit [Ping timeout: 248 seconds]
mcclurmc has quit [Ping timeout: 255 seconds]
<rgrinberg> maybe he's on strike :D
<rgrinberg> (don't kill me)
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
toomuchtvrotsurb has quit [Remote host closed the connection]
sh0t has quit [Ping timeout: 244 seconds]
<MercurialAlchemi> grmbl
toomuchtvrotsurb has joined #ocaml
<MercurialAlchemi> looks like two maps with the same key/value pairs but added in a different order are not equal according to =
sp0on has quit [Ping timeout: 250 seconds]
jwatzman|work has quit [Quit: jwatzman|work]
<MercurialAlchemi> that's idiotic
<companion_cube> that's a property of the AVL trees
<companion_cube> they don't have a canonical form
<companion_cube> anyway, (=) is best avoided
freehck has quit [Ping timeout: 246 seconds]
rgrinberg has quit [Ping timeout: 256 seconds]
Hannibal_Smith has joined #ocaml
sp0on has joined #ocaml
madroach has quit [Remote host closed the connection]
madroach has joined #ocaml
sepp2k1 has quit [Quit: Leaving.]
<maurer> Is there any way to functorize a file-level module?
<maurer> e.g. I have foo.ml, and I want to make the Foo module a functor
sh0t has joined #ocaml
<ygrek_> no, add Make module and be like stdlib
<ygrek_> who wants to live forever^W^W be fancier than stdlib?
<Drup> ygrek_: tbf, in the stdlib, you usually also have a module type S
<ygrek_> indeed
toomuchtvrotsurb has quit [Remote host closed the connection]
AlexRussia has quit [Read error: Connection reset by peer]
toomuchtvrotsurb has joined #ocaml
AlexRussia has joined #ocaml
AlexRussia has joined #ocaml
ygrek_ has quit [Ping timeout: 244 seconds]
sh0t has quit [Ping timeout: 244 seconds]
paddymahoney has quit [Ping timeout: 248 seconds]
MrScout has joined #ocaml
matason has quit [Ping timeout: 240 seconds]
rgrinberg has joined #ocaml
mcclurmc has joined #ocaml
ferseiti has quit [Quit: Leaving]
mcclurmc has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
manud has joined #ocaml
obadz- has quit [Ping timeout: 256 seconds]
obadz has joined #ocaml
QuanticPotato has quit [Quit: Leaving]
_andre has quit [Quit: leaving]
ygrek_ has joined #ocaml
toomuchtvrotsurb has quit [Remote host closed the connection]
sp0on has quit [Ping timeout: 264 seconds]
Hannibal_Smith has quit [Quit: Leaving]
mort___ has quit [Quit: Leaving.]
Denommus has quit [Quit: going home]
mcclurmc has quit [Ping timeout: 250 seconds]
dmh has joined #ocaml
jonludlam has joined #ocaml
<bernardofpc> is rleonid (of oml) here ?
mcclurmc has joined #ocaml
<flux> I think not.
sp0on has joined #ocaml
sailorswift has joined #ocaml
<flux> apparently struk|work struktured is involved, though, if that helps :)
manud has quit [Quit: manud]
toomuchtvrotsurb has joined #ocaml
<bernardofpc> ok, thanks flux
rand000 has quit [Quit: leaving]
<struktured> bernardofpc: here's on here sometimes
<struktured> *he's
<bernardofpc> so struktured struk|work : I guess the variance update function could be implemented with Welford's algorithm
<struktured> bernardofpc: oh interesting...is welford better than the provided one?
<bernardofpc> not really comparable
<bernardofpc> because welford really works well on streams, and maybe it can be tortured to do a "merge"
<struktured> bernardofpc: but yes you can in theory. I am going to change the api to be functor which binds the mean/var update rules, but that's not complete yet. with existing api you should be able to do it by passing the wellford update functoin as an arg each time
<struktured> I can make it a functorized api sooner rather than later if you prefer to use that
dmh has quit [Quit: Leaving]
<bernardofpc> I do like the idea of "merging" sets of statistics, but maybe this should not be in "online.ml" ;-)
<bernardofpc> (merge => parallelization)
dmh has joined #ocaml
<bernardofpc> (online => serial)
<bernardofpc> I'll try to work out the gory math to see if welford can be coerced in some way to handling merges
<struktured> bernardofpc: go for it, we can probablyt add it to oml directly too
<struktured> I like the ability to merge, it really has paid off for me
<bernardofpc> update ~size:42 t 3.1415 will add 42 times \pi to your stats ?
<struktured> (when I load data from a db, in particular)
<struktured> correct
<struktured> you can look at the unit tests in running.mlt
<struktured> for specific invariants
<bernardofpc> I'll try to provide one more in a sec
nha_ has left #ocaml ["Leaving"]
uris77 has quit [Quit: leaving]
lobo has quit [Quit: leaving]
badkins has quit [Ping timeout: 244 seconds]
toomuchtvrotsurb has quit [Remote host closed the connection]
sgnb has quit [Read error: Connection reset by peer]
sgnb has joined #ocaml
jwatzman|work has joined #ocaml
nullcat has joined #ocaml
<nullcat> someone here to have a look at my functor problem?
struktured has quit [Ping timeout: 265 seconds]
<nullcat> https://gist.github.com/marklrh/ec29606b2e2fc0a81254 what i'd like to do is pretty clear..
<rgrinberg> nullcat: does it work if you remove the result signature for F
<rgrinberg> e.g. s/X with type t = S.t =//
<nullcat> no
mcclurmc has quit [Ping timeout: 255 seconds]
<flux> I don't think that can be done
<nullcat> ummm.......
mcclurmc has joined #ocaml
<flux> when you have module F (S : SS) .. then S is already stripped out of constructors etc
<flux> and the type assignment doesn't make the constructor visible there
dmh has quit [Quit: Leaving]
<nullcat> yeah...
<nullcat> i see
<flux> this however does still work: let a : FS.t = MS.a (redundant type info just to demonstrate that it's compatible)
<Maelan> flux, what I do not understand with that code snippet is that there is still the error “unbound constructor FS.A” even if you specify “type t = A | B” in signature SS.
<Drup> mostly what flux said, you expose the type equality, but not the type constructors
<flux> maelan, well, #use the fragment to your toplevel and do #show FS;;
<flux> another example with confusing names: module A = struct type t = B end module C = struct type t = A.t end -> there is no C.B
mcclurmc has quit [Ping timeout: 256 seconds]
mcclurmc_ has joined #ocaml
swgillespie has joined #ocaml
<Maelan> If I try to constraint the signature of FS to be “sig type t = A | B” it says me “Type declarations do not match: type t = MS.t is not included in type t = A | B ; their kinds differ”.
<jyc> does Lwt have an equivalent to Async's Pipe?
badkins has joined #ocaml
<flux> maelan, well, I'm not surprised by that, the types are different even if they have same-named constructors. but I cannot tell why this doesn't/shouldn't work either type t = MS.t = A | B
theblatte has quit [Ping timeout: 248 seconds]
<Drup> Maelan: because "with type t = ..." doesn't say anything about A and B
<Drup> it says something about type qualities, but it doesn't mean the constructor A and B suddenly change module.
<Drup> it's quite obvious if you look at the module type of FS
<Drup> ig type t = MS.t end
<Maelan> "change module"…
<Maelan> Does that mean that although it is possible to share a type between modules with type alias, it is not possible to share the constructors?
<flux> it is possible to share them, not just in this case :)
dmh has joined #ocaml
<flux> ie. module A = struct type t = Foo | Bar end module B = struct include A end module C = struct include A end
<flux> but if I did: module D : sig type t = A.t end = struct include A end then the same thing would happen again
mcclurmc_ has quit [Read error: Connection reset by peer]
mcclurmc has joined #ocaml
<bernardofpc> struk|work: http://pastebin.com/vaj1GCnE
<bernardofpc> (this is precisely the use-case for Welford that I tested: a small variance with a large mean)
<jyc> also, is the plan for Mirage to support both Lwt and Async in the future, or is one to be preferred?
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
swgillespie has joined #ocaml
<flux> I would be quite surprised to see if that happened..
<bernardofpc> (but in any case welford's algorithm will produce smaller errors even without shift, but that's a minor point)
<bernardofpc> (of course, you should not use Welford if n is TOO big, like, say, 2^40 where your floating point precision would not sustain the 1/n 1/(n+1) 1/(n+2) and so on
<bernardofpc> (this happens much earlier with single-precision floats, say in the 2^20, and someone has shown nice examples on the talk page of the corresponding Wikipedia article)
Kakadu has quit [Remote host closed the connection]
<Maelan> Hmm, so it means type alias are really different from the type they point to.
<flux> maelan, no?
<flux> they are impossible to distinquish from each other, aren't they?
<flux> but where types live and where their constructors live can be two different things
<flux> well, I suppose they are -easy- to distinquish from each other by inspecting the code or #show, but perhaps I'm not following how they are really different :). or maybe I'm wrong..
<Maelan> I mean, syntactically.
<Maelan> Yeah, I meant in that sense.
<Maelan> Writing type t = A.t in a signature has not the same effects as type t = Foo|Bar.
<Maelan> The former says the types are the same, but you don’t get the constructors as well, the latter forgets than they are equal.
manud has joined #ocaml
<Maelan> Oh, you can actually can write “type t = A.t = Foo|Bar”, I did not understand.
<Maelan> That’s great. :-)
<Drup> jyc: Lwt_stream, kinda
flx has joined #ocaml
flx_ has joined #ocaml
abbe has quit [Ping timeout: 258 seconds]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
flux has quit [Remote host closed the connection]
flxx has quit [Remote host closed the connection]
flx is now known as flux
rgrinberg has quit [Ping timeout: 252 seconds]
abbe has joined #ocaml
mcclurmc has quit [Ping timeout: 265 seconds]
mcclurmc has joined #ocaml
dalastboss has joined #ocaml
sailorswift has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jwatzman|work has quit [Quit: jwatzman|work]
swgillespie has joined #ocaml
sailorswift has joined #ocaml
<dalastboss> In case there is any interest: Earlier someone had asked if Sublime Text 3 could be configured to use ocp-indent. I found that it could not, so I wrote a plugin that allows you use it and other code formatters: https://github.com/zachhalle/SublimeFormatter
mcclurmc has quit [Read error: Connection reset by peer]
mcclurmc_ has joined #ocaml
theblatte has joined #ocaml
<jyc> Drup: thanks! Lwt_stream looks similar, but it seems to be more like a way to write generators than a buffered channel
madroach has quit [Ping timeout: 264 seconds]
madroach has joined #ocaml
nullcat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
toomuchtvrotsurb has joined #ocaml
mcclurmc_ has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
sp0on has quit [Ping timeout: 240 seconds]