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
<Onemorenickname_> hi people
<Onemorenickname_> i am doing some network
<Onemorenickname_> and so far, i've done it only in c
<Onemorenickname_> with socket, fork and read/write
<Onemorenickname_> (i have done a bit in nodejs with promises)
orbifx-m2 has quit [Ping timeout: 268 seconds]
<Onemorenickname_> is there an easy-to-learn tool for me in ocaml
<Onemorenickname_> ?
brunoro_ has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
brunoro_ has quit [Ping timeout: 240 seconds]
ocaml571 has quit [Ping timeout: 260 seconds]
orbifx-m2 has joined #ocaml
brunoro_ has joined #ocaml
orbifx-m has quit [Ping timeout: 246 seconds]
brunoro_ has quit [Ping timeout: 248 seconds]
ocaml508 has quit [Ping timeout: 260 seconds]
cpdean has quit [Ping timeout: 244 seconds]
al-damiri has quit [Quit: Connection closed for inactivity]
<Onemorenickname_> unbalanced, /j #debian
<copy`> There's a decent book: https://realworldocaml.org/v1/en/html/
brunoro_ has joined #ocaml
Onemorenickname_ has quit [Write error: Broken pipe]
Onemorenickname_ has joined #ocaml
brunoro_ has quit [Ping timeout: 248 seconds]
orbifx has quit [Ping timeout: 256 seconds]
Onemorenickname_ has quit [Ping timeout: 260 seconds]
veggie_ has quit [Ping timeout: 240 seconds]
cpdean has joined #ocaml
orbifx-m has joined #ocaml
orbifx-m has quit [Remote host closed the connection]
orbifx-m2 has quit [Ping timeout: 260 seconds]
brunoro_ has joined #ocaml
brunoro_ has quit [Ping timeout: 250 seconds]
wu_ng has joined #ocaml
yomimono has quit [Ping timeout: 258 seconds]
fluter has quit [Ping timeout: 245 seconds]
mfp has quit [Ping timeout: 248 seconds]
FreeBirdLjj has joined #ocaml
zv has quit [Ping timeout: 248 seconds]
zv has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 258 seconds]
_y has quit [Ping timeout: 268 seconds]
tobiasBora has quit [Ping timeout: 265 seconds]
fluter has joined #ocaml
_y has joined #ocaml
tobiasBora has joined #ocaml
phase_ has joined #ocaml
brunoro_ has joined #ocaml
brunoro_ has quit [Ping timeout: 258 seconds]
brunoro_ has joined #ocaml
brunoro_ has quit [Ping timeout: 250 seconds]
ocaml104 has joined #ocaml
cpdean has quit [Ping timeout: 258 seconds]
brunoro_ has joined #ocaml
brunoro_ has quit [Ping timeout: 250 seconds]
yomimono has joined #ocaml
yomimono has quit [Ping timeout: 244 seconds]
zv has quit [Ping timeout: 252 seconds]
AlexRussia has quit [Ping timeout: 265 seconds]
cpdean has joined #ocaml
brunoro_ has joined #ocaml
petroav has joined #ocaml
cpdean has quit [Ping timeout: 260 seconds]
brunoro_ has quit [Ping timeout: 260 seconds]
brunoro_ has joined #ocaml
nomicflux has joined #ocaml
brunoro_ has quit [Ping timeout: 246 seconds]
rgrinberg has quit [Ping timeout: 260 seconds]
petroav has quit [Ping timeout: 256 seconds]
brunoro_ has joined #ocaml
petroav has joined #ocaml
fUD has quit [Quit: Connection closed for inactivity]
AlexRussia has joined #ocaml
brunoro_ has quit [Ping timeout: 250 seconds]
nomicflux has quit [Quit: nomicflux]
ocaml104 has quit [Ping timeout: 260 seconds]
jao has quit [Ping timeout: 250 seconds]
TarVanim_ has joined #ocaml
TarVanim_ has quit [Client Quit]
TarVanim_ has joined #ocaml
TarVanimelde has quit [Ping timeout: 260 seconds]
govg has quit [Ping timeout: 256 seconds]
petroav has quit [Ping timeout: 256 seconds]
brunoro_ has joined #ocaml
Ravana has quit [Ping timeout: 240 seconds]
Ravana has joined #ocaml
govg has joined #ocaml
MercurialAlchemi has joined #ocaml
brunoro_ has quit [Ping timeout: 260 seconds]
brunoro_ has joined #ocaml
govg has quit [Ping timeout: 256 seconds]
brunoro_ has quit [Ping timeout: 265 seconds]
Algebr` has joined #ocaml
Ravana has quit [Ping timeout: 256 seconds]
AlexDenisov has joined #ocaml
jlongster has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zaquest has joined #ocaml
okuu has quit [Ping timeout: 265 seconds]
Algebr` has quit [Remote host closed the connection]
cataska has joined #ocaml
Ravana has joined #ocaml
AlexDeni_ has joined #ocaml
Algebr` has joined #ocaml
cpdean has joined #ocaml
AlexDenisov has quit [Read error: Connection reset by peer]
phase_ has quit [Remote host closed the connection]
cpdean has quit [Ping timeout: 268 seconds]
Ravana has quit [Ping timeout: 240 seconds]
brunoro_ has joined #ocaml
brunoro_ has quit [Ping timeout: 244 seconds]
noddy has quit [Ping timeout: 265 seconds]
brunoro_ has joined #ocaml
Sorella has quit [Quit: Connection closed for inactivity]
noddy has joined #ocaml
AlexDenisov has joined #ocaml
brunoro_ has quit [Ping timeout: 250 seconds]
AlexDeni_ has quit [Ping timeout: 260 seconds]
ewqr has joined #ocaml
Algebr` has quit [Ping timeout: 250 seconds]
cataska has quit [Quit: Textual IRC Client: www.textualapp.com]
Mercuria1Alchemi has joined #ocaml
brunoro_ has joined #ocaml
brunoro_ has quit [Ping timeout: 256 seconds]
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pierpa has joined #ocaml
brunoro_ has joined #ocaml
malc_ has joined #ocaml
brunoro_ has quit [Ping timeout: 265 seconds]
govg has joined #ocaml
brunoro_ has joined #ocaml
brunoro_ has quit [Ping timeout: 260 seconds]
ocaml584 has joined #ocaml
<ocaml584> I use atdgen to generate a yojson parser, but the output cannot be parsed by the python json parser
<ocaml584> This is the json message
<ocaml584> {"cmd":["Connection_Open",{"protocol":"bla","version":2,"address":"bla"}]}
brunoro_ has joined #ocaml
brunoro_ has quit [Ping timeout: 248 seconds]
troydm has joined #ocaml
govg has quit [Ping timeout: 246 seconds]
brunoro_ has joined #ocaml
alfredo has joined #ocaml
ygrek has quit [Ping timeout: 244 seconds]
brunoro_ has quit [Ping timeout: 256 seconds]
jnavila has joined #ocaml
cpdean has joined #ocaml
rand__ has joined #ocaml
cpdean has quit [Ping timeout: 260 seconds]
brunoro_ has joined #ocaml
nopf has joined #ocaml
kamog has joined #ocaml
brunoro_ has quit [Ping timeout: 248 seconds]
demonimin has quit [Remote host closed the connection]
demonimin has joined #ocaml
brunoro_ has joined #ocaml
copy` has quit [Quit: Connection closed for inactivity]
govg has joined #ocaml
Simn has joined #ocaml
brunoro_ has quit [Ping timeout: 256 seconds]
brunoro_ has joined #ocaml
ocaml584 has quit [Ping timeout: 260 seconds]
<reynir> it seems to work fine in python for me
brunoro_ has quit [Ping timeout: 258 seconds]
Algebr` has joined #ocaml
fre has joined #ocaml
wolfcore has quit [Ping timeout: 256 seconds]
rossberg has quit [Ping timeout: 246 seconds]
AltGr has joined #ocaml
TarVanim_ has quit [Read error: Connection reset by peer]
TarVanimelde has joined #ocaml
rossberg has joined #ocaml
petroav has joined #ocaml
larhat has joined #ocaml
wolfcore has joined #ocaml
AlexDenisov has joined #ocaml
brunoro_ has joined #ocaml
AlexDeni_ has joined #ocaml
AlexDenisov has quit [Ping timeout: 258 seconds]
brunoro_ has quit [Ping timeout: 256 seconds]
larhat has quit [Read error: Connection reset by peer]
wolfcore has quit [Ping timeout: 246 seconds]
larhat has joined #ocaml
brunoro_ has joined #ocaml
fre has quit [Ping timeout: 260 seconds]
govg has quit [Ping timeout: 260 seconds]
brunoro_ has quit [Ping timeout: 260 seconds]
wolfcore has joined #ocaml
petroav has quit [Ping timeout: 256 seconds]
brunoro_ has joined #ocaml
wolfcore has quit [Ping timeout: 248 seconds]
brunoro_ has quit [Ping timeout: 256 seconds]
brunoro_ has joined #ocaml
<Leonidas> companion_cube: one thing I would love to see in containers as well would be something like Clojure's atoms
<Leonidas> they not only support setting, like refs do but also updating the value by calling some function in a transaction, so you don't run into race conditions caused by the order in which you set refs
<johnelse> def`: yeah, I don't know whether it's good or not. I just know there was some buzz about it a little while ago, and there are lots of bindings for languages not usually considered "gui" languages (go, node.js, etc.)
brunoro_ has quit [Ping timeout: 245 seconds]
brunoro_ has joined #ocaml
ontologiae has joined #ocaml
soupault has joined #ocaml
mfp has joined #ocaml
brunoro_ has quit [Ping timeout: 252 seconds]
brunoro_ has joined #ocaml
cpdean has joined #ocaml
jwatzman|work has joined #ocaml
brunoro_ has quit [Ping timeout: 260 seconds]
cpdean has quit [Ping timeout: 268 seconds]
govg has joined #ocaml
<def`> johnelse: I tried it a few month ago, it was very buggy
<def`> But I cannot blame them, it was understandable ("normal" I would say) given the early state of the project.
<def`> Overall, I think it is a good design (compared to the terrible state of GUI libraries).
<def`> I considered doing a binding, but was waiting for the project to mature a bit.
brunoro_ has joined #ocaml
brunoro_ has quit [Ping timeout: 250 seconds]
dhil has joined #ocaml
brunoro_ has joined #ocaml
_andre has joined #ocaml
brunoro_ has quit [Ping timeout: 246 seconds]
<Algebr`> can I add things to the Lwt event loop from the C side?
<Algebr`> aantron: also, plans to make Lwt use the loop to libuv like those uwt bindings?
govg has quit [Ping timeout: 245 seconds]
kakadu has joined #ocaml
<johnelse> def`: cool, I will keep an eye on it too then
wu_ng has quit [Ping timeout: 260 seconds]
brunoro_ has joined #ocaml
AlexDeni_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
soupault has quit [Remote host closed the connection]
<kakadu> I have a weird issue with currying
<kakadu> I'm kind of need to write a function which take ('a, ('b, t) app) app and changes 'b to an another type
<kakadu> I can't figure out how to do it
<kakadu> ti should be easy because a function shoould not go far fway from identity
AlexDenisov has joined #ocaml
freehck has joined #ocaml
noddy has quit [Ping timeout: 256 seconds]
TarVanimelde has quit [Quit: TarVanimelde]
freehck has left #ocaml [#ocaml]
freehck has joined #ocaml
noddy has joined #ocaml
silver_ has joined #ocaml
demonimin has quit [Remote host closed the connection]
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
TarVanimelde has joined #ocaml
zpe has joined #ocaml
TarVanimelde has quit [Read error: Connection reset by peer]
brunoro_ has quit [Ping timeout: 260 seconds]
TarVanimelde has joined #ocaml
demonimin has joined #ocaml
brunoro_ has joined #ocaml
brunoro_ has quit [Ping timeout: 260 seconds]
noze has joined #ocaml
<noze> when introducing recursion in an imperative language we often use as an example bool isPalindrome(char word[], int size). then we recurse over the size and the word.
<noze> NB2: I don't want fun l -> List.rev l == l
<noze> NB: the imperative / functional refers to the data structure, there's nothing inherent to ocaml here
<noze> now, what's a good way of isPalindrome : 'a list -> bool as an example for recursion in a functional language?
* kakadu Never heard about introducing recursing using palindrome...
<Algebr`> ditto
orbifx-m has joined #ocaml
<kakadu> noze: Good way is to have a data structure that allows random access to elements. It is char*, ocaml's string and array but not a list
cpdean has joined #ocaml
<orbifx-m> What is the recommend way for reading partially into a cstruct and then resuming?
<orbifx-m> There is an Lwt based function for reading the complete structure:
<orbifx-m> But I'd like to read it in two fragments
cpdean has quit [Ping timeout: 245 seconds]
brunoro_ has joined #ocaml
brunoro_ has quit [Ping timeout: 250 seconds]
brunoro_ has joined #ocaml
brunoro_ has quit [Ping timeout: 244 seconds]
brunoro_ has joined #ocaml
cross has quit [Ping timeout: 250 seconds]
eikke has quit [Ping timeout: 250 seconds]
copy` has joined #ocaml
eikke has joined #ocaml
cross has joined #ocaml
AlexDenisov has joined #ocaml
brunoro_ has quit [Ping timeout: 268 seconds]
brunoro_ has joined #ocaml
silver_ is now known as silver
noze has left #ocaml ["Killed buffer"]
wu_ng has joined #ocaml
brunoro_ has quit [Ping timeout: 244 seconds]
brunoro_ has joined #ocaml
<companion_cube> Leonidas: like Haskell's MVar then?
<companion_cube> Leonidas: there is CCLock (in the sub-library concerned with threading)
<companion_cube> (but I'm planning to remove this library and put it in a separate repo/package, especially since I don't use it that much)
<companion_cube> (a kind of stdlib for preemptive threads would be useful on its own?)
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dhil has quit [Ping timeout: 268 seconds]
zpe_ has joined #ocaml
zpe has quit [Ping timeout: 244 seconds]
zpe_ has quit [Remote host closed the connection]
dhil has joined #ocaml
wu_ng has quit [Ping timeout: 268 seconds]
xavierm02 has joined #ocaml
<xavierm02> Hi. Can I make a class and a type mutually recursive? Thank you in advance for your answer.
Sorella has joined #ocaml
sepp2k has joined #ocaml
<companion_cube> I don't think so
<companion_cube> but you can make your class polymorphic `'a foo`, and then use `bar foo` (where `bar` is the type)
Cypi has quit [Ping timeout: 256 seconds]
Cypi has joined #ocaml
adrien has quit [Ping timeout: 256 seconds]
<Leonidas> companion_cube: yes, thanks, that's kinda what I wanted :)
adrien has joined #ocaml
<Leonidas> CCLock.decr is als kinda what I wanted, so that's nice :)
<companion_cube> there is the `update` function somewhere, too ;-)
<companion_cube> ah yeah, I remember, Lock.Ref is within a transaction
<companion_cube> (are you interested in such a "thread stdlib"?)
d0nn1e has quit [Ping timeout: 256 seconds]
d0nn1e has joined #ocaml
nicoo has quit [Ping timeout: 252 seconds]
nomicflux has joined #ocaml
nicoo has joined #ocaml
cpdean has joined #ocaml
okuu has joined #ocaml
nickapos has quit [Ping timeout: 256 seconds]
cpdean has quit [Ping timeout: 260 seconds]
<xavierm02> That should work. Thank you :)
dhil has quit [Ping timeout: 268 seconds]
nickapos has joined #ocaml
ewqr has quit [Ping timeout: 260 seconds]
AlexDenisov has joined #ocaml
yomimono has joined #ocaml
okuu has quit [Quit: Unyu~? Fix config.]
okuu has joined #ocaml
cpdean has joined #ocaml
dhil has joined #ocaml
cpdean has quit [Ping timeout: 244 seconds]
kamog has quit [Remote host closed the connection]
tobiasBora has quit [Ping timeout: 252 seconds]
_y has quit [Ping timeout: 250 seconds]
sh0t has joined #ocaml
tvynr has joined #ocaml
malc_ has quit [Ping timeout: 252 seconds]
_y has joined #ocaml
copy` has quit [Quit: Connection closed for inactivity]
tobiasBora has joined #ocaml
<tvynr> This question comes with a lot of pessimism. Is there any way to write something like "module M = struct include OtherModule except member_foo end;;" ?
<companion_cube> you cannot half-include
<tvynr> *nods* Figured.
<companion_cube> however, you can either: 1/ shadow some included values, or 2/ hide them using a signature
<companion_cube> module M : Foo = struct include Bar end
<companion_cube> where Foo doesn't expose member_foo
<tvynr> The trouble is that I'd like to write a generic functor that doesn't presume anything about OtherModule except that a certain member should be replaced.
<tvynr> As I'm asking this question, I'm realizing that the type system almost certainly doesn't have what I want.
<tvynr> This is probably better written as a macro or other design pattern expansion.
FreeBirdLjj has joined #ocaml
<companion_cube> probably, since the functor would return a signature anyway
malc_ has joined #ocaml
<tvynr> Thanks for the help, tho. :)
FreeBirdLjj has quit [Ping timeout: 256 seconds]
rpip has quit [Ping timeout: 240 seconds]
minn has quit [Quit: Leaving]
jlongster has joined #ocaml
copy` has joined #ocaml
<companion_cube> no pb!
xavierm02 has quit [Quit: Page closed]
dhil has quit [Ping timeout: 240 seconds]
al-damiri has joined #ocaml
Mercuria1Alchemi has quit [Ping timeout: 258 seconds]
<Leonidas> companion_cube: maybe. I'm just thinking what I would need to solve my use case and most of my usecase is "picking up the right primitives" and combining those.
rpip has joined #ocaml
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cpdean has joined #ocaml
seangrove has joined #ocaml
marsam has joined #ocaml
AlexDenisov has joined #ocaml
shinnya has joined #ocaml
freehck has quit [Remote host closed the connection]
nomicflux has quit [Quit: nomicflux]
freehck has joined #ocaml
ryanartecona has joined #ocaml
alfredo has quit [Quit: Textual IRC Client: www.textualapp.com]
dhil has joined #ocaml
zpe has joined #ocaml
Algebr` has quit [Ping timeout: 245 seconds]
kakadu has quit [Quit: Konversation terminated!]
TarVanim_ has joined #ocaml
TarVanimelde has quit [Read error: Connection reset by peer]
freusque has quit [Quit: WeeChat 1.5]
agarwal1975 has joined #ocaml
TarVanim_ has quit [Quit: TarVanim_]
TarVanimelde has joined #ocaml
veggie_ has joined #ocaml
marsam has quit [Remote host closed the connection]
frefity has quit [Ping timeout: 246 seconds]
nomicflux has joined #ocaml
shinnya has quit [Ping timeout: 245 seconds]
marsam has joined #ocaml
xavierm02 has joined #ocaml
<xavierm02> Hi. Is there some way to partially hide the implementation of a record type so that the mutable fields are seen as non-mutable from the outside?
larhat has quit [Quit: Leaving.]
<companion_cube> type t = private { foo: int; mutable bar: string }
<companion_cube> module A : sig type t = private { mutable a: int} val mk: unit -> t val incr: t -> unit end = struct type t = {mutable a: int } let mk () = {a=0} let incr t = t.a <- t.a+1 end;;
<companion_cube> try this out
<Armael> can't you just omit the "mutable" keyword in the signature?
<companion_cube> it's incompatible if you do that
nomicflux has quit [Ping timeout: 265 seconds]
<Armael> mmh indeed
jnavila has quit [Quit: It was time]
frefity has joined #ocaml
jao has joined #ocaml
rpip has quit [Ping timeout: 260 seconds]
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AlexDenisov has joined #ocaml
jwatzman|work has quit [Quit: jwatzman|work]
AlexDenisov has quit [Client Quit]
slash^ has joined #ocaml
dhil has quit [Ping timeout: 256 seconds]
<xavierm02> companion_cube: Thanks.
xavierm02 has quit [Quit: Page closed]
ontologiae has quit [Ping timeout: 258 seconds]
rpip has joined #ocaml
blackfry has quit [Ping timeout: 245 seconds]
blackfry has joined #ocaml
Algebr` has joined #ocaml
octachron has joined #ocaml
octachron has quit [Client Quit]
FreeBirdLjj has joined #ocaml
blackfry has quit [Ping timeout: 256 seconds]
mcspud has quit [Ping timeout: 260 seconds]
blackfry has joined #ocaml
mcspud has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 245 seconds]
cpdean has quit [Ping timeout: 260 seconds]
TarVanimelde has quit [Quit: TarVanimelde]
cpdean has joined #ocaml
cpdean has quit [Ping timeout: 260 seconds]
AltGr has left #ocaml [#ocaml]
zpe has quit [Remote host closed the connection]
cpdean has joined #ocaml
AlexDenisov has joined #ocaml
fraggle_ has quit [Ping timeout: 260 seconds]
cpdean has quit [Ping timeout: 256 seconds]
ygrek has joined #ocaml
nahra has quit [Ping timeout: 260 seconds]
brunoro_ has quit [Ping timeout: 250 seconds]
brunoro_ has joined #ocaml
marsam has quit [Ping timeout: 245 seconds]
brunoro_ has quit [Ping timeout: 244 seconds]
cpdean has joined #ocaml
brunoro_ has joined #ocaml
yomimono has quit [Ping timeout: 240 seconds]
dhil has joined #ocaml
govg has joined #ocaml
AlexDeni_ has joined #ocaml
nomicflux has joined #ocaml
AlexDenisov has quit [Read error: Connection reset by peer]
<Leonidas> seliopou: I'm wondering whether it is possible to link webmachine with Erlang's gen_fsm. As in: get a state into the request, process it, return a different state and use this as the state for all other requests. Do you have an idea how this could be done?
<Leonidas> seliopou: from what I see the routes have no way of feeding back a new state unfortunately
nomicflux has quit [Quit: nomicflux]
brunoro_ has quit [Ping timeout: 248 seconds]
brunoro_ has joined #ocaml
blackfry has quit [Ping timeout: 240 seconds]
blackfry has joined #ocaml
orbifx-m has quit [Ping timeout: 258 seconds]
veggie_ has quit [Ping timeout: 265 seconds]
fre has joined #ocaml
orbifx-m has joined #ocaml
veggie_ has joined #ocaml
mcspud has quit [Ping timeout: 240 seconds]
_andre has quit [Quit: leaving]
orbifx-m2 has joined #ocaml
mcspud has joined #ocaml
brunoro_ has quit [Ping timeout: 245 seconds]
jnavila has joined #ocaml
brunoro_ has joined #ocaml
tane has joined #ocaml
orbifx-m has quit [Ping timeout: 240 seconds]
slash^ has quit [Read error: Connection reset by peer]
brunoro_ has quit [Ping timeout: 260 seconds]
octachron has joined #ocaml
brunoro_ has joined #ocaml
nahra has joined #ocaml
malc_ has quit [Quit: ERC (IRC client for Emacs 25.0.50.2)]
ygrek has quit [Remote host closed the connection]
nomicflux has joined #ocaml
brunoro_ has quit [Ping timeout: 245 seconds]
brunoro_ has joined #ocaml
brunoro_ has quit [Ping timeout: 244 seconds]
veggie_ has quit [Ping timeout: 248 seconds]
ryanartecona has quit [Quit: ryanartecona]
ryanartecona has joined #ocaml
norwin287 has joined #ocaml
<norwin287> Hola buenas tardes
kakadu has joined #ocaml
veggie_ has joined #ocaml
avn has joined #ocaml
tane has quit [Quit: Leaving]
ygrek has joined #ocaml
tane has joined #ocaml
norwin287 has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
<avn> Hello folks! Does js_of_ocaml discussed here, or have own channel?
FreeBirdLjj has joined #ocaml
<Algebr`> here should be fine
<avn> I try to port `canvas.getBoundedClientRect().top` construction from JS to ocaml (using js_of_ocaml) -- https://gist.github.com/avnik/633c1fc49a19b0406dca51bfcf6ed8fd Have someone any ideas, what I do wrong?
FreeBirdLjj has quit [Ping timeout: 260 seconds]
<Algebr`> it would be easier if you said what is going wrong
<Algebr`> what would you be able to do if someone just gave you code and didn't tell you what was incorrectly happening?
<avn> `This expression has type Html.canvasElement but an expression was expected of type < .. > Js.t`
<avn> Algebr`: you are right ;)
brunoro_ has joined #ocaml
<Algebr`> the syntax extension of ## only works on things of type Js.t
<Algebr`> did you need to explicitly give the type of canvas?
<Algebr`> it probably could have been infered correct?
<Algebr`> if not then you'd need to do: (canvas:Html.canvasElement Js.t)
noddy has quit [Ping timeout: 248 seconds]
agarwal1975 has quit [Read error: Connection reset by peer]
<avn> Now it looks more funny -- `This expression has type Html.clientRect Js.t Js.meth but an expression was expected of type 'jsoo_18184c07 -> 'jsoo_776737d4 Js.meth`
<Algebr`> which line
<avn> Actually I set type, to try figure out where is real problem -- in this function, or earlier
<avn> at `let rect = ... ` line
cpdean has quit [Read error: Connection reset by peer]
<Algebr`> what is the type signature of getBoundingClientRect
cpdean has joined #ocaml
brunoro_ has quit [Ping timeout: 265 seconds]
<Algebr`> it seems that there was no reason to call it with (), aka with unit
<Algebr`> try let rect = canvas##getBoundingClientRect in
brunoro_ has joined #ocaml
jwatzman|work has joined #ocaml
richi235 has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
richi235 has joined #ocaml
<avn> Algebr`: hehe, it much better! ty ;) I thought, that no-args functions need () like ocaml' one
<Algebr`> no, methods always off
<Algebr`> class foo = object method bar = print_endline "123" end;; let g = new foo in g#bar
kamog has joined #ocaml
brunoro_ has quit [Ping timeout: 265 seconds]
<avn> Never touch OO part actually. I write some ocaml 7-8 years ago, and now refreshing it in memory. ;)
<Algebr`> +1
dhil has quit [Ping timeout: 260 seconds]
<avn> I still very surprising why most folks prefer go, ocaml looks much cleaner and simpler
<Algebr`> eh, most folks is dependent on what folks you hang out with
brunoro_ has joined #ocaml
<octachron> avn, much simpler seems debatable; go type system does not seem open to as much twisting and type trickery as ocaml's one.
<avn> Algebr`: I do a lot of python, when coding-for-food ;) Then employers starts asking for go
zaquest has quit [Quit: Leaving]
<avn> octachron: I see. But their limitation on parametrizing types/generics looks very artifical
tane has quit [Read error: Connection reset by peer]
tane has joined #ocaml
agarwal1975 has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 256 seconds]
jnavila has quit [Remote host closed the connection]
<octachron> avn, I do believe that the complexity of ocaml type system is needed, but clearly it is possible to become lost in some of the exotic regions of the type system
orbifx-m has joined #ocaml
brunoro_ has quit [Ping timeout: 244 seconds]
<avn> octachron: I am ok with it, it better, that declare copy-paste as offitical development pattern (sorry, I am a bit sarcastic after half year of go ;))
orbifx-m2 has quit [Ping timeout: 268 seconds]
veggie_ has quit [Ping timeout: 252 seconds]
FreeBirdLjj has joined #ocaml
brunoro_ has joined #ocaml
sh0t has quit [Ping timeout: 240 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
rand__ has quit [Quit: leaving]
yomimono has joined #ocaml
brunoro_ has quit [Ping timeout: 260 seconds]
veggie_ has joined #ocaml
orbifx-m2 has joined #ocaml
sh0t has joined #ocaml
brunoro_ has joined #ocaml
orbifx-m has quit [Ping timeout: 260 seconds]
brunoro_ has quit [Ping timeout: 250 seconds]
agarwal1975 has quit [Quit: agarwal1975]
orbifx-m has joined #ocaml
agarwal1975 has joined #ocaml
orbifx-m2 has quit [Ping timeout: 252 seconds]
FreeBirdLjj has quit []
jwatzman|work has quit [Quit: jwatzman|work]
orbifx-m has quit [Ping timeout: 245 seconds]
<avn> btw, does ocaml have `round` or just floor/ceil?
orbifx-m has joined #ocaml
Simn has quit [Quit: Leaving]
brunoro_ has joined #ocaml
brunoro_ has quit [Ping timeout: 268 seconds]
brunoro_ has joined #ocaml
AlexDeni_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AlexDenisov has joined #ocaml
<tane> avn, what do you expect round to do?
AlexDenisov has quit [Client Quit]
AlexDenisov has joined #ocaml
AlexDenisov has quit [Client Quit]
AlexDenisov has joined #ocaml
AlexDenisov has quit [Client Quit]
AlexDenisov has joined #ocaml
AlexDenisov has quit [Client Quit]
brunoro_ has quit [Ping timeout: 250 seconds]
brunoro_ has joined #ocaml
orbifx has joined #ocaml
brunoro_ has quit [Ping timeout: 246 seconds]
brunoro_ has joined #ocaml
<bitbckt> let round x = floor (x +. 0.5) ?
<bitbckt> a naive answer, but probably close to what avn expects.
<tane> yeah :)
tane has quit [Quit: Leaving]
jao has quit [Ping timeout: 260 seconds]
tvynr has quit [Ping timeout: 245 seconds]
brunoro_ has quit [Ping timeout: 252 seconds]
fre has quit [Ping timeout: 258 seconds]
kakadu has quit [Remote host closed the connection]
pierpa has quit [Ping timeout: 240 seconds]
tvynr has joined #ocaml
brunoro_ has joined #ocaml
cpdean has quit [Ping timeout: 260 seconds]
rgrinberg has joined #ocaml
brunoro_ has quit [Ping timeout: 268 seconds]
noddy has joined #ocaml
agarwal1975 has quit [Quit: agarwal1975]