rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
azimut has quit [Ping timeout: 246 seconds]
waleee has quit [Ping timeout: 248 seconds]
ursa-major has joined #ocaml
chrisz has quit [Ping timeout: 240 seconds]
chrisz has joined #ocaml
<discocaml>
<jumpnbrownweasel> module type == type class
<discocaml>
<Kali> i was about to explain how that was wrong when i realized the context of the above message 😅 it is truly such an effective way
bartholin has joined #ocaml
midgard has quit [Server closed connection]
midgard has joined #ocaml
brettgilio has joined #ocaml
myrkraverk_ has joined #ocaml
myrkraverk has quit [Read error: Connection reset by peer]
TrillionEuroNote has quit [Ping timeout: 250 seconds]
TrillionEuroNote has joined #ocaml
myrkraverk_ has quit [Read error: Connection reset by peer]
myrkraverk_ has joined #ocaml
dh` has joined #ocaml
dh` has quit [Changing host]
dh` has joined #ocaml
zozozo has quit [Quit: WeeChat 3.5]
zozozo has joined #ocaml
Serpent7776 has joined #ocaml
myrkraverk_ has quit [Read error: Connection reset by peer]
myrkraverk_ has joined #ocaml
dhil has joined #ocaml
yziquel has quit [Quit: Client closed]
rgrinberg has joined #ocaml
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bartholin has quit [Quit: Leaving]
random-jellyfish has joined #ocaml
Anarchos has joined #ocaml
azimut has joined #ocaml
dnh has joined #ocaml
Anarchos has quit [Ping timeout: 252 seconds]
mro has joined #ocaml
Anarchos has joined #ocaml
mro has quit [Quit: Leaving]
<toastal>
Newb Q: If I make a subtype with module Foo = Set.Make(struct … ), how would I get its type in the *.mli file?
<toastal>
I need my Foo.t, for another type, but I don’t know how to get it.
<toastal>
Seems I can’t use foo Set.t either?
yziquel has joined #ocaml
waleee has joined #ocaml
yziquel has quit [Ping timeout: 245 seconds]
<Anarchos>
toastal ocamlc -i
<Anarchos>
toastal ocamlc -i file.ml > file.mli
<toastal>
I get a lot of errors as I have my mli file mostly done & the packages aren’t on my path (using nix build)
<Anarchos>
use ocamlfind or the 'ocamlc -I' option to find your packages
* Anarchos
never did nix build
<toastal>
Will I need to include all functions on the Set module?
<toastal>
Is there not some `extend` keyword or otherwise?
<toastal>
Ah, so Set is a Functor
<Anarchos>
toastal you can use 'open module' or 'include module'
<toastal>
Or rather, Set.Make is a Functor
<Anarchos>
to just open or import all the values of 'module' in your own module
<toastal>
That’s not making any sense for me.
<toastal>
I don’t yet have the vocab to know what to ask that well
<discocaml>
<andreypopp> toastal: module MySet : Set.S with type elt = int
<toastal>
Does that imply I can do type foo = { bar: Set.S with type elt = baz; }?
<toastal>
…’cause it gives me a syntax error @ `with`
<discocaml>
<Et7f3 (@me on reply)> No it is a module type
<toastal>
module type?
<discocaml>
<darrenldl> following andreypopp's message, the type for the set would then be MySet.t
<toastal>
let me check because I think something is missing in the framing of the question.
<toastal>
Unbound module MySet
<discocaml>
<._null._> If the type in your anonymous module has a name <t>, then `Set.Make (struct type t = <t> let compare = _ end) : Set.S with type elt = <t>`
<toastal>
If I `Set.Make` in my *.ml file, then I don’t have access in the *.mli file, no?
bibi_ has joined #ocaml
<discocaml>
<._null._> If it doesn't, there is no short signature for it
<discocaml>
<._null._> Access in what sense ?
<toastal>
hmm… .ml reads types from .mli, yes? It doesn’t go both ways.
<toastal>
If I make a type in .ml, .mli needs to have already known of its existence
<discocaml>
<._null._> It goes zero ways, the compiler checks ml contents against mli after both are read
<toastal>
Interesting :)
<discocaml>
<._null._> It does imply that types have to be written twice
<toastal>
Did not know. I’ve tried reading documentation on modules & it’s been mostly confusing so going the try-things-and-watch-them-break route.
<discocaml>
<darrenldl> give cs3110 book a shot maybe
<toastal>
aside: is there a “type hole” character I should know about?
<toastal>
like `?` or `_`?
<discocaml>
<._null._> Holes are usually `_` in OCaml, but what context are you thinking about ?
<toastal>
Either on the term level or type level
<toastal>
I mean in the way that the compiler will spit out the type of the hole
<toastal>
Ah, I figured that out now. Thanks, andreypopp
<discocaml>
<._null._> You will need merlin to give you the type of a typed hole, but they are generally recognised as such
Anarchos has quit [Ping timeout: 255 seconds]
azimut has quit [Remote host closed the connection]
azimut has joined #ocaml
bibi_ has quit [Ping timeout: 245 seconds]
rgrinberg has joined #ocaml
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dhil has quit [Ping timeout: 255 seconds]
waleee has quit [Ping timeout: 252 seconds]
waleee has joined #ocaml
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
waleee has quit [Ping timeout: 252 seconds]
dnh has joined #ocaml
mro has joined #ocaml
bartholin has joined #ocaml
bibi_ has joined #ocaml
bartholin has quit [Quit: Leaving]
mro has quit [Quit: Leaving]
mro has joined #ocaml
omegatron has joined #ocaml
Anarchos has joined #ocaml
bartholin has joined #ocaml
John_Ivan has quit [Read error: Connection reset by peer]
John_Ivan has joined #ocaml
bartholin has quit [Quit: Leaving]
Anarchos has quit [Ping timeout: 245 seconds]
rgrinberg has joined #ocaml
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dnh has joined #ocaml
random-jellyfish has quit [Quit: Client closed]
Tuplanolla has joined #ocaml
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Hammdist has quit [Quit: Client closed]
Hammdist has joined #ocaml
mro has quit [Quit: Leaving]
waleee has joined #ocaml
dhil has joined #ocaml
xmachina has quit [Server closed connection]
waleee has quit [Ping timeout: 255 seconds]
xmachina has joined #ocaml
waleee has joined #ocaml
<discocaml>
<Et7f3 (@me on reply)> Or just put a false type and see compiler error
rom1504 has quit [Ping timeout: 240 seconds]
rom1504 has joined #ocaml
rgrinberg has joined #ocaml
<discocaml>
<deepspacejohn> That's the trick I use whenever I need to quickly print something's type. `let something: int = blah`
Hammdist has quit [Quit: Client closed]
bartholin has joined #ocaml
<discocaml>
<regularspatula> Is there any general guides (or folklore, tips, tricks) for tuning ocaml GC? The context is programs that need large amounts of ram
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
mro has joined #ocaml
mro has quit [Client Quit]
mro has joined #ocaml
mro has quit [Client Quit]
Hammdist has joined #ocaml
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
waleee has quit [Ping timeout: 252 seconds]
waleee has joined #ocaml
TrillionEuroNote has quit [Ping timeout: 252 seconds]
TrillionEuroNote has joined #ocaml
bibi_ has quit [Ping timeout: 255 seconds]
bibi_ has joined #ocaml
TrillionEuroNote has quit [Ping timeout: 255 seconds]
waleee has quit [Ping timeout: 255 seconds]
waleee has joined #ocaml
TrillionEuroNote has joined #ocaml
<discocaml>
<Et7f3 (@me on reply)> Have you see that bottleneck is gc ? Have you considered switching data structure/ compact them ? Inline them (mutable ref can just be a mutable field)
masterbuilder has quit [Server closed connection]
masterbuilder has joined #ocaml
<discocaml>
<regularspatula> Yes in some cases it’s gc bottleneck. Though it’s slightly theoretical question as well. And I hear you about changing ways structures or representations being preferable
<discocaml>
<regularspatula> Mainly just looking for any info on something tunable
<discocaml>
<regularspatula> Without rewriting anything
<discocaml>
<regularspatula> Eg I have server access with multiple terabyte ram, my programs are using only like a quarter of that, would there be a benefit to messing around with gc params or heap sizes or something like that to get some better performance without really touching the code much
yziquel has joined #ocaml
TrillionEuroNote has quit [Ping timeout: 252 seconds]
TrillionEuroNote has joined #ocaml
waleee has quit [Ping timeout: 252 seconds]
yziquel has quit [Quit: Client closed]
<discocaml>
<jumpnbrownweasel> You may find it hard to get advice when you don't know of a problem. Usually best to measure/profile first, then tune.
<discocaml>
<regularspatula> Granted, but someone may still know of a good resource other than the GC chapter of real world ocaml potentially
<discocaml>
<regularspatula> Or just have experience worth reading about regarding tuning programs that use a lot of memory
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
waleee has joined #ocaml
waleee has quit [Ping timeout: 245 seconds]
waleee has joined #ocaml
dhil has quit [Ping timeout: 245 seconds]
MarvelousWololo has joined #ocaml
Serpent7776 has quit [Ping timeout: 252 seconds]
<discocaml>
<Et7f3 (@me on reply)> Have you seen Gc.set that customise parameters at runtime
<discocaml>
<regularspatula> I have, but only really in the context of the real world ocaml chapter on gc (ie haven't really messed with it too much)
<discocaml>
<regularspatula> @et7f3
bartholin has quit [Quit: Leaving]
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
waleee has quit [Ping timeout: 255 seconds]
amk has quit [Ping timeout: 240 seconds]
Tuplanolla has quit [Quit: Leaving.]
amk has joined #ocaml
azimut has quit [Ping timeout: 246 seconds]
waleee has joined #ocaml
MarvelousWololo has quit [Read error: Connection reset by peer]
<technomancy>
anyone know why the 3110 book doesn't seem to mention hash tables until near the end of the book?
<discocaml>
<jumpnbrownweasel> just a guess: because Hashtabl is a mutable data structure, and they're trying to teach pure functional programming first?
<discocaml>
<jumpnbrownweasel> just a guess: because Hashtbl is a mutable data structure, and they're trying to teach pure functional programming first?
<technomancy>
yeah, I guess that kinda makes sense but you'd expect them to cover Map then instead
<technomancy>
but instead they just have a little blurb about association lists; it's weird
<technomancy>
I haven't tried using it in ocaml but in every other language I've used association lists are a pain in the neck