flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 4.00.1 http://bit.ly/UHeZyT | http://www.ocaml.org | Public logs at http://tunes.org/~nef/logs/ocaml/
<ollehar> how do I pattern match to a Js.opt in js_of_ocaml?
<ollehar> nm, found it
lifeng has joined #ocaml
tani has quit [Quit: Verlassend]
darkf has joined #ocaml
ygrek has joined #ocaml
ollehar has quit [Ping timeout: 264 seconds]
introom has joined #ocaml
csakatoku has joined #ocaml
Yonex has quit [Read error: Connection reset by peer]
walter has quit [Read error: Connection reset by peer]
walter has joined #ocaml
madroach has quit [Ping timeout: 264 seconds]
madroach has joined #ocaml
walter has quit [Read error: Connection reset by peer]
walter has joined #ocaml
walter has quit [Read error: Connection reset by peer]
walter has joined #ocaml
ygrek has quit [Ping timeout: 245 seconds]
q66 has quit [Quit: Leaving]
palomer has quit [Ping timeout: 264 seconds]
walter has quit [Read error: Connection reset by peer]
walter has joined #ocaml
ygrek has joined #ocaml
wmeyer has quit [Ping timeout: 276 seconds]
introom has quit [Remote host closed the connection]
emmanuelux has quit [Remote host closed the connection]
shinnya has quit [Ping timeout: 264 seconds]
ben_zen has joined #ocaml
walter has quit [Read error: Connection reset by peer]
walter has joined #ocaml
bkpt has quit [Quit: Leaving]
Neros has quit [Ping timeout: 245 seconds]
gautamc has quit [Read error: Connection reset by peer]
gautamc has joined #ocaml
<whitequark> pippijn: you may be interested in my latest article: http://whitequark.org/blog/2013/07/30/metaprogramming-in-foundry/
introom has joined #ocaml
ben_zen has quit [Ping timeout: 264 seconds]
introom has quit [Remote host closed the connection]
walter has quit [Read error: Connection reset by peer]
walter has joined #ocaml
introom has joined #ocaml
sgnb has quit [Read error: Operation timed out]
sgnb has joined #ocaml
kaustuv_ has joined #ocaml
gasche has quit [Read error: Operation timed out]
kaustuv has quit [Read error: Connection reset by peer]
yacks has quit [Quit: Leaving]
gasche has joined #ocaml
csakatok_ has joined #ocaml
csakatoku has quit [Ping timeout: 264 seconds]
kaustuv_ has left #ocaml []
ygrek has quit [Ping timeout: 264 seconds]
Drup has quit [Quit: Leaving.]
yezariaely has joined #ocaml
ttamttam has joined #ocaml
djcoin has joined #ocaml
weie has joined #ocaml
weie_ has quit [Ping timeout: 264 seconds]
zpe has joined #ocaml
ygrek has joined #ocaml
cago has joined #ocaml
zpe has quit [Ping timeout: 264 seconds]
thomasga has joined #ocaml
zpe has joined #ocaml
wwilly has joined #ocaml
thomasga has quit [Ping timeout: 245 seconds]
thomasga has joined #ocaml
mika1 has joined #ocaml
thomasga1 has joined #ocaml
thomasga has quit [Read error: Connection reset by peer]
Snark has joined #ocaml
walter has quit [Read error: Connection reset by peer]
walter has joined #ocaml
malo has joined #ocaml
yacks has joined #ocaml
mcclurmc has joined #ocaml
willy_ has joined #ocaml
wwilly has quit [Ping timeout: 245 seconds]
|jbrown| has quit [Remote host closed the connection]
nop0x07bc has joined #ocaml
jbrown has joined #ocaml
walter has quit [Read error: Connection reset by peer]
walter has joined #ocaml
Xom has quit [Quit: ChatZilla 0.9.90.1 [Firefox 22.0/20130618035212]]
thomasga1 has quit [Ping timeout: 245 seconds]
introom has quit [Remote host closed the connection]
q66 has joined #ocaml
thomasga has joined #ocaml
dsheets has quit [Ping timeout: 264 seconds]
mort___ has joined #ocaml
Neros has joined #ocaml
dsheets has joined #ocaml
gautamc has quit [Ping timeout: 240 seconds]
gautamc has joined #ocaml
ygrek has quit [Ping timeout: 245 seconds]
eikke has joined #ocaml
<eikke> in core, Fn.const is defined as "let const c = (); fun _ -> c". Why the unit?
ttamttam has quit [Quit: ttamttam]
csakatoku has joined #ocaml
csakatok_ has quit [Ping timeout: 245 seconds]
mort___ has quit [Quit: Leaving.]
mort___ has joined #ocaml
<flux> maybe it has something to do with partial egaluation/application and the generatedcode
ygrek has joined #ocaml
_andre has joined #ocaml
introom has joined #ocaml
thomasga1 has joined #ocaml
thomasga has quit [Read error: Connection reset by peer]
csakatoku has quit [Remote host closed the connection]
walter has quit [Read error: Connection reset by peer]
walter has joined #ocaml
ygrek has quit [Ping timeout: 264 seconds]
ttamttam has joined #ocaml
mort___ has quit [Quit: Leaving.]
mort___ has joined #ocaml
yezariaely has quit [Ping timeout: 264 seconds]
yezariaely has joined #ocaml
wmeyer has joined #ocaml
<wmeyer> hello
<introom> what's the meaning of using "let _" let _ = List.iter (fun s -> printf "%s\n" s) my_data
yezariaely has quit [Client Quit]
<orbitz> introom: means they don't care about the result
<jpdeplaix> introom: here it's useless since we can use « let () = », but in general it's used when we don't want to bother about the result
<orbitz> shoudl probbaly have been written let () = List ... or ignore (List ..)
<jpdeplaix> :D
<wmeyer> it just creates binding, so you can enforce that the operation in the next scope goes after. The _ is a in-exhaustive pattern match, and it's telling the compiler to match anything (is polymorphic) and throw away the value
<introom> jpdeplaix: why () can do it? shouldn't () immutable?
<wmeyer> so basically, the operations separated by ";" can be transformed to sequence of lets, the _ is very useful when you don't know the type of the calue or you just don't care about the value. In either ways.
<wmeyer> introom: () is a single constructor of unit. Unit type has just single value of ()
<jpdeplaix> introom: this is not an assignation, it's a binding
<wmeyer> so if your expression is unit, you can write () instead of _, but if you don't want this constraint, you can still write _
<wmeyer> jpdeplaix: is right, let's just introduce "named value"
<wmeyer> s/let's/lets
<introom> wmeyer: I somewhat get it.
<wmeyer> so if you had this type
<introom> and seems _ itself is discarded. let _ = "sdf";; and if I do _;; will raise parse error in utop
ggole has joined #ocaml
<wmeyer> type singleton = S
<wmeyer> is isomorhic to unit
<wmeyer> has single constructor without arguments
<wmeyer> then you could say let S = <expression that type is "singleton">
<wmeyer> the same with ()
<wmeyer> but if you say _, you also don't care about the type
<wmeyer> in a global scope, it's a fine way of implementing blocks of expressions without using too much ;;
<introom> ype singleton = S | Sme of int;; let S = Sme 3;; it raises "not exhaustive warning"
<introom> s/^/t/
<wmeyer> so you can say let _ = let x = 1 in let y = 2 in let s = x + y in let foo = string_of_int s
<wmeyer> yes, because singleton now has two constructors
<wmeyer> and let can match only single one
<wmeyer> that is called in-exhaustive pattern
<wmeyer> therefore let is only applicable where you cover all the possible cases for the match
<wmeyer> otherwise you risk failing to match but *at runtime*
<introom> and let can match only single one ??
<introom> it says "Sme _" is not matched.
<wmeyer> so let ahs special case of patterns, called irrefutable
<wmeyer> yes, let just binds, it's just convenience it can match
<wmeyer> and deconstruct values
<ggole> Almost always used for tuples
<ggole> (And 'newtype' style wrappers, I guess)
<wmeyer> actually it might be very useful with GADTS where the only way to use GADT is through constructor, and sometimes there is just single one
<ggole> Oh, good point
<introom> goes out of my understanding.
<wmeyer> introom: GADTS are fairly new, and complicated for the new users :-)
<ggole> You can pretty much ignore them until you are more fluent in the language
<wmeyer> (and not used that often in practice at the moment)
<introom> I can understand the bind thing for let x = 1 in ... but why do you say let () = <some expr returns () ) is also a bind?
<introom> I mean, there is no "in"
<ggole> let at the top level is a special case
<ggole> If there is no in, it refers to the rest of the file (or input, if you are at the repl)
<introom> just the above example, x points to 1, and () """points to "" () ??
<ggole> The second let does not bind any variables
<introom> just an assert that the expression should return () ?
<ggole> Yeah
<wmeyer> yes, a sort of static assert
<ggole> Which is a bit more specific than let _ = ...
<introom> got it. that's what wmeyer called *match*
<ousado> let () = expr is saying that the expression exists for its side-effects only
<wmeyer> because there is no conditional code on () ever :-)
<wmeyer> so, the value itself is useless, but exists
<wmeyer> so it might be used for marking some placeholder or arguments
<ggole> Well, some people like to use unit refs as unique values
<ggole> Although that's pretty horrible
hyperboreean has quit [Ping timeout: 240 seconds]
<wmeyer> it surpisingly has it's applications even in purely functional languages
<wmeyer> don't forget ggole that there is always second identifier to use, unit
<wmeyer> where on type level you can throw away type parameters you don't care abot
<ggole> Yeah, true. At the value level, though, losing the ability to have sets and maps is a major downside.
Simn has joined #ocaml
wmeyer has quit [Ping timeout: 245 seconds]
madroach has quit [Quit: leaving]
madroach has joined #ocaml
ygrek has joined #ocaml
Drup has joined #ocaml
Neros has quit [Ping timeout: 245 seconds]
hyperboreean has joined #ocaml
palomer has joined #ocaml
q66_ has joined #ocaml
q66 has quit [Disconnected by services]
q66_ is now known as q66
Yoric has joined #ocaml
yacks has quit [Ping timeout: 245 seconds]
cago has quit [Quit: Leaving.]
introom has quit [Remote host closed the connection]
hyperboreean has quit [Quit: leaving]
hyperboreean has joined #ocaml
ben_zen has joined #ocaml
Neros has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
gnuvince has quit [Remote host closed the connection]
ben_zen has quit [Ping timeout: 260 seconds]
ben_zen has joined #ocaml
Yoric has quit [Read error: Connection reset by peer]
gnuvince has joined #ocaml
gnuvince has quit [Changing host]
gnuvince has joined #ocaml
travisbrady has joined #ocaml
introom has joined #ocaml
shinnya has joined #ocaml
smondet has joined #ocaml
ben_zen has quit [Ping timeout: 256 seconds]
yacks has joined #ocaml
bkpt has joined #ocaml
bkpt has quit [Client Quit]
mika1 has quit [Quit: Leaving.]
asmanur has quit [Read error: No route to host]
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
bkpt has joined #ocaml
darkf has quit [Quit: Leaving]
hcarty has joined #ocaml
willy_ has quit [Quit: Leaving]
<hcarty> def-lkb_: Using merlin 1.1 + vim + syntastic, is it possible to jump to errors? :lnext/:lprev say that there is no location list.
gautamc has quit [Read error: Connection reset by peer]
ollehar has joined #ocaml
gautamc has joined #ocaml
<rks`> hcarty: which version of syntastic/vim are you using?
<rks`> (the error report mechanism hasn't changed in merlin since version 1.0)
<rks`> also: "it's working for me"
palomer has quit [Ping timeout: 245 seconds]
introom has quit [Remote host closed the connection]
<hcarty> rks`: vim 7.3, syntastic is 3.0.0 I think
<def-lkb_> hcarty: try after setting :let g:syntastic_auto_loc_list=1
<hcarty> def-lkb_: That works! And gives me a list at the bottom of the window.
<hcarty> def-lkb_, rks`: Thank you both
<def-lkb_> hcarty: you're welcome :)
iZsh has joined #ocaml
iZsh has quit [Excess Flood]
iZsh has joined #ocaml
<rks`> I didn't do much, but ok :)
<travisbrady> def-lkb_: do you use merlin w/ ocp-indent?
gustav_ has joined #ocaml
<rks`> travisbrady: we tried to, but having ocp-indent work with vim is not that easy.
<rks`> (or wasn't, last time I tried)
<def-lkb_> travisbrady: for some time I tried, it was possible to get something quite efficient… but there is a lot of work to integrate it properly
<def-lkb_> so I think it would be cool to have proper support for ocp-indent, but that's not possible at the moment (you can still the default ocp-indent script, it shall work independently of merlin)
<def-lkb_> use*
ggole has quit []
<travisbrady> Ahh. so do you have syntastic or merlin handling indentation for you?
thomasga1 has quit [Quit: Leaving.]
<def-lkb_> not anymore, worked at some point in the past, but code rote :/
<def-lkb_> can't speak for rks`, but I am still using default vim indentation
<hcarty> travisbrady: I'm using merlin + ocp-indent as separate plugins and it works (mostly) well.
<hcarty> travisbrady: But the default/auto-indentation still comes from vim. I need to explictly tell vim to use ocp-indent.
<rks`> def-lkb_: me too.
<rks`> hcarty: yes, that's what we were trying to avoid
<rks`> we wanted ocp-indent to do the auto-indent
<hcarty> rks`: That would be nice
<def-lkb_> definitely possible, but needs some work...
<gasche> def-lkb_: what kind of work?
<travisbrady> I've been using a bit of ocp-indent but sometimes it does some strange things and I have to fix it manually.
<hcarty> travisbrady: For what it's worth, when I've run into that I've found the authors respond quickly to issues on github.
<def-lkb_> gasche: two things, independent of merlin, I would like some checkpointing system to speed up ocp-indent (it can feels slow on thousand long files and it is wasting power)
<def-lkb_> gasche: second, I have the feeling that indentation can be used as a much more robust heuristic for syntax correction than current tricks on grammar, and there is a lot to be learned from ocp-indent
<rks`> def-lkb_: I think he just wondered about the changes necessary to have ocp-indent working with vim
<rks`> not about how it could be used by merlin.
<def-lkb_> rks`: point 1
<rks`> yes yes, I was merely mentionning that your 2nd point was useless :}
<def-lkb_> rks`: réglisse
<rks`> :D
<gasche> I don't care about vim
<gasche> but I care about the design of programming-assistant tools
<gasche> def-lkb_: so you want to make (something such as ocp-indent) incremental
<def-lkb_> gasche: at least for the purupose of experimenting, yes
<gasche> what do you mean by "syntax correction"? going farther in a parsetree with holes?
<def-lkb_> yes
<gasche> I haven't looked at ocp-indent closely, but I did camlp4 extensions for indentation-aware syntax for OCaml
<gasche> and I think they use rather similar stack-based reasoning on the lexing output
<def-lkb_> yes, it seems
thomasga has joined #ocaml
<rks`> gasche: I never said you cared about vim :)
ygrek has quit [Ping timeout: 264 seconds]
<gasche> in fact I'm mildly interested in vim
<gasche> I nearly considered learning to use it once
<gasche> but no time
<gasche> (I think I would rather use the viper mode)
<rks`> (If you do, consider evil, it's supposed to be better)
<rks`> (I'd be curious to know how that interacts with other emacs modes/packages)
djcoin has quit [Quit: WeeChat 0.4.0]
<smondet> rks`: i use emacs+evil, sometimes it's a bit of a pain but much better than plain emacs IMHO
<gasche> def-lkb_: the token stream has a much simpler structure than the AST
<gasche> if you store the location of each token, you can probably re-lex only the parts that changed
<gasche> (start at the first one that cross the begining of the changed location, and stop at the first one that stops outside this location at the boundary of one that was lexed already)
<gasche> as you see, it's even rather easy to preserve the end of the input, unless what Merlin does for parsing
<rks`> gasche: from what I remember def-lkb_ did something like that when trying to have ocp-indent working
<rks`> he didn't save the whole stream of tokens but some "meaningful" tokens (which acted as checkpoints)
<rks`> and tried to work only on the parts that changed
<def-lkb_> gasche: yeah, that's not a problem
<rks`> the thing is
<rks`> the problem is having vim tell you what changed.
<gasche> erf
<rks`> (and vim does a really _really_ poor job on that front)
<def-lkb_> the problem was essentially corner-cases not being handled (say long comments)
<def-lkb_> (and vim sucking)
<rks`> (at the moment we have merlin [and coquille] working [kinda] by using a set of more or less ugly heuristics)
<gasche> I don't like the WTFPL license
<def-lkb_> "18:29 < gasche> non mais ça osef
<def-lkb_> "
<def-lkb_> what is your problem with WTFPL ?
bkpt has quit [Ping timeout: 256 seconds]
<gasche> I think we discussed that already
* Drup has a slight sens of deja vu.
mort___ has quit [Ping timeout: 276 seconds]
<def-lkb_> gasche: I must have some GC running in the background
<rks`> hahaha
<rks`> « because it can offend others »
<rks`> *fuck* that.
<thomasga> is that possible to tell ocamlfind that is configuration file has moved (without recompiling it ?)
<thomasga> *its*
tianon has quit [Ping timeout: 245 seconds]
<def-lkb_> OCAMLFIND_CONF envvar ?
<thomasga> yup, that's what I plan to do, but I was hoping to have something better than that
<def-lkb_> How would you pass the information to ocamlfind?
<thomasga> (such as `which ocamlfind`/../lib/findlib.conf for instance)
mcclurmc has quit [Quit: Leaving.]
<thomasga> dunno, I was hoping to have a command to regenerate a fresh findlib.conf at some place
<thomasga> I guess that's quicker to hardcode the path directly in the binary
<thomasga> hum
tianon has joined #ocaml
eikke has quit [Ping timeout: 264 seconds]
bkpt has joined #ocaml
skchrko has joined #ocaml
tianon has quit [Quit: "I'm a very important man. I've got a tower!"]
tianon has joined #ocaml
mcclurmc has joined #ocaml
<adrien> but how would it know where to look for it?
<adrien> it needs either a file or an env var to guide it
dsheets has quit [Ping timeout: 264 seconds]
<thomasga> I was thinking to a file in located in some relative path regarding the binary
<thomasga> but anyway, the ocaml compiler cannot be moved easily as well, so I have to find an other upgrade path ...
<adrien> there are unfortunately too many things which refuse to be moved ='(
<thomasga> indeed :-(
<mrvn> you need a bigger hammer
<adrien> thomasga: do you have a specific use case btw?
<thomasga> yes, I wanted to change the file overlay in OPAM in 1.1
<thomasga> to install things in ~/.opam/switches/<name>/ instead of ~/.opam/<name>/
<thomasga> and I wanted to deal with upgrade from 1.0 to 1.1 easily
<thomasga> but I think I will not change the overlay at all, it will be much simpler for me :-)
<rks`> and everyone using opam :-'
<adrien> it's friday already? \o/
nop0x07bc has quit [Quit: WeeChat 0.4.1]
travisbrady has quit [Quit: travisbrady]
dsheets has joined #ocaml
travisbrady has joined #ocaml
demonimin_ has quit [Remote host closed the connection]
demonimin has joined #ocaml
palomer has joined #ocaml
ulfdoz has joined #ocaml
ollehar has quit [Ping timeout: 256 seconds]
palomer has quit [Ping timeout: 245 seconds]
ousado has quit [Read error: Connection reset by peer]
ousado has joined #ocaml
bkpt has quit [Ping timeout: 264 seconds]
oriba has joined #ocaml
bkpt has joined #ocaml
ttamttam has quit [Quit: ttamttam]
oriba has quit [Quit: oriba]
Snark has quit [Quit: leaving]
IbnFirnas has joined #ocaml
darkf has joined #ocaml
_andre has quit [Quit: leaving]
bkpt has quit [Quit: Leaving]
avsm has joined #ocaml
zpe has quit [Remote host closed the connection]
Xom has joined #ocaml
manud has joined #ocaml
Simn has quit [Read error: Connection reset by peer]
zpe has joined #ocaml
ulfdoz has quit [Ping timeout: 264 seconds]
zpe has quit [Ping timeout: 260 seconds]
jonludlam has joined #ocaml
avsm1 has joined #ocaml
avsm has quit [Read error: No route to host]
dsheets has quit [Ping timeout: 264 seconds]
avsm1 has quit [Quit: Leaving.]
dsheets has joined #ocaml
mcclurmc has quit [Quit: Leaving.]
avsm has joined #ocaml
malo has quit [Quit: Leaving]
travisbrady has quit [Quit: travisbrady]
avsm has quit [Ping timeout: 264 seconds]
avsm has joined #ocaml
wmeyer has joined #ocaml
osa1 has joined #ocaml
avsm has quit [Quit: Leaving.]
mcclurmc has joined #ocaml
gautamc has quit [Read error: Connection reset by peer]
rwmjones has quit [Ping timeout: 240 seconds]
thomasga has quit [Quit: Leaving.]
smondet has quit [Quit: enough GADTs for one day]
gautamc has joined #ocaml
palomer has joined #ocaml
palomer has quit [Ping timeout: 245 seconds]
wmeyer has quit [Remote host closed the connection]
ollehar has joined #ocaml
rgrinberg has quit [Quit: WeeChat 0.4.1]
palomer has joined #ocaml
rgrinberg has joined #ocaml
gnuvince has quit [Read error: Connection reset by peer]
walter has quit [Ping timeout: 276 seconds]
palomer has quit [Ping timeout: 268 seconds]
gnuvince has joined #ocaml
gnuvince has quit [Changing host]
gnuvince has joined #ocaml
walter has joined #ocaml