adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | Current MOOC: https://huit.re/ocamlmooc | OCaml 4.04.0 release notes: http://ocaml.org/releases/4.04.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
sh0t has quit [Remote host closed the connection]
kakadu has quit [Remote host closed the connection]
agravier has quit [Quit: agravier]
agravier has joined #ocaml
ziyourenxiang has joined #ocaml
Simn has quit [Quit: Leaving]
larhat has quit [Quit: Leaving.]
mfp has quit [Ping timeout: 260 seconds]
moei has quit [Quit: Leaving...]
moei has joined #ocaml
spew has quit [Ping timeout: 255 seconds]
mengu has quit [Quit: Leaving...]
spew has joined #ocaml
kv_ has joined #ocaml
jack5638 has quit [Ping timeout: 260 seconds]
jack5638 has joined #ocaml
fluter has joined #ocaml
kv_ has quit [Ping timeout: 255 seconds]
kv_ has joined #ocaml
agravier has quit [Quit: agravier]
govg has quit [Ping timeout: 268 seconds]
govg has joined #ocaml
kv_ has quit [Ping timeout: 260 seconds]
agravier has joined #ocaml
agravier has quit [Quit: agravier]
nullcatxxx_ has joined #ocaml
nullcatxxx_ has quit [Client Quit]
nullcatxxx_ has joined #ocaml
jao has quit [Ping timeout: 240 seconds]
MercurialAlchemi has joined #ocaml
Atrumx has quit [Remote host closed the connection]
Simn has joined #ocaml
spew has quit [Quit: foobar]
nullcatxxx_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pyx has joined #ocaml
pyx has quit [Quit: WeeChat 1.7.1]
argent_smith has joined #ocaml
jack5638 has quit [Ping timeout: 240 seconds]
freusque has quit [Ping timeout: 260 seconds]
jack5638 has joined #ocaml
iZsh has quit [Ping timeout: 240 seconds]
FreeBirdLjj has joined #ocaml
iZsh has joined #ocaml
govg has quit [Quit: leaving]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 240 seconds]
ziyourenxiang has quit [Ping timeout: 240 seconds]
ziyourenxiang has joined #ocaml
agravier has joined #ocaml
agravier has quit [Read error: Connection reset by peer]
octachron has joined #ocaml
FreeBirdLjj has joined #ocaml
larhat has joined #ocaml
mfp has joined #ocaml
sz0 has joined #ocaml
<orbifx[m]> Is Map.OrderedType.compare used only for insertions to map, or is it used for find too?
<thizanne> it is used for find too
<orbifx[m]> how innappropriate would it be if the key values are strings but the compare function looks at more than just they actual key?
* orbifx[m] thinking out loud
<orbifx[m]> companion_cube: do you have an index of your container anywhere?
<orbifx[m]> I want to make a Map using a string key, but the comparisson needs to take into consideration many record fields
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
<orbifx[m]> containers*
<octachron> orbifx[m], the important point is that the order imposed by compare is constant (and is a total order)
<orbifx[m]> for the resulting map right?
<orbifx[m]> I had some records I was to map from a string. But I whether the record overrides an already mapped value, has do happen based on another field of the record. Is Map appropriate for this use?
sillyotter has joined #ocaml
sillyotter has quit [Client Quit]
sillyotter has joined #ocaml
tlvpopl has joined #ocaml
<orbifx[m]> octachron: ?
<orbifx[m]> That paragraph was grammatically killed here it is again:
<orbifx[m]> I have some records I want to map to from a string. But whether the record overrides an already mapped value, has do be decided based on another field of the record. Is Map appropriate for this use?
<octachron> customizing the add function should work
sillyotter has quit [Client Quit]
<tlvpopl> is there any particular build system i should use?
MercurialAlchemi has quit [Ping timeout: 246 seconds]
<orbifx[m]> tlvpopl: you want to know what to invest in learning?
<orbifx[m]> octachron: hm.. I don't want to customise just now; would prefer to use as much standard code as possible
<orbifx[m]> Or reuse code rather
<orbifx[m]> Was wondering if companion_cube has an appropriate container in his library
<orbifx[m]> multimap would be one i guess
<tlvpopl> yes, i don't want to use something that nobody uses... is there some particularly popular build system? something like cabal in haskell?
<orbifx[m]> cabal is a package manager, no?
<tlvpopl> yes, but it is also a build system
<tlvpopl> but making it easy to publish on opam would be a nice feature indeed
<orbifx[m]> ok, the equivalent in OCaml is Opam: https://opam.ocaml.org/doc/Packaging.html
<orbifx[m]> with opam you can select your build system. OCamlBuild is probably the defacto one
zpe has joined #ocaml
<tlvpopl> wow sorry for bothering, i should have read the documentation... thank you
<orbifx[m]> No bother :)
richi235 has joined #ocaml
<Harzilein> i know it's possible to use one's own checkout of the opam repository as a repository... it is not possible though to use multiple repositories as a kind of darkpam repository, no? only pinning to checked out sources?
TheLemonMan has joined #ocaml
haesbaer1 has quit [Quit: leaving]
haesbaert has joined #ocaml
zpe has quit [Remote host closed the connection]
FreeBirdLjj has quit [Ping timeout: 240 seconds]
FreeBird_ has joined #ocaml
freusque has joined #ocaml
tlvpopl has quit [Quit: Page closed]
<def`> opam remote
larhat has quit [Quit: Leaving.]
Muzer has quit [Ping timeout: 260 seconds]
FreeBird_ has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
mengu has joined #ocaml
govg has joined #ocaml
larhat has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
Muzer has joined #ocaml
larhat has quit [Quit: Leaving.]
MercurialAlchemi has joined #ocaml
govg has quit [Ping timeout: 240 seconds]
govg has joined #ocaml
mengu_ has joined #ocaml
mengu has quit [Ping timeout: 264 seconds]
FreeBirdLjj has joined #ocaml
Sakarah has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
Simn has quit [Ping timeout: 268 seconds]
oxcsh has joined #ocaml
oxcsh is now known as crunchytype
govg has quit [Ping timeout: 255 seconds]
octachron has quit [Quit: Leaving]
tane has joined #ocaml
spew has joined #ocaml
hashpuppy has joined #ocaml
mengu_ has quit [Quit: Leaving...]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
nnjnj has joined #ocaml
<nnjnj> Why OCaml vs Haskell?
dhil has joined #ocaml
Soni has quit [Ping timeout: 240 seconds]
nnjnj has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
Soni has joined #ocaml
richi235 has quit [Ping timeout: 240 seconds]
larhat has joined #ocaml
copy` has joined #ocaml
larhat has quit [Quit: Leaving.]
ryanartecona has joined #ocaml
dhil has quit [Ping timeout: 268 seconds]
rome has quit [Changing host]
rome has joined #ocaml
<orbifx[m]> nnjnj: ?
<flux> ..is gone :)
<orbifx[m]> It be nice if Riot reported traffic :P
<orbifx[m]> It'd *
<flux> I also ignore joins and parts, but then I can test if someone is present with nn<tab>
<orbifx[m]> it's how I got his name.. I think Riot/Matrix presumes they will come back :P
ryanartecona has quit [Quit: ryanartecona]
r4bbit has joined #ocaml
<r4bbit> Hi everyone - I'm trying to understand let rec statements in the substitution model as per this explanation: https://www.cs.cornell.edu/courses/cs3110/2015fa/l/13-semantics/rec.html and I'm wondering if anyone is able to help. Specifically in this model: let rec f = v in e --> e{v{(let rec f = v in f)/f} / f} I don't understand the inner statement "let rec f = v in f". How is the v not unbound? And if it was bound, wouldn't it just evaluate to v?
<lyxia> r4bbit: what do you mean by "bound" here
<lyxia> v is an expression in which the variable f occurs, so you can substitute.
<r4bbit> Well, I try to write these out by hand sometimes or put them in OCaml top level if I don't understand. In top level this happens:
<r4bbit> # let rec f = v in f ;;
<r4bbit> - : int = 3
<r4bbit> #
<r4bbit> # let rec f = 3 in f ;;
<r4bbit> Error: Unbound value v
<r4bbit> Does the evaluation of just this inner expression change based on the context? That seems odd
<lyxia> on that page v is not literally a variable
<lyxia> it stands for an expression
agarwal1975 has quit [Quit: agarwal1975]
<lyxia> let rec f = 3 in f, here v stands for 3, in which the variable "f" does not occur. so the substitution v{(...)/f} is equal to 3.
<lyxia> r4bbit: have I lost you
<r4bbit> No, that makes sense so far
<r4bbit> I'm thinking since in the recursive statement, f occurs in v, maybe it is not possible to evaluate it "by hand" anyway. Perhaps that's the whole point
<r4bbit> Because it will be recursive and not evaluate to a particular value in the abstract
<r4bbit> It's just hard to get one's head around
<lyxia> To take a more complicated example, with v = fun x -> x * fact (x - 1) , then v{(let rec fact = v in fact)/fact} = fun x -> x * (let rec fact = (fun x -> x * fact (x - 1)) in fact) (x - 1)
<lyxia> its definitely possible to evaluate let rec by hand
<r4bbit> I am writing it out now. I see what you're saying, with a specific example I see that it's possible. With some abstract v or f I understand it less, but it will work the same way as a specific example such as the one you posted
dhil has joined #ocaml
average has quit [Quit: leaving]
agarwal1975 has joined #ocaml
<r4bbit> I have been trying to turn the substitution model above into code and failing, despite having checked it many times. Do you mind seeing if something like this looks totally wrong at first glance? https://pastebin.com/vu3DQBzb
<r4bbit> I think I just do not understand how to refer to "f" correctly in a let rec f = v in f
agarwal1975 has quit [Ping timeout: 240 seconds]
<r4bbit> In looking at it now, I think it may actually be more of a type checking problem than a recursion problem. So debugging that....
<tobiasBora> Hello,
<tobiasBora> Just a question: how could I do a for loop with a step parameter ?
<tobiasBora> (without using the heavy recursive functions syntax)
<tane> tobiasBora, mutable variable + while?
<flux> tobiasbora, for i = 0 to 4 do let j = i * step + base in .. done ;-), or by having arranged a let for_ from to_ ?(step=1) f = .. beforehands and then use for_ 1 10 ~step:3 (fun x -> .. )
<tane> this is better xd
agarwal1975 has joined #ocaml
toolslive has quit [Ping timeout: 240 seconds]
average has joined #ocaml
toolslive has joined #ocaml
tane has quit [Quit: Leaving]
agarwal1975 has quit [Quit: agarwal1975]
Simn has joined #ocaml
ziyourenxiang has quit [Quit: Leaving]
r4bbit has quit [Ping timeout: 260 seconds]
ygrek has joined #ocaml
Guest68242 is now known as `micro
nullcatxxx_ has joined #ocaml
bungoman has quit [Ping timeout: 258 seconds]
bungoman has joined #ocaml
nullcatx_ has joined #ocaml
nullcatxxx_ has quit [Ping timeout: 240 seconds]
nullcatx_ has quit [Client Quit]
FreeBirdLjj has quit [Remote host closed the connection]
r4bbit has joined #ocaml
larhat has joined #ocaml
larhat has quit [Quit: Leaving.]
larhat has joined #ocaml
larhat has quit [Quit: Leaving.]
freusque has quit [Ping timeout: 258 seconds]
freusque has joined #ocaml
Sakarah has quit [Ping timeout: 240 seconds]
Sakarah has joined #ocaml
TheLemonMan has joined #ocaml
ryanartecona has joined #ocaml
sz0 has quit [Quit: Connection closed for inactivity]
Xadnem has joined #ocaml
govg has joined #ocaml
agarwal1975 has joined #ocaml
dhil has quit [Ping timeout: 258 seconds]
larhat has joined #ocaml
hashpuppy has quit [Quit: Connection closed for inactivity]
p_nathan has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 240 seconds]
Sakarah has quit [Remote host closed the connection]
tane has joined #ocaml
kakadu has joined #ocaml
kakadu has quit [Remote host closed the connection]
kakadu has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
Simn has quit [Ping timeout: 260 seconds]
ryanartecona has joined #ocaml
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
AlexRussia has quit [Ping timeout: 246 seconds]
Xadnem has quit [Quit: leaving]
r4bbit has quit [Ping timeout: 240 seconds]
r4bbit has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
strykerkkd has joined #ocaml
AlexRussia has joined #ocaml
spew has quit [Quit: foobar]
larhat has quit [Quit: Leaving.]
tane has quit [Quit: Leaving]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
strykerkkd has quit [Quit: Leaving]
richi235 has joined #ocaml
spew has joined #ocaml
freusque has quit [Quit: WeeChat 1.7]
kakadu has quit [Remote host closed the connection]
infinity0_ has joined #ocaml
infinity0_ has quit [Changing host]
infinity0 has quit [Killed (hitchcock.freenode.net (Nickname regained by services))]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]