sst668 has quit [Remote host closed the connection]
ziyourenxiang has quit [Ping timeout: 252 seconds]
madroach has joined #ocaml
jbrown has joined #ocaml
pierpa has quit [Quit: Page closed]
jbrown has quit [Ping timeout: 245 seconds]
pierpal has joined #ocaml
neatonk has joined #ocaml
td123 has quit [Quit: WeeChat 1.9.1]
lostman has joined #ocaml
spew has joined #ocaml
verm1n14 has joined #ocaml
mengu has joined #ocaml
verm1n14 has quit [Remote host closed the connection]
FreeBirdLjj has quit [Ping timeout: 252 seconds]
mengu has quit [Ping timeout: 244 seconds]
spew has quit [Ping timeout: 246 seconds]
Soni has quit [Remote host closed the connection]
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
Soni has joined #ocaml
mfp has quit [Ping timeout: 240 seconds]
erkin has quit [Remote host closed the connection]
tormen_ has joined #ocaml
tormen has quit [Ping timeout: 245 seconds]
spew has joined #ocaml
spew has quit [Remote host closed the connection]
spew has joined #ocaml
ranu has joined #ocaml
<ranu>
why I can't mix the print_endline with print_string? Trying to use both on a function will lead to a type error
<ranu>
But when print_endline is replaced by a Printf.printf "\n" it goes right
<ranu>
Both of functions return unit and yet the compiler tells me that it is wrong
<ranu>
Am I missunderstanding some aspect of the IO return type
<ranu>
?
<ranu>
hm, looking at the definition of Printf.printf it returns a polymorphic type
<ranu>
But it should be okay to use print_endline with print_string as both of them return unit()
<ranu>
Oh, got it
<ranu>
Nevermind xD
<ranu>
string -> unit is different from unit
ranu has quit [Quit: ranu]
spew has quit [Read error: Connection reset by peer]
spew has joined #ocaml
Denommus` has quit [Ping timeout: 246 seconds]
jao has quit [Ping timeout: 240 seconds]
zv has quit [Ping timeout: 268 seconds]
spew has quit [Read error: Connection reset by peer]
FreeBirdLjj has joined #ocaml
caltelt has quit [Ping timeout: 240 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
caltelt has joined #ocaml
zv has joined #ocaml
tsmc has quit [Quit: Connection closed for inactivity]
caltelt_ has joined #ocaml
Rosslaew has joined #ocaml
_whitelogger has joined #ocaml
planigan28 has joined #ocaml
Rosslaew has quit [Ping timeout: 240 seconds]
planigan28 has quit [Remote host closed the connection]
orbifx has joined #ocaml
caltelt has quit [Ping timeout: 240 seconds]
Guest90608 has joined #ocaml
Guest90608 has quit [Remote host closed the connection]
orbifx has quit [Ping timeout: 246 seconds]
sagotch has joined #ocaml
Haudegen has joined #ocaml
def`_ has quit [Quit: leaving]
def` has joined #ocaml
Rosslaew has joined #ocaml
lostman has quit [Quit: Connection closed for inactivity]
fkz12 has joined #ocaml
fkz12 has quit [Remote host closed the connection]
drot9 has joined #ocaml
drot9 has quit [Remote host closed the connection]
bartholin has joined #ocaml
<orbitz>
Is this error an indication of something messed up in my system?
<orbitz>
ocamlfind: [WARNING] You have installed DLLs but the directory /usr/home/orbitz/.opam/4.04.0+flambda/lib/stublibs is not mentioned in ld.conf
<orbitz>
I've never had to modify ld.conf before...
m_v_m has joined #ocaml
m_v_m has quit [Client Quit]
m_v_m has joined #ocaml
<m_v_m>
Hi all. I have to create an container with a lots of ints. Then I have to find and remove a huge part of them. What kind of container would be the perfect choice? Hashtbl?
Fare has quit [Ping timeout: 246 seconds]
<orbitz>
m_v_m: How will you find them?
<_y>
m_v_m, depends how you want to add them (in some specific order? you don’t care?) and how you want to find the elements to be removed (would iterate on elements of your container be enough ?)
<m_v_m>
I would like to add them in order from 1..N. Iterate throught elemets would be not enought in the reason of huge number of elements.
<orbitz>
m_v_m: what's your goal?
Catherine has joined #ocaml
Catherine is now known as Guest34890
mengu has joined #ocaml
<flux[m]>
am I a bad person for hoping that there was a monadic sequencing operation that didn't involve adding >>= fun _ -> after each line?
freyr69 has joined #ocaml
<Leonidas>
flux[m]: You can also prepend `let%bind _ =` instead
<flux[m]>
true, but it's not much better
* Leonidas
wants a `;%bind` operator
<flux[m]>
let%lwt _ = xx in
Rosslaew has quit [Remote host closed the connection]
<flux[m]>
15 characters for just sequencing two things :)
Guest34890 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Catherin_ has joined #ocaml
Catherin_ has quit [Client Quit]
<ZirconiumX>
There's a ;%lwt operator
<ZirconiumX>
Doesn't look very nice, but it's there
<m_v_m>
orbitz: I would like to implement sieve of Erathosthenes for a really huge N.
kakadu has joined #ocaml
<ZirconiumX>
A better approach would be a prime wheel
Rosslaew has joined #ocaml
Catherin_ has joined #ocaml
<m_v_m>
ZirconiumX: Wow thank you. You have right. For really big N prime wheel have O(N) and sieve of Era. O(NloglogN). There is also a version of sieve of Era. with wheel opt. and also there is O(N).
<ZirconiumX>
It does depend what you need to do though
TheLemonMan has joined #ocaml
<_y>
m_v_m, you are right regarding asymptotic complexities, but keep in mind that log log N is essentially a constant
<ZirconiumX>
Big O isn't the full story
<_y>
(log log 2^64 = 6 for base-2 logarithms)
<ZirconiumX>
O(n) beats O(1) if the complexity required for constant time is large
sz0 has joined #ocaml
<_y>
in fact, Eratosthenes (with some optimizations), precisely because it is simple, has a very good (ie. small) constant compared to more elaborate algorithms
<_y>
(according to my own experiments ^^)
sophiya has joined #ocaml
<_y>
(however i have not compared it with the sieve of Atkin yet)
<flux[m]>
ZirconiumX: well it's not worse than the others. thanks! I wonder how I didn't find that myself :-o.
sophiya has quit [Remote host closed the connection]
mengu_ has joined #ocaml
mfp has joined #ocaml
<_y>
m_v_m, you should probably consider the sieve of Atkin, which is also O(N) and is claimed to be the better sieving algorithm nowadays
mengu has quit [Ping timeout: 252 seconds]
<_y>
m_v_m, also, memory is the limiting factor; for large N, you need sieve segmenting (so to answer your initial question, there is no general-purpose container you can use for implementing a prime sieve, you manipulate a datastructure specific to the sieve algorithm)
Catherin_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Catherine has joined #ocaml
Catherine has quit [Client Quit]
Catherine has joined #ocaml
Catherine is now known as Guest82073
thomas_scrace has joined #ocaml
bartholin has quit [Remote host closed the connection]
Haudegen has quit [Remote host closed the connection]
mengu_ has quit [Ping timeout: 240 seconds]
ziyourenxiang has joined #ocaml
FreeBirdLjj has joined #ocaml
Khady has quit [Quit: Quit.]
Khady has joined #ocaml
Khady has joined #ocaml
Khady has quit [Changing host]
pierpal has quit [Read error: Connection reset by peer]
Haudegen has joined #ocaml
thomas_scrace has quit [Ping timeout: 272 seconds]
thomas_scrace has joined #ocaml
silver has joined #ocaml
Guest82073 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mengu has joined #ocaml
Rosslaew_ has joined #ocaml
Rosslaew has quit [Ping timeout: 250 seconds]
jao has joined #ocaml
arahael9 has joined #ocaml
thomas_scrace has quit [Ping timeout: 246 seconds]
arahael9 has quit [Remote host closed the connection]
thomas_scrace has joined #ocaml
caltelt_ has quit [Ping timeout: 240 seconds]
neatonk has quit [Ping timeout: 240 seconds]
Rosslaew_ has quit [Remote host closed the connection]
Rosslaew_ has joined #ocaml
Catherine has joined #ocaml
Catherine is now known as Guest10166
<_y>
is there a way to turn off Merlin for a specific file?
<_y>
it makes my editor unusably slow with my 1200-line file
bronsen has quit [Remote host closed the connection]
bronsen has joined #ocaml
<Drup>
That's weird, are you loading a big library like Core ?
<Drup>
merlin works fine on big files usually
<_y>
i load zarith and containers
<reynir>
What editor are you using?
<_y>
vim
<_y>
hang on, i have to test first that this is not due to my recent config hacks (i suspected merlin because it only happened with ocaml files, but i may be wrong)
<_y>
ok, definitely not Merlin’s fault, sorry
<_y>
aow, hell, now i have to throw random config bits
Rosslaew_ has quit [Remote host closed the connection]
<_y>
okay, so it seems that the culprit was:
<_y>
let g:ocaml_folding = 1
Rosslaew_ has joined #ocaml
<_y>
" ↑ enable code folding (provided by the default, undocumented, OCaml plugin)
<_y>
anyway it was completely broken
r3s1stanc3 has quit [Ping timeout: 272 seconds]
<_y>
by the way, does there exist a working vim plugin for OCaml code folding?
Guest10166 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Catherin_ has joined #ocaml
erkin has joined #ocaml
thomas_scrace has quit [Ping timeout: 245 seconds]
<sagotch>
I have this line in my dun file ` (preprocess (action (run %{bin:cppo} -D API %{input-file})))` and I would like to take the `-D API` part of the dune file (i.e. use something like `API=y dune build` instead`), is it possible?
<sagotch>
off*
thomas_scrace has joined #ocaml
<sagotch>
I use a Makefile + several dune files, and it depends on a ./configure script if API should be defined or not
mengu has quit [Ping timeout: 250 seconds]
Rosslaew_ has quit [Remote host closed the connection]
Rosslaew_ has joined #ocaml
mengu has joined #ocaml
<_y>
i am slightly irritated that half of Merlin’s commands are undocumented
<_y>
documentation, the Nemesis of OCaml people…
<_y>
for one, what is :MerlinDocument supposed to do ?
mengu has quit [Ping timeout: 245 seconds]
mengu has joined #ocaml
gtrak has joined #ocaml
Haudegen has quit [Remote host closed the connection]
gtrak has quit [Ping timeout: 272 seconds]
arlen has joined #ocaml
arlen has quit [Remote host closed the connection]
gtrak has joined #ocaml
Haudegen has joined #ocaml
gtrak has quit [Quit: WeeChat 2.1]
Rosslaew_ has quit [Remote host closed the connection]
Rosslaew_ has joined #ocaml
mengu has quit [Ping timeout: 252 seconds]
Rosslaew_ has quit [Ping timeout: 240 seconds]
Catherin_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mengu has joined #ocaml
ahNael5z has joined #ocaml
mengu_ has joined #ocaml
Catherine has joined #ocaml
Catherine is now known as Guest11340
ahNael5z has left #ocaml [#ocaml]
mengu has quit [Ping timeout: 245 seconds]
mengu_ has quit [Client Quit]
Guest11340 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
Catherin_ has joined #ocaml
Catherin_ has quit [Read error: Connection reset by peer]
Ulrar has quit [Ping timeout: 268 seconds]
Armael has quit [Ping timeout: 260 seconds]
gikiam has quit [Ping timeout: 272 seconds]
gikiam has joined #ocaml
Armael has joined #ocaml
jbrown has joined #ocaml
<companion_cube>
show the doc of the symbol under the cursor
<companion_cube>
is it not on the merlin wiki?
silver_ has joined #ocaml
<reynir>
you can also generate vim help tags for merlin
Denommus has joined #ocaml
silver has quit [Ping timeout: 244 seconds]
<companion_cube>
tbh it'd be nice if merlin had a big README with almost all of the useful doc in it
<rks`>
reynir: but that one is not documented in the vim doc file
<companion_cube>
(or a big readme and a readme.vim, readme.emacs, etc.)
<rks`>
companion_cube: I'm sure if you send a PR the authors will be *happy* to merge it
<companion_cube>
hey I'm not the one complaining about docs here :p
freyr69 has quit [Remote host closed the connection]
pippijn_ is now known as pippijn
pierpal has joined #ocaml
ziyourenxiang has quit [Ping timeout: 246 seconds]
pierpal has quit [Ping timeout: 240 seconds]
<_y>
reynir, i did, :MerlinDocument is NOT documented at all in the vim help file
<_y>
companion_cube, what do i need for this to work? i tried naively inside my dune project, with .merlin config generated by dune, and :MerlinDocument keeps saying me “No documentation available”
<reynir>
Oh, today I found merlin looking in the 4.07.0 switch even though I'm on the 4.05.0+flambda switch
Haudegen has quit [Remote host closed the connection]
<reynir>
I'm not sure why...
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
<companion_cube>
_y: you also need the library that defines this symbol to install the .cmti files, I think
<companion_cube>
dune does it automatically, but there's inertia
Guest16880 has quit [Remote host closed the connection]
thomas_scrace has joined #ocaml
lukky513 has joined #ocaml
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
Xoc16 has joined #ocaml
thomas_scrace has quit [Ping timeout: 240 seconds]
Xoc16 has quit [Remote host closed the connection]
Haudegen has quit [Remote host closed the connection]
Haudegen has joined #ocaml
m_v_m has quit [Quit: WeeChat 2.1]
winnie0 has joined #ocaml
pierpal has quit [Quit: Poof]
winnie0 has quit [Client Quit]
pierpal has joined #ocaml
orbifx has joined #ocaml
jnavila has quit [Remote host closed the connection]
Denommus has quit [Ping timeout: 240 seconds]
thomas_scrace has joined #ocaml
pierpa has joined #ocaml
erkin has quit [Remote host closed the connection]
thomas_scrace has quit [Ping timeout: 240 seconds]
kakadu_ has quit [Remote host closed the connection]
sigaev has joined #ocaml
<sigaev>
Hello everyone. I just started learning ocaml and this is my first exposure to a functional language, so I am not sure how to search for the answer online. Basically, I understand the concept of optionals, Some(string) could be a string or could be nothing. I want to write a polymorphic function that can pattern match on a option. But I would like to describe three cases. Some(string), Some(string * string) and None.
<sigaev>
Is this possible? Thank you very much in advance!
<companion_cube>
no it's not, you need to write another sum type sigaev
<companion_cube>
type 'a opt2 = None | Some1 of 'a | Some2 of 'a * 'a
<companion_cube>
something like that
<dmbaturin>
sigaev: Or wrap another type in option. Some (Left s) | -> ... | Some (Right (s, s')) -> ...
<dmbaturin>
Ignore the first pipe of course. I'm barely awake.
<sigaev>
Thank you! Thats what I thought.
sigaev has quit []
orbifx has quit [Quit: WeeChat 2.1]
tormen_ has quit [Quit: Lost terminal]
tormen has joined #ocaml
<pierpa>
sigaev: there's the ocaml mooc starting in a few days. Seems just right for someone starting.
<pierpa>
ah. they're gone!
tsmc has joined #ocaml
Haudegen has quit [Remote host closed the connection]