spew has quit [Quit: Connection closed for inactivity]
jao has quit [Remote host closed the connection]
barockobamo has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 250 seconds]
webshinra has quit [Remote host closed the connection]
webshinra has joined #ocaml
jao has joined #ocaml
ygrek__ has joined #ocaml
jao has quit [Remote host closed the connection]
jao has joined #ocaml
mfp has quit [Ping timeout: 240 seconds]
jao has quit [Remote host closed the connection]
bitwinery has quit [Quit: Leaving]
tormen_ has joined #ocaml
tormen has quit [Ping timeout: 268 seconds]
assemblyman has joined #ocaml
andreas303 has quit [Ping timeout: 260 seconds]
andreas303 has joined #ocaml
brettgilio has joined #ocaml
assemblyman has quit [Quit: β’]
dborisog has joined #ocaml
narimiran has joined #ocaml
gravicappa has joined #ocaml
mbuf has joined #ocaml
brettgilio has quit [Quit: Quit]
brettgilio has joined #ocaml
alfonsox has joined #ocaml
brettgilio has quit [Remote host closed the connection]
brettgilio has joined #ocaml
brettgilio_ has joined #ocaml
bartholin has quit [Remote host closed the connection]
brettgilio has quit [Remote host closed the connection]
brettgilio has joined #ocaml
alfonsox has quit [Ping timeout: 260 seconds]
<sarna>
hello, what does "elt" stay for? it's a type name I think, but I can't figure out what it means
<def`>
element
<sarna>
ohh
<sarna>
hm, that didn't get me anywhere though.. I'm having this error: "This expression has type char but an expression was expected of type string"
<sarna>
with this code: `split_on_chars ~on:[ ','; ' '; '\n' ] input |> filter ~f:(fun x -> x <> "") `
<sarna>
(input is of type string)
<sarna>
the error points to x.. how can it be char though? it's double quoted
<Nikkel>
sarna: What split_on_chars is this?
<Nikkel>
I mean which library does it come from
<Nikkel>
ah, Jane Street
<sarna>
Nikkel: yeah, sorry, got disconnected
<sarna>
I "figured it out"..
<sarna>
I don't understand modules, really
<Nikkel>
sarna: Don't worry, you'll get there :)
<sarna>
turns out I was using Base.String.filter and I should've used Core_kernel.List.filter
<sarna>
how to debug such things?
<Nikkel>
Is there a way to get the editor to tell you which library you're using?
<sarna>
I have opens at the top, but if I type "filter" I don't know where that is coming from
<Nikkel>
I've had that mistake several times myself, where I was accidentally using another function than the one I thought I was using.
<sarna>
fwiw I'm using vim with the standard plugins
<sarna>
when I hit \t it shows me the type, but idk how to get the fully qualified name
<Nikkel>
I don't know either, maybe someone else here does
Serpent7776 has joined #ocaml
<sarna>
:MerlinLocate finds where the function was defined
<sarna>
so yeah that kinda helps
<reynir>
Merlin can tell you
<reynir>
You can also use merlin to fully qualify a name
<sarna>
how?
<reynir>
Hmm, I don't remember
<def`>
There is a "OpenQualify" feature but I only works on open statement
<def`>
reynir: We can add a "full name" feature to Merlin, thanks for the idea :)
Khady_ is now known as Khady
Khady has quit [Changing host]
Khady has joined #ocaml
pyx has joined #ocaml
Haudegen has joined #ocaml
pyx has quit [Client Quit]
<reynir>
Ah, sorry, I must have misremembered. You're welcome, though :D
leah2 has quit [*.net *.split]
DanC has quit [*.net *.split]
haesbaert has quit [*.net *.split]
Ptival has quit [*.net *.split]
jacobian has quit [*.net *.split]
haskell_enthusia has quit [*.net *.split]
jerith has quit [*.net *.split]
Leonidas has quit [*.net *.split]
srax has quit [*.net *.split]
sheijk has quit [*.net *.split]
so has quit [*.net *.split]
haesbaert has joined #ocaml
leah2 has joined #ocaml
DanC has joined #ocaml
haskell_enthusia has joined #ocaml
Ptival has joined #ocaml
sheijk has joined #ocaml
Leonidas has joined #ocaml
so has joined #ocaml
jerith has joined #ocaml
jacobian has joined #ocaml
srax has joined #ocaml
leah2 has quit [Max SendQ exceeded]
so has quit [Max SendQ exceeded]
so has joined #ocaml
leah2 has joined #ocaml
<sarna>
if I open Core_kernel, do I automatically use stuff from Core_kernel__.Core_pervasives?
<Leonidas>
sarna: yes, looks like it. You don't need to touch any `__` modules, that's mostly a dune artefact.
<sarna>
Leonidas: I see, thanks.
<Leonidas>
def`: full name would be an amazing feature in merlin
<Leonidas>
sarna: btw, if you open Base or Core, you shouldn't just have `filter`.
<sarna>
Leonidas: iirc I had Base.String and Core_kernel.List open >.>
<sarna>
I have to do some reading
<Leonidas>
sarna: You'll have List.filter or String.filter and I guess one way to figure stuff out is to ask Merlin for the type of a function and check whether it matches what you expect
<Leonidas>
sarna: important rule: don't just open modules not meant for opening. You'll thank me later.
<Leonidas>
Kinda like `from x import *` and unqualified imports are discouraged in Python & Clojure.
<sarna>
Leonidas: how would I find out which ones are meant for opening? the top-level ones?
<Leonidas>
sarna: usually none.
* sarna
is shook
<Leonidas>
there are rare exceptions like Core/Async, the Let_syntax modules and stuff like Asttypes, maybe
<sarna>
ohh I see
<sarna>
also I was confused about like.. does Core_kernel have stuff from Base or do I need to use both
<sarna>
seems like it does have stuff from Base though :)
<Leonidas>
sarna: but just opening random modules will lead to name clashes and difficult to read code ("where the fuck does lift_m come from????")
<sarna>
yeah I figured :D
<Leonidas>
sarna: Core_kernel is, if I understand correctly, to become a superset of Base. Though last time I looked there was a number of ways where Core_kernel and Base disagreed.
<Leonidas>
like the definition of (=)
<Leonidas>
you'd have to ask someone else on the direction of core though, I'm not at Jane Street and this is only stuff I remember being mentioned.
<Leonidas>
companion_cube: the new ocaml 4.03 compatible release of zmq was merged to opam-repository, so you should be able to use it as soon as the change propagates. Sorry it took so long.
<sarna>
Leonidas: if I understand correctly, Core_kernel is Core without Unix-specific stuff
<Leonidas>
(Travis fixed itself but I didn't notice since dune 2.x added another build failure)
<Leonidas>
sarna: yeah, essentially.
<sarna>
and as an outsider I thought pretty much everybody was using Jane Street's libraries :)
<Leonidas>
what gave you that impression? RWO?
<narimiran>
i had the same impression (yeah, probably RWO) until i joined this channel :)
<sarna>
what's RWO?
<Nikkel>
I occasionally use (some of) Batteries for some extra oomph, but that's it.
<sarna>
reading about OCaml on the internet, mostly
<Leonidas>
bear in mind that one of the authors of RWO is working at Jane Street
<narimiran>
sarna: real world ocaml, book
<Leonidas>
oh, if I sort packages by popularity then the most popular package is⦠atd.
<sarna>
narimiran: oh, yeah. if an "official" book uses it, everybody does, right :)
<sarna>
s/an/the
<narimiran>
sarna: that was until i discovered companion_cube's Containers :)
<Leonidas>
and the topmost jst dependency is ppx_let
<Leonidas>
interesting
<sarna>
I find core's docs really hard to read :/
<sarna>
there's no search and it's difficult to find a thing if I don't know what I specifically need
<Leonidas>
sarna: I hardly use them. Just to determine what's there.
<Leonidas>
yes, that's true
gareppa has joined #ocaml
<sarna>
narimiran: containers seem to have nicer docs
<Leonidas>
that's because companion_cube employs a technical writer
<Leonidas>
oh, wait :D
<def`>
Leonidas: :DDD
<Leonidas>
that was one of my pet-peeves with Clojure, all the builtins were documented but the descriptions were so bad, most of the time I had to try the function anyway to have any understanding what it was doing.
* sarna
misses out on the joke :(
<sarna>
yeah Leonidas, same with me
gareppa has quit [Quit: Leaving]
<sarna>
is there a function that would take a list and return another list with one element changed? like, List.foo [1; 2; 3] 0 5 -> [5; 2; 3]
ygrek__ has quit [Ping timeout: 240 seconds]
<def`>
let rec foo ls n y = match ls, n with [], _ -> invalid_arg "foo: invalid index" | _ :: xs, 0 -> y :: xs | x :: xs -> x :: foo xs (n - 1) y;;
<def`>
let rec foo ls n y = match ls, n with [], _ -> invalid_arg "foo: invalid index" | _ :: xs, 0 -> y :: xs | x :: xs, _ -> x :: foo xs (n - 1) y;;
<def`>
sorry :)
<def`>
but this is not the kind of code the OCaml encourages
<sarna>
yeah I wrote my own version with take and drop, was just wondering if there was a standard one
zolk3ri has joined #ocaml
narimiran has quit [Ping timeout: 250 seconds]
mfp has joined #ocaml
<Leonidas>
sarna: yeah, as def` said, encoding data in lists where each index means something specifically is not usually a good pattern in OCaml
dhil has joined #ocaml
zolk3ri has quit [Remote host closed the connection]
<sarna>
Leonidas: what would be idiomatic in this case? turning the list into an array?
<Nikkel>
I have an Eliom_content.Html.D.select, that I want to get the selected values from. Are there a nicer way than Js_of_eliom?
<Leonidas>
sarna: either a tuple or a record if there is semantic meaning in the ordering.
<sarna>
Leonidas: well I'm doing advent of code, and it's a list.. well, of operations
<sarna>
I think it should be an array of tuples/structs
<sarna>
not sure though
<Leonidas>
sarna: I don't know the context, so hard to say
<sarna>
Leonidas: sure. anyway, list was enough in this simple case :)
<Leonidas>
but the usual way to operate on lists is first::rest so so if you find yourself accessing indexes on lists that means that the representation is ~probably~ not optimal
<sarna>
yeah, O(n) random access, isn't it
<sarna>
if it's a simply linked list
<Leonidas>
also, indexes are kinda fragile since they are tricky without dependent types
<sarna>
yeah, easy to get an exception
<Leonidas>
so you get yourself something that can fail on index exceptions without *any* assisance of the type system
<sarna>
in this case I control the input though, so I know precisely how many things are gonna be there
<Leonidas>
yeah, that's what everyone says
ggole has joined #ocaml
<Leonidas>
If I were to write C I would always just malloc the memory before using it
<sarna>
:D
<sarna>
no but really, the program has to solve a problem using a fixed input string
<Leonidas>
that doesn't mean that it suddenly becomes idiomatic
<Leonidas>
I mean, just pointing it out that there might be a more camlish way of doing it
<Leonidas>
:)
<sarna>
there certainly is, no doubt :)
narimiran has joined #ocaml
<Nikkel>
How do I fire some javascript when the document has finished loading?
<Nikkel>
I need to do some $.ready()
mbuf has quit [Quit: Leaving]
<Armael>
I do Lwt_js_events.domContentLoaded () >>= fun _ -> ...
<Nikkel>
Or not. The actual problem is that I'm using bootstrap-select to create a nicer select-menu, but when I use it, eliom says "unique node without id attribute"
<Nikkel>
That's the actual base issue
barockobamo has joined #ocaml
dhil has quit [Ping timeout: 268 seconds]
<companion_cube>
Leonidas: thanks π
jcob has quit [*.net *.split]
hannes has quit [*.net *.split]
lyxia has quit [*.net *.split]
pepesza has quit [*.net *.split]
rixed has quit [*.net *.split]
ski has quit [Remote host closed the connection]
hannes has joined #ocaml
rixed has joined #ocaml
pepesza has joined #ocaml
jcob has joined #ocaml
lyxia has joined #ocaml
spew has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
lyxia has quit [*.net *.split]
jcob has quit [*.net *.split]
hannes has quit [*.net *.split]
pepesza has quit [*.net *.split]
rixed has quit [*.net *.split]
jcob has joined #ocaml
hannes has joined #ocaml
lyxia has joined #ocaml
rixed has joined #ocaml
pepesza has joined #ocaml
FreeBirdLjj has joined #ocaml
barockobamo has quit [Quit: Leaving]
barockobamo has joined #ocaml
jao has joined #ocaml
jao is now known as Guest35115
Guest35115 has quit [Remote host closed the connection]
FreeBirdLjj has quit []
jao- has joined #ocaml
FreeBirdLjj has joined #ocaml
Haudegen has joined #ocaml
Serpent7776 has quit [Quit: Leaving]
dhil has joined #ocaml
tane has joined #ocaml
smazga has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
mfp has quit [Ping timeout: 250 seconds]
ziyourenxiang has quit [Ping timeout: 240 seconds]
barockobamo has quit [Remote host closed the connection]
iAmerikan has joined #ocaml
narimiran has quit [Ping timeout: 268 seconds]
vicfred has quit [Quit: Leaving]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 240 seconds]
ggole has quit [Quit: Leaving]
mister_m has joined #ocaml
mister_m has left #ocaml ["ERC (IRC client for Emacs 24.5.1)"]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 276 seconds]
gareppa has joined #ocaml
kakadu_ has quit [Quit: Konversation terminated!]
jao- has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 240 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 250 seconds]
Haudegen has quit [Quit: Bin weg.]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 276 seconds]
gareppa has quit [Read error: Connection reset by peer]
barockobamo has joined #ocaml
FreeBirdLjj has joined #ocaml
bartholin has joined #ocaml
jco has joined #ocaml
gareppa has joined #ocaml
<jco>
Hello! I'm tring to generate the documentation for a project using odoc
<jco>
I tried to generate it using "dune build @doc" but the index.html is almost empty
<jco>
however I could generate the whole ocaml docs with odig doc
mfp has joined #ocaml
jco has quit [Read error: Connection reset by peer]
jco has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 250 seconds]
FreeBirdLjj has joined #ocaml
gareppa has quit [Quit: Leaving]
jao has joined #ocaml
jao is now known as Guest11460
brettgilio_ has quit [Ping timeout: 245 seconds]
dborisog has quit [Remote host closed the connection]
narimiran has joined #ocaml
dhil has quit [Ping timeout: 268 seconds]
FreeBirdLjj has quit [Ping timeout: 240 seconds]
kakadu has joined #ocaml
Guest11460 has quit [Remote host closed the connection]
gravicappa has quit [Ping timeout: 240 seconds]
jao- has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 240 seconds]
FreeBirdLjj has joined #ocaml
sagax has quit [Read error: Connection reset by peer]
kakadu has quit [Read error: Connection reset by peer]
kakadu_ has joined #ocaml
Denommus has joined #ocaml
jnavila has joined #ocaml
gareppa has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 276 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 240 seconds]
narimiran has quit [Ping timeout: 276 seconds]
jnavila has quit [Remote host closed the connection]
cthuluh has quit [Ping timeout: 240 seconds]
Jesin has quit [Quit: Leaving]
Jesin has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 268 seconds]
jao- has quit [Ping timeout: 276 seconds]
gareppa has quit [Quit: Leaving]
Denommus has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
cthuluh has joined #ocaml
jao has joined #ocaml
jco has quit [Quit: WeeChat 2.6]
tane has quit [Quit: Leaving]
FreeBirdLjj has quit [Ping timeout: 240 seconds]
ziyourenxiang has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 250 seconds]
FreeBirdLjj has joined #ocaml
kakadu_ has quit [Remote host closed the connection]
FreeBirdLjj has quit [Ping timeout: 265 seconds]
smazga has quit [Quit: leaving]
FreeBirdLjj has joined #ocaml
oxford has quit [Ping timeout: 260 seconds]
oxford has joined #ocaml
spew has quit [Quit: Connection closed for inactivity]