<sgronblo>
hmm, I have a file called QueryParserTest.ml which is trying to open QueryParser. QueryParserTest.ml and QueryParser.ml are both in the same directory. Merlin shows me "unbound module QueryParser". I'm supposing this is because QueryParser.ml has not been built to _build yet. However I expected "ocamlbuild -use-ocamlfind 'QueryParserTest.native'" would result in the QueryParser being compiled to _build,
<sgronblo>
but for some reason that doesn't seem to happen.
sgronblo has quit [Read error: Connection reset by peer]
mfp has quit [Ping timeout: 240 seconds]
jao has quit [Ping timeout: 240 seconds]
diphuser has joined #ocaml
sgronblo has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 246 seconds]
pierpa has quit [Quit: Page closed]
sgronblo has quit [Ping timeout: 246 seconds]
sgronblo has joined #ocaml
kassens has quit [Ping timeout: 240 seconds]
segmond has quit [Quit: l8r]
pyx has joined #ocaml
pyx has quit [Client Quit]
average has quit [Quit: leaving]
sgronblo_ has joined #ocaml
sgronblo has quit [Ping timeout: 260 seconds]
spew has quit [Ping timeout: 260 seconds]
ygrek has joined #ocaml
sgronblo_ has quit [Ping timeout: 240 seconds]
sgronblo has joined #ocaml
dmj` has quit []
dmj` has joined #ocaml
<sgronblo>
hmm, I have a file called QueryParserTest.ml which is trying to open QueryParser. QueryParserTest.ml and QueryParser.ml are both in the same directory. Merlin shows me "unbound module QueryParser". I'm supposing this is because QueryParser.ml has not been built to _build yet. However I expected "ocamlbuild -use-ocamlfind 'QueryParserTest.native'" would result in the QueryParser being compiled to _build,
<sgronblo>
but for some reason that doesn't seem to happen.
average has joined #ocaml
spew has joined #ocaml
MercurialAlchemi has joined #ocaml
spew has quit [Ping timeout: 240 seconds]
lambda_foo has quit [Quit: Connection closed for inactivity]
sgronblo has quit [Read error: Connection reset by peer]
sgronblo has joined #ocaml
sgronblo_ has joined #ocaml
sgronblo has quit [Ping timeout: 268 seconds]
diphuser has quit [Remote host closed the connection]
infinity0 has joined #ocaml
zv has quit [Quit: WeeChat 1.6]
lambda_foo has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 272 seconds]
yegods has quit [Remote host closed the connection]
sz0 has joined #ocaml
MercurialAlchemi has joined #ocaml
kassens has joined #ocaml
spew has quit [Ping timeout: 272 seconds]
FreeBirdLjj has joined #ocaml
yegods has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 240 seconds]
spew has joined #ocaml
yegods has quit [Ping timeout: 272 seconds]
ontologiae has joined #ocaml
Simn has joined #ocaml
n4323 has joined #ocaml
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ontologiae has quit [Ping timeout: 260 seconds]
spew has quit [Quit: foobar]
alfredo has joined #ocaml
freusque has joined #ocaml
n4323 has quit [Ping timeout: 240 seconds]
n4323 has joined #ocaml
sgronblo_ has quit [Read error: Connection reset by peer]
sgronblo has joined #ocaml
raphinou has joined #ocaml
moei has quit [Quit: Leaving...]
ygrek has quit [Ping timeout: 240 seconds]
AlexDenisov has joined #ocaml
n4323 has quit [Ping timeout: 246 seconds]
lambda_foo has quit [Quit: Connection closed for inactivity]
mks11 has joined #ocaml
n4323 has joined #ocaml
<mks11>
Hi, I want to create a set (for some already explored states) to check the existence of a new state in this set in O(1). How can I do it in OCaml?
<mks11>
The book suggest to create a hashtable. Does it mean I have to use the state itself as key? and if so, what should be the value of these keys?
<flux>
mks11, yes, you would use the state itself as the key
<flux>
mks11, the value would be ()
n4323 has quit [Ping timeout: 240 seconds]
<mks11>
:flux awesome thanks so much!
<flux>
mks11, good luck :).
AltGr has joined #ocaml
zpe has joined #ocaml
n4323 has joined #ocaml
kassens has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<sgronblo>
and make test depends on QueryParserTest.native
<sgronblo>
so I thought running make test would end up calling that ocamlbuild line, where ocaml build would then figure out that QueryParser.ml must be built before trying to build QueryParserTest.
<def`_>
so queryparsertest doesn't trigger the build of queryparser
<def`_>
yes but what if ocamlbuild can't figure it out?
<Leonidas>
The main headache ist how to force any ocaml build tool to call rustc instead of cc.
kakadu has joined #ocaml
<rixed_>
Hey there. I've got troubles with Printexc.to_string default printer in Lwt.catch context. Is anyone aware of some known issue related to the one or the other?
<Leonidas>
wasn't opam upgrade supposed to only upgrade what is possible?
<Leonidas>
I am having a failure where it tries to upgrade amqp-client and async and fails. But shouldn't instead async not be allowed to upgrade?
<companion_cube>
rixed_: not sure Printexc works well with lwt
<companion_cube>
lwt puts more things on the heap (all the promises), so stacktraces are not very informative
<rixed_>
companion_cube: I was not expecting to use the stacktrace but the exception name would already be useful. While many times it seems when I try to Printexc.to_string within the exception handler side of Lwt.catch the event loop just hangs.
sz0 has quit [Quit: Connection closed for inactivity]
<companion_cube>
oh?
<rixed_>
companion_cube: if it's not already a know issue I will look deeper into it.
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Ping timeout: 268 seconds]
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
<Leonidas>
I solution of my problem: upgrade only bails if it wasn't called with specific packages to upgrade.
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Leonidas>
s/I s/S/
n4323 has joined #ocaml
zpe has joined #ocaml
mks11 has quit [Ping timeout: 260 seconds]
jao has joined #ocaml
sgronblo has joined #ocaml
n4323 has quit [Ping timeout: 240 seconds]
johnelse_ has quit [Ping timeout: 258 seconds]
jao has quit [Ping timeout: 240 seconds]
johnelse has joined #ocaml
zpe has quit [Remote host closed the connection]
AlexDenisov has joined #ocaml
alexelcu has joined #ocaml
alexelcu has left #ocaml [#ocaml]
alexelcu has joined #ocaml
Algebr has joined #ocaml
freusque has quit [Quit: WeeChat 1.7]
olibjerd has joined #ocaml
zpe has joined #ocaml
phaer has joined #ocaml
mengu has joined #ocaml
_andre has joined #ocaml
nicootje has joined #ocaml
nicoo has quit [Remote host closed the connection]
jabesed has joined #ocaml
trevorriles has joined #ocaml
jabesed has quit [Ping timeout: 255 seconds]
infinity0 has quit [Remote host closed the connection]
jabesed has joined #ocaml
jabesed has quit [Ping timeout: 255 seconds]
yegods has joined #ocaml
infinity0 has joined #ocaml
trasz has joined #ocaml
<trasz>
No such package: core.top
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<rgrinberg>
Leonidas: it doesn't
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
AlexDenisov has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
zv has joined #ocaml
Algebr has quit [Ping timeout: 240 seconds]
MercurialAlchemi has joined #ocaml
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<barcabuona>
can anybody help me with my environment extension?
<barcabuona>
let env' (key:ide) (value:value) (oldenv:env): env = function id -> if id=key then value else (oldenv key)
<barcabuona>
let emptyenv:env = function "" -> Unbound | other -> failwith ("'"^other^"' not in environment")
<barcabuona>
let env1 = env' "hi" (EInt(5)) emptyenv
<barcabuona>
env' is supposed to extend emptyenv but if i call (env1 "") i do not get Unbound, but rather an exception!
<barcabuona>
(ide is a string)
<barcabuona>
(env is ide->value)
AlexDenisov has joined #ocaml
shinnya has joined #ocaml
kassens has quit [Ping timeout: 260 seconds]
<octachron>
barcabuona, … let's say that this is yet another reason to use standard data structure rather than trying to reimplement them badly ( … the error is in "(oldenv key)")
kassens has joined #ocaml
spew has joined #ocaml
diphuser has joined #ocaml
FreeBirdLjj has joined #ocaml
<zozozo>
barcabuona: just a thought but storing the environnement in a closure seems impractical, as lookups will take a linear time, why not simply use a map ?
<barcabuona>
zozozo: this is a matter of type cleanliness
<barcabuona>
i just want my language to be as close as possible to theoretical formulas
<barcabuona>
meaning i dont even care if lookups take O(n^3)
<barcabuona>
im still working on that hint from octa_
<barcabuona>
strangely whatever i pass the new environment the error will always be same
<barcabuona>
lookup on the value that was constructed
tane has joined #ocaml
<barcabuona>
aaah
<barcabuona>
thanks octachron !
<barcabuona>
variables names are unfortunate in these situations...
jabroney1 has joined #ocaml
jabroney has quit [Ping timeout: 260 seconds]
freusque has joined #ocaml
AltGr has left #ocaml [#ocaml]
Algebr has joined #ocaml
vgrocha has joined #ocaml
sgronblo has quit [Read error: Connection reset by peer]
<Leonidas>
I guess I should have a look at base/stdio/core/core_kernel and stuff to see what is there and what isn't
shinnya has quit [Ping timeout: 260 seconds]
jnavila has joined #ocaml
kassens has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
freusque has quit [Quit: WeeChat 1.7]
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
larhat has joined #ocaml
yomimono has joined #ocaml
<Leonidas>
jerith: wow sorry I haven't responded to your PR since *April*. Doing that now.
hashpuppy has quit [Quit: Connection closed for inactivity]
<jerith>
Leonidas: That's amateur-level github negligence. How many months did it take me to respond to some of those PRs? :-)
jnavila has quit [Ping timeout: 260 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
Anarchos has joined #ocaml
Anarchos has quit [Client Quit]
Anarchos has joined #ocaml
nahra has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
<Leonidas>
To get a `Foo in monospace is quite tricky in githubs markdown, there is something wonky in their parser I believe
<Leonidas>
I would have expected `\`Foo` to work, but it doesn't.
<Drup>
Leonidas: `` `Foo ``
<Leonidas>
Drup: cool, that works :)
nahra has joined #ocaml
jabroney1 has quit [Quit: Leaving.]
<Leonidas>
jerith: now that I commented, I expect your response momentarily ;)
<Leonidas>
jerith: (just kidding of course, the branch looks good and once we agree on how to handle the "omg slack returned some weird shit" case it's good to go)
mks11 has joined #ocaml
<jerith>
Leonidas: I'll try get to it in the next week or so.
jabroney has joined #ocaml
yegods has joined #ocaml
<Leonidas>
jerith: I wonder, maybe channels.info can take a channel name, then the whole filtering can be avoided altogether
<mks11>
Hi, I am learning Ocaml. I am stuck at this one however: "Write a function mapl which maps a function of type α → β over a list of type α list list to produce a list of type β list list." can I match a patter like [[]] and [[hd::tl]] or [hd::tl]
jabroney has quit [Client Quit]
<jerith>
Annoying things about working with large NGOs: After waiting months for them to do a thing that you need before you can do your thing, it suddenly happens at the least convenient time possible and then they expect you to do your bit instantly. :-/
<jerith>
(Related: This week I am rebuilding a cluster in Uganda now that the hardware we were promised last year is finally ready.)
<Leonidas>
jerith: Good luck. At least it is probably creates value beyond "make people click on ads more" :)
<Leonidas>
mks11: yes, you can match [[]] just fine.
<jerith>
It... contributes to the global overpopulation problem, I guess.
<jerith>
(Which is to say it is part of a maternal health project.)
<Leonidas>
mks11: you can deconstruct this problem into a simpler one first
<Drup>
jerith: is it OCaml-powered ? :p
<mks11>
Leonidas: thanks so much! need a bit more hint :/
jao has joined #ocaml
<Leonidas>
mks11: ('a -> 'b) -> 'a list list -> 'b list list. First implement a function which does ('a -> 'b) -> 'a list -> 'b list
<jerith>
Drup: Sadly not. Although I have a little tool that gets some capacity information from marathon/mesos and posts it to slack.
<jerith>
We're mostly a Python shop, but I don't get to write much as much code as I'd like.
<mks11>
Leonidas: I see. Let me try that.. hopefully I'll figure this from here. Thanks so much
AlexDenisov has joined #ocaml
<Leonidas>
Our OCamlers started to troll our Node devs by introducing them to Flow
<Leonidas>
I guess the eventual plan is to get them to eventually convert to ocaml and js_of_ocaml :D
yomimono has quit [Ping timeout: 240 seconds]
TheLemonMan has joined #ocaml
slash^ has joined #ocaml
<Leonidas>
mks11: good luck! Let us know if you run into problems. I'm off for shopping but will drop by later
<mks11>
Great! have a great day.
<Leonidas>
Gnah, compose yields `('_a -> '_b) -> '_a list list -> '_b list list` :(
<Drup>
Leonidas: "Thou shall not use pointfree with polymorphic functions in OCaml"
<Drup>
(or, to be more catchy, "Pointfree is pointless")
<Leonidas>
Yeah. But pointfree is such a cute trick :)
<Drup>
it means not to create function explicitely such as "fun x -> ..."
<pierpa>
hmmm
<mks11>
Drup: but I create anonymous functions all the time. bad?
<Drup>
mks11: ignore the pointfree nonsense, I only used it to troll Leonidas a bit
<mks11>
pierpa: Thanks a bunch for the link. Definitely great to know another CS term.
<Drup>
creating (anonymous) functions is perfectly fine
<mks11>
Drup: Oh ok! thanks for clarifying.
spew_ has joined #ocaml
<Drup>
(pointfree is already of very dubious utility in Haskell-land, where it's supported a lot better. It's only purpose in OCaml is being a brain exercise in writing unreadable code)
spew has quit [Ping timeout: 272 seconds]
<mks11>
Drup: got it!
jnavila has joined #ocaml
mengu has quit [Read error: Connection reset by peer]
mengu has joined #ocaml
govg has joined #ocaml
kakadu has quit [Quit: Konversation terminated!]
<mks11>
Drup: your comment now makes a lot of sense. "In the declaration f x = x + 1 we define the function f in terms of its action on an arbitrary point x. Contrast this with the points-free version: f = (+ 1)" nice little paragraph here https://wiki.haskell.org/Pointfree#But_pointfree_has_more_points.21
<mks11>
Drup: will ignore it, thanks!
jabroney has joined #ocaml
yithump has joined #ocaml
mengu has quit [Read error: Connection reset by peer]
jnavila has quit [Ping timeout: 240 seconds]
mengu has joined #ocaml
mengu has quit [Read error: Connection reset by peer]
<Leonidas>
mks11: now that you learned how to do it on your own, the next thing to realize is you don't even need to create your own map function, you can use List.map
diphuser has quit [Ping timeout: 268 seconds]
<mks11>
Leonidas: awesome! thanks for not telling me that first :P
mengu has joined #ocaml
<Leonidas>
mks11: heh, thought if you approach it from 0 you might learn more.
* jerith
prepares to write a very low-level compiler in OCaml.
<Leonidas>
mks11: can you show us your code?
<mks11>
for sure ..let me send it
<jerith>
I'm going to need some kind of parser, I guess.
<Leonidas>
jerith: so, a compiler written in 6052 assembly?
<jerith>
I'm working through http://nand2tetris.org/ and have just reached the first implementation project in the second part.
MercurialAlchemi has quit [Ping timeout: 246 seconds]
<jerith>
The first part is about building a computer from logic gates and ends with writing an assembler.
<mks11>
Leonidas: let rec map (fn: 'a -> 'b) (xs: 'a list) : ('b list) = match xs with |[] -> [] |x::xs' -> fn x :: (map fn xs') let rec mapl (fn: 'a -> 'b) (xs: 'a list list) : ('b list list) = match xs with |[] -> [] |row::rows'-> (map fn row)::(mapl fn rows')
<jerith>
(I did that in Python because it was late and I was tired.)
<Leonidas>
mks11: care for me to help you to improve it? :)
<mks11>
Leonidas: that would be great!!
<Leonidas>
mks11: ok, so step 1 is to use List.map instead of your `map`
<jerith>
This project is about compiling the stack machine low level code to the computer's assembly language.
<Leonidas>
hmm, that's quite ambitious
<jerith>
It's a little less late and I'm a little less tired, so I'm going to do it properly in OCaml.
<Leonidas>
too bad you miss out on microcode ;)
<mks11>
Leonidas: Ok! I'll replace that "map" with List.map ... and get rid of the "let rec map.. " all together
mengu has quit [Read error: Connection reset by peer]
<jerith>
I had to build a CPU in a very simplistic hardware definition language. I'm happy to skip the microcode step. ;-)
<Leonidas>
mks11: ok, verify that it is still correct and post it here again :)
<mks11>
Leonidas: Sounds good!
ygrek has joined #ocaml
<mks11>
Leonidas: let rec mapl (fn: 'a -> 'b) (xs: 'a list list) : ('b list list) = match xs with |[] -> [] |row::rows'-> (List.map fn row)::(mapl fn rows')
<mks11>
Leonidas: # mapl (fun x -> x*x) [[1;2];[3;4]];; - : int list list = [[1; 4]; [9; 16]]
<Leonidas>
mks11: ok, great. Now, remember `match xs with |[] -> [] |x::xs' -> fn x :: (map fn xs')` which you replaced with List.map?
<mks11>
Leonidas: yes!
<Leonidas>
mks11: List.map is basically "go over each element of that list and do something", right? Do you have the case in your code somewhere else?
<mks11>
Leonidas: AH! I think get it. I would use over the rows. :)
<Leonidas>
mks11: Exactly!
<mks11>
Leonidas: let me try that!
<jerith>
Bleh. I haven't used opam since homebrew gave me a new ocaml, so now I have to wait for it to upgrade everything. :-/
<mks11>
Leonidas: GOT IT!! Thanks so much. this is great. let rec mapl (fn: 'a -> 'b) (xs: 'a list list) : ('b list list) = List.map (fun row -> List.map fn row) xs
<Leonidas>
mks11: Well done!
<Leonidas>
(usually we don't write the type annotations on the functions, though, but if your material assumes that, then keep on doing that)
<mks11>
Leonidas: Sounds good! good to know the other practice too. Thank you so much! You helped me a lot in understanding this.
<Leonidas>
jerith: I just learned to never use the system ocaml.
<jerith>
Yeah, I should learn that too.
<jerith>
Except then I'd need another ocaml, which I'd have to wait for.
slash^ has quit [Remote host closed the connection]
<Leonidas>
maybe you can implement an alternative compiler which builds faster :p
mengu has joined #ocaml
<jerith>
Leonidas: That sounds like I'd be waiting quite a bit longer before I can use it...
mengu has quit [Read error: Connection reset by peer]
<Leonidas>
jerith: "at least it's not GHC"
<Drup>
For a compiler of a mainstream-ish language, ocaml is extremly fast to compile
mengu has joined #ocaml
yithump has quit [Quit: Page closed]
mengu has quit [Read error: Connection reset by peer]
<Leonidas>
yeah, the only slow part is core
<companion_cube>
:-)
mengu has joined #ocaml
mks11 has quit [Quit: Page closed]
ontologiae has joined #ocaml
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kakadu has joined #ocaml
AlexDenisov has joined #ocaml
robertc has joined #ocaml
yomimono has joined #ocaml
larhat has quit [Quit: Leaving.]
Simn has quit [Read error: Connection reset by peer]
Anarchos has quit [Quit: Vision[0.10.1]: i've been blurred!]
ciniglio has quit [Remote host closed the connection]
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jnavila has joined #ocaml
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
sepp2k has quit [Ping timeout: 268 seconds]
larhat has joined #ocaml
iitalics has joined #ocaml
sepp2k has joined #ocaml
jnavila has quit [Ping timeout: 246 seconds]
sepp2k has quit [Ping timeout: 260 seconds]
mengu has quit [Read error: Connection reset by peer]
_andre has quit [Quit: leaving]
tane has quit [Quit: Leaving]
aconz2 has joined #ocaml
jabroney has quit [Ping timeout: 240 seconds]
sh0t has quit [Remote host closed the connection]
jabroney has joined #ocaml
olibjerd has quit [Quit: olibjerd]
mengu has joined #ocaml
aconz2 has quit [Ping timeout: 260 seconds]
Algebr has quit [Ping timeout: 240 seconds]
bbc_ has joined #ocaml
bbc has quit [Read error: Connection reset by peer]
bbc_ is now known as bbc
larhat has quit [Quit: Leaving.]
kakadu has quit [Remote host closed the connection]