ChanServ changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.02.1 announcement at http://ocaml.org/releases/4.02.html | Public channel logs at http://irclog.whitequark.org/ocaml
eyyub2 has joined #ocaml
ebzzry has quit [Remote host closed the connection]
lambdahands has joined #ocaml
jonludlam has quit [Ping timeout: 255 seconds]
jonludlam has joined #ocaml
eyyub2 has quit [Ping timeout: 244 seconds]
tane has quit [Quit: Verlassend]
Simn has quit [Quit: Leaving]
thomasga has quit [Quit: Leaving.]
thomasga has joined #ocaml
skinkitten has quit [Quit: Leaving]
thomasga has quit [Quit: Leaving.]
lambdahands has quit [Ping timeout: 264 seconds]
chouser has quit [Ping timeout: 245 seconds]
sdegutis has joined #ocaml
<sdegutis> Do people ever match on a boolean and handle cases true and false with | instead of using if?
<Drup> occasionally (when the bool is nested, for example)
<sdegutis> ok thx
zwer_e is now known as zwer
enitiz has quit [Remote host closed the connection]
mcc has joined #ocaml
chouser has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mcc has quit [Quit: This computer has gone to sleep]
<sdegutis> I'm on chapter 3 :)
<sdegutis> Lists and Patterns!
ousado has joined #ocaml
reem has quit [Remote host closed the connection]
<sdegutis> blech, that was boring; chapter 4 time
lordkryss has quit [Quit: Connection closed for inactivity]
lu324_ has joined #ocaml
adrien_znc_ has joined #ocaml
contempt has quit [Ping timeout: 255 seconds]
<chouser> If I'm defining a parameterized module (is that a functor?) does it have to be declared using 'sig' first?
jerith_ has joined #ocaml
contempt has joined #ocaml
asmanur_ has joined #ocaml
rks`_ has joined #ocaml
ousado_ has joined #ocaml
alinab_ has joined #ocaml
<Drup> no
jneen_ has joined #ocaml
binarybi1me has joined #ocaml
companion_square has joined #ocaml
oskarth_ has joined #ocaml
darkf has joined #ocaml
<chouser> ok, so something like this should work: module MalType : (Param) = struct ...use Param in here... end
<Drup> remove the ":"
lnich_ has joined #ocaml
<chouser> without the : I get a syntax error at the open paren
<chouser> I'll post the whole file here in a few, just want to get it cleaned up a bit.
ousado has quit [*.net *.split]
sdegutis has quit [*.net *.split]
psy_ has quit [*.net *.split]
lnich has quit [*.net *.split]
lu324 has quit [*.net *.split]
so has quit [*.net *.split]
jerith has quit [*.net *.split]
PM has quit [*.net *.split]
asmanur has quit [*.net *.split]
alinab has quit [*.net *.split]
companion_cube has quit [*.net *.split]
zapu has quit [*.net *.split]
oskarth has quit [*.net *.split]
jneen has quit [*.net *.split]
adrien_znc_ is now known as adrien_znc
<Drup> chouser: the complete syntax is "module MyFunctor (Foo : Foo_Sig) = ...."
oskarth_ is now known as oskarth
<chouser> ah, ok, thanks. ...progress...
PM has joined #ocaml
zapu has joined #ocaml
mcclurmc has joined #ocaml
psy_ has joined #ocaml
bacam_ has joined #ocaml
dbrumley_ has joined #ocaml
blech__ has joined #ocaml
dmiles_afk has joined #ocaml
hsuh_ has joined #ocaml
Pepe__ has joined #ocaml
<chouser> ok, this is what I have so far. Not quite right, but I hope the intention is clear: https://gist.github.com/anonymous/d7c3d2893d0b6b7df6e4
sdegutis_ has joined #ocaml
<sdegutis_> Wait, you can't do dot-syntax for method calls on types?
<sdegutis_> Like, list.take 3 ?
Reventlov has quit [Ping timeout: 264 seconds]
<Drup> 1) List.take is a function, so it's not a method 2) no
<Drup> chouser: for recursive modules, you need to give all the types
so has joined #ocaml
Tekk_ is now known as 17SABKG2H
Tekk_ has joined #ocaml
terry852 has joined #ocaml
<chouser> Drup: What type did I leave out?
Tekk_ is now known as Guest91880
<Drup> chouser: the modules' types
eikke_ has joined #ocaml
englishm_ has joined #ocaml
<chouser> Sorry, I still don't understand. Map.Make just needs an OrderedType, and MalImpl is one, having been instantiated with MalMap.
<chouser> OrderedType needs a compare and a t, which are both there.
IbnFirnas has quit [Ping timeout: 244 seconds]
dbrumley has quit [Ping timeout: 244 seconds]
bacam has quit [Ping timeout: 244 seconds]
Intensity has quit [Ping timeout: 244 seconds]
cojy has quit [Ping timeout: 244 seconds]
Pepe_ has quit [Ping timeout: 244 seconds]
17SABKG2H has quit [Ping timeout: 244 seconds]
englishm has quit [Ping timeout: 244 seconds]
mcclurmc_ has quit [Ping timeout: 244 seconds]
hsuh has quit [Ping timeout: 244 seconds]
burgobianco has quit [Ping timeout: 244 seconds]
dmiles has quit [Ping timeout: 244 seconds]
blech_ has quit [Ping timeout: 244 seconds]
eikke has quit [*.net *.split]
cojy_ has joined #ocaml
burgobianco has joined #ocaml
<Drup> chouser: no, it's a limitation of recursive modules
Reventlov has joined #ocaml
<Drup> you need to annotate the types for all the modules in a "module rec" group
acieroid` has joined #ocaml
flx has joined #ocaml
flx_ has joined #ocaml
Intensity has joined #ocaml
IbnFirnas has joined #ocaml
IbnFirnas has quit [Changing host]
IbnFirnas has joined #ocaml
leifw_ has joined #ocaml
maurer_ has joined #ocaml
orbitz_ has joined #ocaml
hsuh has joined #ocaml
frankjea1er has joined #ocaml
hcarty_ has joined #ocaml
siddhart1v_away has joined #ocaml
gargawel_ has joined #ocaml
ohama has quit [Disconnected by services]
ygu has joined #ocaml
c74d3 has joined #ocaml
ohama has joined #ocaml
<chouser> not getting it. Could you provide an example?
fds_ has joined #ocaml
stux|away has joined #ocaml
relrod_ has joined #ocaml
Reventlov has quit [Ping timeout: 246 seconds]
relrod_ has quit [Remote host closed the connection]
SuperNoeMan_ has joined #ocaml
hsuh_ has quit [*.net *.split]
PM has quit [*.net *.split]
nullcat has quit [*.net *.split]
orbitz has quit [*.net *.split]
myyst has quit [*.net *.split]
rwmjones has quit [*.net *.split]
siddharthv_away has quit [*.net *.split]
acieroid has quit [*.net *.split]
fds has quit [*.net *.split]
dbp has quit [*.net *.split]
c74d has quit [*.net *.split]
strmpnk has quit [*.net *.split]
leifw has quit [*.net *.split]
teiresias has quit [*.net *.split]
tcpc has quit [*.net *.split]
SuperNoeMan_ is now known as SuperNoeMan
flx_ is now known as flux
dwoos has joined #ocaml
Reventlov has joined #ocaml
relrod_ has joined #ocaml
myyst has joined #ocaml
Drup has joined #ocaml
relrod_ is now known as relrod
teiresias has joined #ocaml
q66 has quit [Quit: Leaving]
strmpnk has joined #ocaml
tcpc has joined #ocaml
leifw_ is now known as leifw
srax has joined #ocaml
q66 has joined #ocaml
<Drup> the type error is pretty clear :)
hbar has joined #ocaml
majoh has joined #ocaml
PM has joined #ocaml
<chouser> Heh, maybe to you.
<chouser> ohhh....
Guest91880 is now known as Tekk_`
<chouser> so confused. Ok, so I tried just "OT.t" instead of "t OT.t", and now it's complaining about line 18 again. I don't know if that means I fixed that problem, or make something else worse.
rwmjones has joined #ocaml
cartwright has joined #ocaml
<Drup> "MalType" is a functor, not a module type, you can't use it like that
<Drup> you need to define a module type that correspond to the result of the application of the MalType functor
ente has joined #ocaml
ente has quit [Changing host]
ente has joined #ocaml
<chouser> ok, I think I understand, thanks.
dbp has joined #ocaml
rfv has quit [Ping timeout: 245 seconds]
msch has quit [Read error: Connection reset by peer]
cojy_ has quit [Ping timeout: 276 seconds]
Averell has quit [Ping timeout: 250 seconds]
msch has joined #ocaml
Averell has joined #ocaml
Tekk_` is now known as Tekk_
cojy_ has joined #ocaml
rfv has joined #ocaml
uberboy has joined #ocaml
enitiz has joined #ocaml
oriba_ has quit [Quit: Verlassend]
uberboy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
chouser has quit [Ping timeout: 245 seconds]
jneen has joined #ocaml
pdewacht_ has joined #ocaml
maurer has joined #ocaml
rks` has joined #ocaml
jonludla` has joined #ocaml
<sdegutis_> chouser was here?
<sdegutis_> ha
j0sh_ has joined #ocaml
keen__________41 has quit [Ping timeout: 415 seconds]
moviuro has quit [Ping timeout: 415 seconds]
adrien has quit [Read error: Connection reset by peer]
maurer_ has quit [Ping timeout: 628 seconds]
jneen_ has quit [Ping timeout: 628 seconds]
rks`_ has quit [Ping timeout: 628 seconds]
jonludlam has quit [Ping timeout: 628 seconds]
pdewacht has quit [Ping timeout: 628 seconds]
moviuro has joined #ocaml
j0sh has quit [Ping timeout: 628 seconds]
keen__________41 has joined #ocaml
chouser has joined #ocaml
adrien has joined #ocaml
antkong has joined #ocaml
Averell has quit [Changing host]
Averell has joined #ocaml
q66 has quit [Quit: Leaving]
lambdahands has joined #ocaml
antkong has quit [Ping timeout: 245 seconds]
psy_ has quit [Read error: No route to host]
psy has joined #ocaml
lambdahands has quit [Ping timeout: 276 seconds]
sdegutis_ has quit [Quit: Leaving...]
AlexRussia has quit [Ping timeout: 272 seconds]
AlexRussia has joined #ocaml
ontologiae has joined #ocaml
badkins has quit []
<chouser> Ok, really close now. Drup, you're help has been very valuable.
<chouser> Now I need to figure out how to refer to the variant types, if that's what they're called.
<chouser> I'm getting File "types.ml", line 22, characters 4-14: Error: Unbound constructor MalVal.Nil: https://gist.github.com/Chouser/38e5207a4a096a5f363e
ontologiae has quit [Ping timeout: 276 seconds]
alpen has joined #ocaml
<chouser> I thought that since MalVal was no longer abstract, its constructors would be available.
jao has quit [Ping timeout: 246 seconds]
<Drup> so, the issue here is that you made the construct back abstract when constraining the type of MalVal to Map.OrderedType
<Drup> because, in Map.OrderedType, the type t is abstract
<Drup> you need to give another module type where the type t is not abstract
<chouser> So MalVal does satisfy OrderedType, which is why that part is not an error. But OrderedType is too general (t is abstract) so I lost there the specific type of t that is actually defined in MakeVal. Is that right?
BitPuffin has quit [Ping timeout: 264 seconds]
<Drup> yes
<chouser> whew. Ok, so I can't cheat and use Map.OrderedType. I need my own sig that is very similar, but has all those variant constructors in it.
<chouser> ...in order to make t be the right concrete type.
<chouser> But the types of the variant constructors are based on with_meta which is based on the module parameter. I don't see how this can possibly be described in a concrete sig.
<chouser> Ah, I can just say "type 'a with_meta" and not say *what* with_meta really is. That gets me most of the way.
<chouser> aaand by pulling the other reference to MapType.t on line 8 out into another type alias, I've got it working.
<chouser> Thanks again, Drup, you're fantastic.
<chouser> I updated the gist, in case anyone cares: https://gist.github.com/Chouser/38e5207a4a096a5f363e
<Drup> :)
chouser has quit [Ping timeout: 240 seconds]
vodkaInf1rno has quit [Quit: leaving]
vodkaInferno has joined #ocaml
vodkaInferno has quit [Client Quit]
vodkaInferno has joined #ocaml
anemator has joined #ocaml
chouser has joined #ocaml
anemator has quit [Client Quit]
vodkaInferno has quit [Quit: leaving]
vodkaInferno has joined #ocaml
chouser has quit [Quit: Leaving.]
vodkaInferno has quit [Quit: leaving]
vodkaInferno has joined #ocaml
jerith_ is now known as jerith
vodkaInferno has quit [Quit: leaving]
vodkaInferno has joined #ocaml
AlexRussia has quit [Quit: WeeChat 1.1-dev]
AlexRussia has joined #ocaml
MercurialAlchemi has joined #ocaml
slash^ has joined #ocaml
testcocoon has quit [Quit: Coyote finally caught me]
testcocoon has joined #ocaml
enitiz has quit [Ping timeout: 276 seconds]
ggole has joined #ocaml
vanila has joined #ocaml
<Tekk_> how do you check if a hashtable contains a certain entry?
<Tekk_> I have a function that kinda works
<Tekk_> but because the function returns a bool it then infers that '_b in the hashbatle is a bool...
<Tekk_> hashtable*
tane has joined #ocaml
<blech__> caml.inria.fr/pub/docs/manual-ocaml/libref/Hashtbl.html
<blech__> doesn't mem do what you're asking?
<Tekk_> huh..
<Tekk_> I never would've looked for it under that name
<Tekk_> (and didn't)
<blech__> it's pretty common
<blech__> List.mem is the same
MercurialAlchemi has quit [Ping timeout: 272 seconds]
<blech__> (mem)bership
<Tekk_> mhm
ousado_ has quit [Ping timeout: 246 seconds]
elfring has joined #ocaml
alpen has quit [Remote host closed the connection]
antkong has joined #ocaml
chinglish has joined #ocaml
reem has joined #ocaml
reem has quit [Remote host closed the connection]
reem has joined #ocaml
<flux> tekk_, btw, the reason why your function dosen't work is that you are first cathing Not_found, if risen, and then some other exception
reem has quit [Remote host closed the connection]
<flux> but in other cases you just erturn what Hashtbl.find returns
reem has joined #ocaml
<flux> so you should write it like: try ignore (Hastbl.find htbl key); true with Not_found -> false
<ggole> Hashtbl.mem does that...
<flux> because you actually don't care about the return value; if it returns at all, you return 'true'
<flux> ggole, I realize that but wouldn't it be great for one to understand why the posted code doesn't work?-)
<Tekk_> mhm
<Tekk_> thanks flux
<Tekk_> right now I've moved onto a module scoping mystery..
<ggole> Oh, OK
<flux> there is actually a new syntax I would rather use in similar case: match Hashtbl.find htbl key with exception Not_found -> false | _ -> true
reem has quit [Ping timeout: 256 seconds]
<Tekk_> found my issue, just need to fix it..
<Tekk_> So why is it that a function isn't allowed to access the members of a struct defined in a module when that struct isn't explicitly declared in the function declaration? like module Test = struct type t = {x:int} end;; let func thing = Printf.printf "%d\n" thing.x
<Tekk_> it says that there's no such struct member x
<Tekk_> record, sorry :)
* Tekk_ has been jumping between C and ocaml today
<Tekk_> where if you declare it with let func : Test.t -> unit = func thing -> Printf.printf "%d\n" thing.x it lets you go with a warning
<Tekk_> I would've figured that as long as the type and its contents are present in the module signature it'd be fair game
<Tekk_> but the signature thing doesn't seem to help if you declare it as part of the signature as a model
Hannibal_Smith has joined #ocaml
<flux> tekk_, you need to use thing.Test.x
<Tekk_> huh
<flux> or the way you noticed
<flux> you can also use: let func (thing : Test.t) = ..
<Tekk_> why is that?
<flux> the thing is, you could easily have a local record with field x
<Tekk_> I'd kinda noticed it earlier in having to declare it as {Test.x=} in other stuff
<Tekk_> mhm
<flux> but ocaml needs to know which record type you are accesing
<Tekk_> but why doesn't it know that from the type of thing?
<Tekk_> if I declared it in the sig
<Tekk_> that was the thing that really tripped me up
<flux> well, it's in another module
<flux> let's say I have code: module A = struct type t = { x : int } end module B = struct type t = { x : string} end let get_x t = t.x
<flux> what is the type of argument 't' for get_x?
<flux> so you need to use some way to disambiguate. let get_x (t : A.t) = t, or let get_x x = t.A.x, or let get_x x = let open A in x, or let get_x x = A.(x), or let get_x : B.t -> _ = fun t -> t.x
<flux> (the second way (t.A.x) is the oldest way ocaml has supported)
<flux> you can just disable the warning 40 if you want to use the way #1 or #5 :)
<Tekk_> flux: sorry, was working on getting this to work
<Tekk_> I completely understand it in the case of declaring it outside of the modules and without a type annotation
<Tekk_> but why doesn't the type annotation in the module signature do? Like putting get_x in module B with a signature declaring it as A.t -> int
<flux> tekk_, ah, I didn't realize that you referred to that. I think it's because the implementation is only checked to match the interface afterwards.
tanguy` has joined #ocaml
<flux> perhaps this behavior could be changed in the future, and perhaps it should be.
<flux> the whole t.x (without needing t.A.x or scoping tricks) is relatively new feature altogether in OCaml
Simn has joined #ocaml
demonimin has quit [Remote host closed the connection]
Haudegen has quit [Ping timeout: 246 seconds]
<Tekk_> one more thing before I finally sleep. not a big one
<Tekk_> is it possible to have a variant type which means "any of the other variants"?
<Tekk_> or or them together
<Tekk_> actually that may be it..
* Tekk_ tests
Haudegen has joined #ocaml
<ggole> With polymorphic variants, yes
antkong has quit [Ping timeout: 244 seconds]
<Tekk_> hm
<Tekk_> not seeing how it fits in my particular case
<Tekk_> I'll try to explain and then if not try again in the morning, given that it's 5:30
<Tekk_> so I'm doing an sdl binding, and for a higher level thing I have event bindings on keys. You register for a key+modkey and your function is called whenever that happens. modkey is a variant with things like Ctrl | Alt | Shift, etc.
<Tekk_> it'd be nice to define an Any modkey, so that no matter what modkeys (if any) are pressed when the key is pressed, you get called
<Tekk_> would that be like..
<Tekk_> `ModAny of modkey ?
<Tekk_> assuming that modkey is the variant name
nopenope has joined #ocaml
<Tekk_> hm, no
<ggole> You can match any constructor easily enough
<ggole> But there's no way to make a named abstraction over constructors yet
<Tekk_> alright, and that's what I was looking for
<ggole> An alternative is to define, say, a record { modifier : modifier; any_mod : bool; } which explicitly stores what you want
<Tekk_> still a bit hairy since it's being used as a key for a hash
<ggole> It should be fine for that.
<Tekk_> but I could define my own hash and then use a custom compare for it I suppose
<Tekk_> would it?
<ggole> Yep.
<Tekk_> how does that work? O.o
<ggole> Hash tables work using structural hash and comparison by default
<Tekk_> exactly
<ggole> eg, look at all the parts
nopenope has left #ocaml ["Konversation terminated!"]
<Tekk_> so if I put in a modifier: ModNone and any_mod: true
<Tekk_> and I receive modifier: ModShift and anymod: true
<Tekk_> it'll still compare wrong
<ggole> That would be a badly formed value
<ggole> Yeah, gotta avoid those.
<Tekk_> how so to the badly formed?
<Tekk_> the entire point of the Any modifier is that it's considered to be true whether it's ModNone, ModShift, ModCtrl, etc.
<ggole> Er?
<ggole> I must have misunderstood.
<Tekk_> ah, okay
<ggole> I thought you wanted a bit of information that indicated that one of the modifiers was on (don't care which one)
<Tekk_> oh no
<Tekk_> I want to indicate that I don't care what modifier it is :)
<Tekk_> or if there's none
<ggole> I'd just make a case for that then
<Tekk_> which would be writing my own compare: if event.scancode = table.scancode then (if table.modifier = Any then true else table.modifier = event.modifier) else false
<Tekk_> approximately
<Tekk_> like I said, not a big deal, just something else to add to the list if I think it's worth it
<ggole> Right.
<Tekk_> and now I should probably sleep since it's nearly 6 am
<Tekk_> night and thanks for all the help ggole
<ggole> o/
lordkryss has joined #ocaml
chinglish has quit [Ping timeout: 245 seconds]
chinglish has joined #ocaml
mobajm has joined #ocaml
bacam_ is now known as bacam
Thooms has joined #ocaml
aluuu has joined #ocaml
MercurialAlchemi has joined #ocaml
chinglish has quit [Ping timeout: 245 seconds]
companion_square is now known as companion_cube
chinglish has joined #ocaml
justinfront has joined #ocaml
zwer_w has joined #ocaml
zwer has quit [Ping timeout: 250 seconds]
AeroNotix has joined #ocaml
<AeroNotix> hello all
<AeroNotix> http://www.ocamljava.org/installation/ attempting this on Linux. I get quite far along in the installation process but then it fails with https://gist.github.com/AeroNotix/182e2e1d3ccc06f82a18
<AeroNotix> I can't seem to see anything related to dllunix in the OCaml libs, so I assume I need to install some library or whatnot.
skinkitten has joined #ocaml
uberboy has joined #ocaml
Thooms has quit [Ping timeout: 265 seconds]
tane has quit [Quit: Verlassend]
ousado_ has joined #ocaml
ousado_ is now known as ousado
ousado has quit [Changing host]
ousado has joined #ocaml
justinfront has quit [Ping timeout: 276 seconds]
justinfront has joined #ocaml
ingsoc has joined #ocaml
tanguy` has quit [Ping timeout: 265 seconds]
darkf_ has joined #ocaml
darkf has quit [Ping timeout: 245 seconds]
antegallya has joined #ocaml
rand000 has joined #ocaml
ebzzry has joined #ocaml
mearnsh has quit [Ping timeout: 272 seconds]
mearnsh has joined #ocaml
justinfront has quit [Ping timeout: 265 seconds]
ingsoc has quit [Quit: Leaving.]
justinfront has joined #ocaml
aluuu has quit [Ping timeout: 264 seconds]
<MercurialAlchemi> AeroNotix: at a guess, the ocamljava version you got requires a version of ocaml more recent than the one you have installed
<MercurialAlchemi> AeroNotix: you'd probably run into less trouble with opam
raphaelss has joined #ocaml
BitPuffin has joined #ocaml
Rebelion has joined #ocaml
raphaelss has left #ocaml [#ocaml]
chris2 has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 246 seconds]
justinfront has quit [Ping timeout: 264 seconds]
ontologiae has joined #ocaml
enitiz has joined #ocaml
skinkitten has quit [Ping timeout: 245 seconds]
justinfront has joined #ocaml
enitiz has quit [Ping timeout: 244 seconds]
skinkitten has joined #ocaml
enitiz has joined #ocaml
q66 has joined #ocaml
antegallya1 has joined #ocaml
antegallya has quit [Read error: Connection reset by peer]
enitiz has quit [Ping timeout: 276 seconds]
struktured has quit [Ping timeout: 245 seconds]
mobajm_ has joined #ocaml
<pippijn> has anybody tried running ocaml on low memory platforms, before?
<pippijn> as in, 2mb
<adrien_znc> for the whole system or?
<adrien_znc> is there a kernel or is this bare metal?
<pippijn> 2mb free memory
mobajm has quit [Ping timeout: 264 seconds]
<pippijn> there is a linux kernel and OS
<adrien_znc> sounds doable if you tweak the GC settings
chouser has joined #ocaml
<pippijn> okay
struktured has joined #ocaml
Thooms has joined #ocaml
tanguy` has joined #ocaml
<pippijn> https://paste.xinu.at/beDF/ <- these are my build rules for ocaml compilation (no linking, no C code, etc.)
<chinglish> !doge
<pippijn> any general advice on the ocaml code itself? do I have unnecessary complexity?
Kakadu has joined #ocaml
zwer_w is now known as zwer
<struktured> looking for a small stats library to do things like sample from a gaussian distribution. ideally it's alread yin opam and is not a binding. any recommendations?
Hannibal_Smith has quit [Quit: Leaving]
justinfront has quit [Ping timeout: 276 seconds]
justinfront has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
slash^ has joined #ocaml
ingsoc has joined #ocaml
darkf_ has quit [Ping timeout: 245 seconds]
aluuu has joined #ocaml
thomasga has joined #ocaml
IbnFirnas has quit [Read error: Connection reset by peer]
ggherdov has quit [Ping timeout: 272 seconds]
justinfront has quit [Ping timeout: 246 seconds]
tane has joined #ocaml
tnguyen1 has joined #ocaml
tnguyen has quit [Ping timeout: 246 seconds]
struktured has quit [Ping timeout: 256 seconds]
ggherdov has joined #ocaml
MercurialAlchemi has joined #ocaml
thomasga has quit [Quit: Leaving.]
thomasga has joined #ocaml
IbnFirnas has joined #ocaml
terry852 has quit [Ping timeout: 240 seconds]
struktured has joined #ocaml
smtb has joined #ocaml
<smtb> Does anybody use ltrace?
<whitequark> I've used ltrace a few times
<smtb> Does anybody use #trace?
<ggole> Occasionally
<smtb> Basically I have a thread that gets hung up on some with an error that I have too many fds open. I was told to use ltrace but im not sure how to use it.
<smtb> Sorry meant to ask does it work similarly to #trace.
<ggole> You mean strace, or ltrace?
<smtb> ltrace.
<adrien_znc> strace sounds better
<smtb> How does strace work? I have only used #trace in the toplevel.
<adrien_znc> but you don't get a backtrace
<adrien_znc> ah
<adrien_znc> #trace and strace and ltrace are _very_ different
<adrien_znc> are you always working on the toplevel?
<ggole> Because strace -e trace=desc is probably roughly what you want
<smtb> I would like to debug in the toplevel if possible but it is not necessary.
<smtb> I really just need to find where I am leaking fds.
<adrien_znc> I'd do something like:
<adrien_znc> strace -f -e trace=open ./your_executable
<adrien_znc> which is roughly the same as ggole's trace=desc
<adrien_znc> basically it will show you each open() syscall performed
<ggole> If you are working with the unix module and suspect that is the source of the leak, #trace Unix.openfile #trace Unix.close *might* be helpful
<ggole> But there are other ways than that of opening an fd
<adrien_znc> you can you can run that to get an idea of how this works: LANG=C strace -f -e trace=open cat /dev/null
<smtb> ok thanks, I will try this
chinglish has quit [Quit: Nettalk6 - www.ntalk.de]
rock_neurotiko has joined #ocaml
fds_ is now known as fds
rock_neurotiko has quit [Remote host closed the connection]
<smtb> So I see a bunch of opens but no closes. Should I see closes?
<adrien_znc> no
<adrien_znc> try
<adrien_znc> -e trace=open,close
<adrien_znc> smtb: ^
<adrien_znc> open() returns a file descriptor which is an int and that's what is passed to close()
yaewa has joined #ocaml
<smtb> Is the best way to proceed to allow the process to get to the point where it hangs?
<ggole> If you see many opens without closes, you are seeing your leak
chris2 has quit [Quit: trotz alledem!]
<adrien_znc> smtb: yes
chris2 has joined #ocaml
moei has quit [Ping timeout: 276 seconds]
enitiz has joined #ocaml
Tekk_` has joined #ocaml
mobajm__ has joined #ocaml
frankjeager has joined #ocaml
SuperNoeMan_ has joined #ocaml
j0sh has joined #ocaml
ggole_ has joined #ocaml
ousado_ has joined #ocaml
rks`_ has joined #ocaml
natrium1970 has joined #ocaml
stux has joined #ocaml
hsuh_ has joined #ocaml
mobajm_ has quit [Ping timeout: 240 seconds]
ousado has quit [Ping timeout: 240 seconds]
Tekk_ has quit [Ping timeout: 240 seconds]
ggole has quit [*.net *.split]
j0sh_ has quit [*.net *.split]
rks` has quit [*.net *.split]
SuperNoeMan has quit [*.net *.split]
stux|away has quit [*.net *.split]
frankjea1er has quit [*.net *.split]
hsuh has quit [*.net *.split]
so has quit [*.net *.split]
SuperNoeMan_ is now known as SuperNoeMan
<natrium1970> I’m having problems with a bit of code. http://pastebin.com/KDMzAaM9 When I try to compile it, I get the error: “This expression has type int but an expression was expected of type IntToken.t”
<natrium1970> I’ve read about similar issues, but I can’t figure out this case.
divyanshu has quit [Read error: Connection reset by peer]
msch has quit [Read error: Connection reset by peer]
rfv has quit [Ping timeout: 265 seconds]
cojy_ has quit [Ping timeout: 272 seconds]
<adrien_znc> natrium1970: you need to show the code and tell which libraries are being used
<natrium1970> I did.
<natrium1970> Plain old stdlib.
psy has quit [Read error: Connection reset by peer]
n1ftyn8 has quit [Ping timeout: 245 seconds]
<struktured> natrium1970: http://pastebin.com/A7RmMxUn
<struktured> natrium1970: you are masking the type of int for no reason basically. The module functor will do that for you, if you have it adhere to some signature of your choice
vanila has quit [Remote host closed the connection]
<natrium1970> How am I masking the type? I’m sorry if I seem stupid, but I really don’t understand this.
rfv has joined #ocaml
divyanshu has joined #ocaml
<struktured> natrium1970: the TOKEN sig makes the type t opaque
<struktured> natrium1970: you could also do something like : " module IntToken : TOKEN with type t = int = struct ... end "
<natrium1970> Some of these books seem to say that I should make everything possible opaque.
<struktured> natrium1970: there's truth to that, but it's also common to expose the type somewhat using the "with type t = ... " or " with module Foo = ", etc.
n1ftyn8 has joined #ocaml
<natrium1970> I kept seeing “with type…” and “with module…” but it’s kind of overwhelming, and every book seems to show things a little differently.
<natrium1970> Thank you.
msch has joined #ocaml
psy has joined #ocaml
cojy_ has joined #ocaml
<struktured> natrium1970: yeah it took me a while to get it all, especially functors and whatnot. good luck.
<natrium1970> I can deal with modules that don’t interact with other in subtle ways.
aluuu has quit [Ping timeout: 272 seconds]
<AeroNotix> MercurialAlchemi: well I have ocaml 4.02
<companion_cube> in ocamlbuild, anyone knows how to force 2 libraries to be linked in a given order?
<AeroNotix> MercurialAlchemi: I got that bit working, turned out I needed to properly set the ocaml load path
<AeroNotix> now I have a diff problem
<companion_cube> (because one depends on the other but ocamlbuild doesn't seem to notice)
natrium1970 has quit [Quit: natrium1970]
aluuu has joined #ocaml
<struktured> companion_cube: curious, is it because one of the libraries in question have bugs in their package descriptions?
<companion_cube> they are libraries that belong to the same project and have just been built :/
<companion_cube> so they don't have a META yet
<struktured> companion_cube: that setup typically works with oasis right? with pure ocamlbuild you're having a problem..or?
<companion_cube> my problem is with oasis :(
<struktured> companion_cube: so oasis is broken in your case? because I have multilib projects that work fine and I know you do too.
lambdahands has joined #ocaml
<companion_cube> it links everything it should, just not in the right order
Hannibal_Smith has joined #ocaml
<companion_cube> no idea on how to force ocamlbuild to change order?
<struktured> companion_cube: ah yeah. hmm. reminds me of how I'd like oasis to make ppx_import go before ppx_* anything else, just by my declared ordered in the oasis file
<companion_cube> :/
<struktured> companion_cube: no I can't do it, but I think its doable in a _tags file
<chouser> Hi, I'm still trying to build a variant type that can be map whose keys and vals are of that same variant type. I think I may have the type right now, but I don't know how to use it: https://gist.github.com/Chouser/15bb2a380520c6b46fc7
natrium1970 has joined #ocaml
<chouser> Or maybe the fact that I can't construct one means my type is broken? Do I need a completely different approach?
<struktured> companion_cube: whitequark showed me some trick to do that with ppx_import, but I didn't really understand it
<companion_cube> can you show me? your _tags file e.g.
<struktured> companion_cube: one sec I can gig up his example I think
<struktured> companion_cube: *dig
<chouser> Also, I'm completely new at this, so if my terminology or names are incorrect, please correct me. I'm trying to learn!
shinnya has quit [Ping timeout: 272 seconds]
<companion_cube> aww, recursive modules
<companion_cube> struktured: I can show you the code that fails, if you want
yaewa has quit [Quit: Leaving...]
martintrojer has quit [Ping timeout: 255 seconds]
moei has joined #ocaml
<struktured> companion_cube: aww so your module graph was recursive by accident or w/o using module rec keyword?
<companion_cube> no, it's chouser's problem
<chouser> companion_cube: yeah, I was all "I'm gettin' the hang of this map functor", but ... um, no.
<struktured> companion_cube: oh
<companion_cube> chouser: does your current stuff compile?
<chouser> that code I posted does not pass the type-check
<companion_cube> I think it might be because you don't have constraints in your recursive modules' signatures
<chouser> The recursive modules compile, but I can't figure out the right types to actually add values to the map.
<companion_cube> you probably want and OrderedValMap : Map.S with type key = OrderedVal.t = ...
<chouser> companion_cube: whoa, new syntax. Didn't know about "<module> with type ..." I'll try it!
<companion_cube> it's <module type>
martintrojer has joined #ocaml
<companion_cube> struktured: well, I can try...
pyon has quit [Read error: Connection reset by peer]
<struktured> companion_cube: my problem is I don't understand how people maintain a manually edited _tags file. I guess like everything else. you commit derived. bleh
<companion_cube> you mean, with oasis ?
<companion_cube> you have several options, including : having (* oasis start *) (* oasis stop *) your content here
<companion_cube> well, it strangely doesnt work with use_foo, but it works with pkg_foo
<companion_cube> so I'll need to install the package before running tests...
<struktured> companion_cube: oh thanks for that tip! and thats not great but better than nothing I guess
<companion_cube> it also works for META, and so on
<companion_cube> and myocamlbuild.Ml
<struktured> thats not suprising, as it can do dep management
<whitequark> how do ocaml objects look inside?
<whitequark> in-memory representation
<companion_cube> you mean proper objects? I think they have a vtable, methods are accessed by the hash of their name
<whitequark> why do they include a reference to debug info, or something?
antegallya1 has quit [Ping timeout: 276 seconds]
<companion_cube> I don't know much, the OO module might give you more insights
<thomasga> any idea why I could get "xxx unbound at toplevel" in the toplevel? (after I install some printers)
<thomasga> (after doing 'let xxx = adas')
<companion_cube> is xxx a module name?
ingsoc has quit [Ping timeout: 264 seconds]
<thomasga> # let f () = Git_unix.FS.create () >>= fun x -> Git_unix.FS.references x ;;
<thomasga> >> Fatal error: f unbound at toplevel
<thomasga> well actually it's even simpler
<thomasga> #require "git.top" ;;; let x = 3;; gives the same result
<thomasga> I guess I'm doing something dumb when registering the printers
<companion_cube> strange indeed
<whitequark> hm
<whitequark> anyone familiar with MArshal?
<whitequark> Marshal.to_string (fun () -> ()) [Marshal.Closures];;
<whitequark> this raises Invalid_argument since 4.00.1
<whitequark> shouldn't it work?
<companion_cube> I really have no idea
<companion_cube> why do you need marshal when you have good serializers?
natrium1970 has quit [Quit: natrium1970]
<whitequark> something in the testsuite fails and i need to fix it
<companion_cube> :(
mcclurmc_ has joined #ocaml
mcclurmc has quit [Ping timeout: 272 seconds]
so has joined #ocaml
lu324_ has quit [Remote host closed the connection]
justinfront has joined #ocaml
lu324_ has joined #ocaml
tanguy` has quit [Ping timeout: 256 seconds]
aluuu has quit [Ping timeout: 244 seconds]
pyon has joined #ocaml
<whitequark> lol
<whitequark> toplevel can't marshal closures for a decade
aluuu has joined #ocaml
cdidd has quit [Ping timeout: 272 seconds]
mobajm__ has quit [Remote host closed the connection]
tanguy` has joined #ocaml
swgillespie has joined #ocaml
justinfront has quit [Ping timeout: 245 seconds]
swgillespie has quit [Client Quit]
Haudegen has quit [Ping timeout: 256 seconds]
mobajm has joined #ocaml
Haudegen has joined #ocaml
sdegutis has joined #ocaml
<sdegutis> Since OCaml's |> is basically Clojure's ->> does OCaml have Clojure's -> ?
<sdegutis> chouser: oh hi there
<sdegutis> chouser: didn't realize you were into static typing
vanila has joined #ocaml
<Drup> sdegutis: what does "->" do ? :)
jcloud has joined #ocaml
<sdegutis> Drup: it does partial application of the thing on the left to the function on the right, making it the first argument
<sdegutis> Drup: it's just like |> except instead of making it the last argument, it makes it the first
<Drup> can you give it a type ?
<whitequark> isn't that · ?
<Drup> there is @@, which is defined as [f @@ x ≡ f x]
<sdegutis> In Clojure, (->> foo (bar quux)) is the same as (bar quux foo) which thus mirrors OCaml's |> operator.
<sdegutis> In Clojure, (-> foo (bar quux)) is the same as (bar foo quux) which is what I'm looking for in OCaml.
<Drup> yeah
<Drup> that's not really typable.
dsheets has joined #ocaml
<sdegutis> Oh well. Not a huge deal.
<sdegutis> fun is a fine solution.
<Drup> at least not in OCaml's type system
<sdegutis> What does "struct" mean/do in module M = struct let foo = 3 end;; ?
arboris has joined #ocaml
<Drup> you could maybe imagine typing that with some variadic magic
<Drup> but variadic magic is almost always a bad solution
<sdegutis> (I'm on Chapter 4 of Real World OCaml and OCaml is awesome so far, but I really don't see myself using Core.)
<Drup> sdegutis: it's just the delimiters for a module
<Drup> struct ... end
<sdegutis> Okay.
<sdegutis> Drup: are you long learning OCaml, or new with it?
<rks`_> he's an OCaml expert.
<chouser> I believe that last night I found an answer to an OCaml question from Drup in 2011
<sdegutis> Ah.
<sdegutis> chouser: so you're not into Clojure anymore?
<Drup> rks`_: I think I would take the comment as a nice compliment from anyone but you =')
<chouser> sdegutis: no no, totally into Clojure. Just trying to learn some OCaml.
<sdegutis> I think Clojure is a neat experiment, in the sense that you can add "language features" with macros. But other than that I prefer static typing and all the benefits of a well-integrated static-type-supporting compiler.
<rks`_> Drup: :D
<whitequark> Drup: why?
<sdegutis> Plus it's *really* frustrating that I have to write unit tests in CLojure to get the rough-equivalent of OCaml's sum types.
<Drup> whitequark: rks`_ restrains himself on this channel, you don't know him ^^'
dsheets has quit [Read error: Connection reset by peer]
justinfront has joined #ocaml
<rks`_> alright
<rks`_> well, you're right, it wasn't as much of a compliment as it is a joke about the "long learning"
<rks`_> but still
hellofunk has joined #ocaml
<Drup> (plus, I don't really consider myself an expert)
<sdegutis> The chapter on modules is kind of glossing over the various syntaxes of 'module'
<sdegutis> I can try to infer how they work, but it's a bit confusing and the author doesn't really explain it at all.
thomasga has quit [Quit: Leaving.]
<sdegutis> Is 'struct ... end' a thing by itself, completely separate from 'module' ?
<Drup> sdegutis: do you make the difference between toplevel lets and expressions ?
<sdegutis> Drup: are you saying struct...end is like C's {...} within a function?
<Drup> No.
<sdegutis> i.e. its sole purpose is to create a new scope?
<Drup> struct ... end is a module *expression*. module Foo = <module_exp> is a module *declaration*
<Drup> the same way "let foo = <expr>" at top level is a declaration.
<Drup> you can't declare module everywhere
<Drup> (especially, not insinde expressions)
<Drup> (at least not directly)
<sdegutis> um
<sdegutis> ok
<Drup> chouser: I wonder what answer you found from me in 2011 :D
<sdegutis> Where are the docs for the OCaml std lib?
<Drup> pretty sure I was not on irc yet, and I don't really answer in the mailing list
<sdegutis> phew ok, then i found the right one and its just ugly
<Drup> :D
<sdegutis> Drup: i assumed chouser meant like you answered something on StackOverflow or some forum
<Drup> sdegutis: still curious x)
<chouser> it was and IRC log. I'll see if I can find it.
<chouser> s/and/an/
<sdegutis> Aww, Dash.app doesn't do anything with OCaml's stylesheets -- its still butt ugly
<sdegutis> Is there a way to make new operators that short-circuit and don't evaluate one or the other side of the expression?
<sdegutis> (new infix)
<Drup> unfortunately, no
<Drup> && and || are special cased in the compiler
<chouser> oh, sorry, misremembered. 2014 is so long ago now, I thought, well, nevermind. 2014-01-08 19:29 http://irclog.whitequark.org/ocaml/2014-01-08.txt
justinfront has quit [Ping timeout: 252 seconds]
tani has joined #ocaml
<Drup> sdegutis: you can use "lazy" (or suspend the evaluation with a function) to achieve the same behavior
<sdegutis> Drup: meh im ok with that
<sdegutis> i never need that
<sdegutis> So the RWO book often says "Consider the following simple" [setup for some explanation]. And it's usually *not* simple.
<sdegutis> I'd like to not have to learn new algorithms *while* learning a new language.
BitPuffin has quit [Quit: See you on the dark side of the moon!]
Tekk_` is now known as Tekk_
tane has quit [Ping timeout: 264 seconds]
BitPuffin has joined #ocaml
<dch> I’m usually a FreeBSD user, and finding getting ocaml + core_extended etc set up on 10.1 *extremely* painful. RWO implies that FreeBSD is a supported platform, but I am having my doubts for at least the modules used in the book.
<dch> re2, core_extended, bin_prot, all don’t work atm. I’ve found hacks or work-arounds for re2 + bin_prot, but core_extended looks like its a bit much for me personally to deal with.
<dch> Is this normal for ocaml packages in general on *BSD or is this just something specific to janestreet libraries, that they are assuming gcc and linux?
<dch> finally, I can see that the myocamlbuild.ml and makefiles for each package are wildly different. Where would be the best place to raise this point and ask if there’s a widely respected standard to refer to for these 2 build system components?
manu3000 has joined #ocaml
<dch> I’m very new to ocaml so its pretty difficult to try and understand what’s actually broken in each one.
<Drup> dch: just ask the on the mailing list
ousado_ is now known as ousado
ousado has quit [Changing host]
ousado has joined #ocaml
<Drup> all these projects are part of core anyway, so you could bug report on core itself.
<Drup> avsm/anil uses freeBSD on a regular basis, he should be quite aware of any issues
<dch> caml-list@inria.fr ?
<Drup> yes
slash^ has quit [Read error: Connection reset by peer]
<dch> Drup: thanks, I will do. I have reported bugs since October or earlier last year and there’s little practical movement. Maybe a wee bump will help.
<dch> perhaps I can contribute to some CI work in this area.
<Drup> pretty sure that would be very appreciated
<sdegutis> onto Chapter 5 :D
sdegutis has quit [Quit: Leaving...]
aluuu has quit [Ping timeout: 245 seconds]
<chouser> I *still* don't have this right: https://gist.github.com/Chouser/15bb2a380520c6b46fc7
<chouser> The type of example_map_val and the error on example_map suggest to me that I don't quite yet have the same type for both the key and value of my map type.
<chouser> BTW, I'm finding "ocamlc -i" very helpful. Props to whoever added that tool.
tani is now known as tane
Thooms has quit [Ping timeout: 265 seconds]
ingsoc has joined #ocaml
<flux> chouser, btw, do you use vim/emacs? if so, you have access to an even more mindblowing tool, namely retrieving compiler-inferred types..
<Drup> this works
<Drup> basically, you need to de-recursify the type so that you can use "with type" on the map type
<Drup> I must say, I'm almost surprised OCaml accepts this definition, but apparently it's well defined
<Drup> (recursive modules always have a slightly black-magic-y feeling)
<Drup> chouser: you should restrain the type of compare slightly to t -> t -> int
AeroNotix has left #ocaml ["WeeChat 1.0.1"]
pdewacht_ has quit [Ping timeout: 252 seconds]
ggherdov has quit [Ping timeout: 245 seconds]
IbnFirnas has quit [Ping timeout: 244 seconds]
strmpnk has quit [Ping timeout: 245 seconds]
sdegutis has joined #ocaml
<sdegutis> Wait, you can overload operators in OCaml for your own custom types?
<pippijn> you can define operators
<pippijn> there is no overloading in ocaml
<Tekk_> Is there any particular support for embedding ocaml in ocaml? As in loading up a .ml file at runtime and using it from there
<Tekk_> thinking of scripting stuff in games, and ocaml is nice enough to use for both..
<Drup> metaocaml ? :D
<sdegutis> Oh right.
<sdegutis> So how is it that Time.t can be compared with < ?
<Drup> sdegutis: < (and <= and =) are a bit weird ...
<sdegutis> Oh.
<pippijn> sdegutis: that's because val (<) : 'a -> 'a -> bool
<sdegutis> Oh right.
<sdegutis> I remember now.
<sdegutis> There's a default implementation for them that compares by memory.
<sdegutis> Or something.
<pippijn> or something, yes
<Drup> lot's of something in there :D
ivan\_ has quit [Remote host closed the connection]
<sdegutis> cool beans
pdewacht has joined #ocaml
<pippijn> it's a deep traversal and structural comparison of the graph starting from the values passed
<pippijn> I think they don't terminate on cyclic structures
<pippijn> (whereas Hashtbl.hash does)
<Drup> and it raises an exception on non-comparable values (like functions, or objects)
<pippijn> right
ivan\ has joined #ocaml
<Drup> chouser: https://bpaste.net/show/81978e71e965 without the useless functor
<Drup> I'm annoyed by the need to give the type t twice
<Drup> wonder how we could get around that
justinfront has joined #ocaml
ivan\ has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
ivan\ has joined #ocaml
oriba has joined #ocaml
malc_ has joined #ocaml
Kakadu has quit [Remote host closed the connection]
psy has quit [Read error: Connection reset by peer]
<adrien> gasche: RE PR 5887 and name clashes in headers
<ingsoc> does anyone on here use ocalide
<adrien> it makes no sense to add that to 4.02.x imho; it's a major change that also requires packaging changes at least
<sdegutis> Given module Person = struct type t = { name: string; } end, how is it that I can write Person.name instead of having need to type person.t.name?
<ingsoc> anyone ?
<ingsoc> I have no clue how to set a project up and don't know if i am configuring it to use opam installation
<mfp> chouser, Drup: http://paste.debian.net/142242/ beware of polymorphic comparison(!)
<sdegutis> mfp: what do you recommend instead?
AlexRussia has quit [Ping timeout: 272 seconds]
swgillespie has joined #ocaml
<chouser> I'm still catching up, but I see what you did there mfp.
<Drup> mfp: doesn't wortk
<Drup> Error: Cannot safely evaluate the definition of the recursively-defined module OrderedValMap
<mfp> uh? types OK here
<Drup> yeah
<MercurialAlchemi> ingsoc: that's some kind of OCaml IDE?
<Drup> that's the issue with recursive modules
AlexRussia has joined #ocaml
<chouser> Unfortunately this is a minimal example, and my real variant more like 8 constructors.
<Drup> you need to execute them to be sure it works
<ingsoc> MercurialAlchemi: yeah
<MercurialAlchemi> hm
<ingsoc> eclipse plugin
<ingsoc> what editor
<MercurialAlchemi> I think people 'round these parts are more of the vim/emacs + merlin + ocp-indent persuasion
<ingsoc> is there anything out there with modern IDE features that is easy to set up
<ingsoc> with syntax highlighting and code completion ?
<chouser> Drup: I see your posts, but I haven't read through them yet. Thanks in advance!
<Drup> ingsoc: what MercurialAlchemi said.
<MercurialAlchemi> the setup I just outlined has smart indent, autocompletion, navigation, renaming (inside a single file, though)
<mfp> sdegutis: in general, it's safer, albeit tiresome, to define a comparison function manually, as done in the above snippet
<MercurialAlchemi> it's not click-friendly though
<Drup> mfp: I would rather use ppx_deriving in this case, though
<sdegutis> mfp: what is this "and" thing all about?
<sdegutis> mfp: Also I don't see any comparison function being defined in this snippet.
<mfp> sdegutis: let rec compare a b = ...
<mfp> sdegutis: as for the 'and ...' stuff, it's recursive modules http://caml.inria.fr/pub/docs/manual-ocaml-400/manual021.html#toc75
<Drup> mfp: the polymorphic compare was here because we first started to figure you the type :p
<sdegutis> mfp: oh
<Drup> figure out*
pdewacht has quit [Remote host closed the connection]
milosn has quit [Ping timeout: 264 seconds]
<mfp> Drup: OK, OrderedValMap didn't like the self-reference in compare, how about this > http://paste.debian.net/142246/
<dch> ingsoc: you can try sublime text 3 with the ocaml package. You will probably need ocp-indent and ocp-index installed anyway.
<dch> some docs at https://github.com/whitequark/sublime-better-ocaml but its available as a package.
<dch> but merlin + vim is slick
<sdegutis> What am I doing wrong here? module Person = struct type t = { name: string; } end let x = { name = "foo" }
<sdegutis> This says unbound record field name.
<sdegutis> haaaaaalp
pdewacht has joined #ocaml
<vanila> name is right there though
milosn has joined #ocaml
<mfp> sdegutis: open Person or { Person.name = "foo" }
ThePawnBreak has joined #ocaml
<sdegutis> Thanks mfp; that works;;
<sdegutis> And now I can do x.Person.name which is kind of strange that I can't just do x.name tbh.
<ingsoc> ok, i am getting somewhere now. had to modify all paths from /usr/bin/ocaml etc. to ~/.opam/<version>/ etc.
<ingsoc> still having problems finding Core libs though
<mfp> ingsoc: are you doing eval `opam config env` ? This should update the PATH and stuff
<mfp> and ocamlc ocamlopt ocamlfind and so on would pick the ones in .opam/... according to the currently selected env (opam switch)
<sdegutis> Is there a built-in alternative to Core's fieldslib syntax extension?
<sdegutis> I like the concept of this, but I would love to not have to pull in any third party library to get it.
elfring has quit [Quit: Konversation terminated!]
<Drup> no
<sdegutis> oh well
<Drup> (except defining everything your self, of course)
<sdegutis> Onto chapter 6: variants
<Drup> you will quickly understand that, in the ocaml ecosystem, having small dependencies is perfectly fine and you should restrict yourself to the built-in capabilities.
<sdegutis> Drup: does that mean it's common to roll your own helper functions/etc when you need that functionality, instead of pulling in a third party library?
<Drup> you should NOT
<Drup> typo.
<Drup> lot's of people do that though, and keep redefining an stdlib
<sdegutis> oh
<sdegutis> ok then
<sdegutis> but i just dont like Core
<sdegutis> first of all because i dont like label-based functions
<thizanne> use Batteries then
<sdegutis> and also because it looks like it does too many things
<sdegutis> and finally because it looks to be not very idiomatic OCaml
<sdegutis> thizanne: thank you for the kind suggestion; does Batteries fit all three of my criteriums?
<Drup> it's opinionated OCaml. I wouldn't say it's non idiomatic
<sdegutis> Drup: i would
<sdegutis> Drup: did you write Core?
<Drup> ahahahah
<Drup> pfrr x)
<sdegutis> Drup: because i will be quite to not offend you if so
<thizanne> sdegutis: I answered only after the first one, and yes, it does
<Drup> do you realize how big core is ? nobody could write that alone reasonably :D
<sdegutis> thizanne := !thizanne + 1
<thizanne> I don't really understand the second one, so I don't know (I think batteries is smaller than full core)
<Drup> (and I don't like Core)
<malc_> sdegutis: incr thizanne
<Drup> thizanne is mutable
<Drup> !
<sdegutis> Like, why use BatInt.add instead of (+) ?
<thizanne> definitely, if you have enough money.
<Drup> sdegutis: imagine you functorize a module over some calculating primitives
<thizanne> sdegutis: module IntMap = Map.Make (Int)
<sdegutis> uhhhh what
<sdegutis> ihave nod ieea whaty our alking about
<Drup> :D
<Drup> keep learning ;)
<sdegutis> that typoing was more due to laziness than irony
<sdegutis> but the irony fits too
<thizanne> and do as if this module didn't exist for now
Hannibal_Smith has quit [Quit: Leaving]
doobi-sham-5008 has joined #ocaml
rgrinberg has joined #ocaml
strmpnk has joined #ocaml
<sdegutis> Does stdlib not have an alternative to List.map ?
<adrien> "alternative"?
<sdegutis> yes
<sdegutis> alternative: [adjective] "available as another possibility"
mcclurmc has joined #ocaml
<Drup> I don't understand what you mean either.
<companion_cube> sdegutis: is it the non-tailrec aspect of List.map that bothers you?
<sdegutis> Does the standard OCaml library have any function to map a list to another list?
<Drup> yeah, List.map
<sdegutis> oh
<companion_cube> rev_map + rev works, too
<sdegutis> I thought that was part of Core
<companion_cube> Core shadows many parts of the stdlib
<Drup> Core redefine the list modules
<sdegutis> I have no idea which List functions are part of Core and which are part of stdlib
<sdegutis> I should probably stop reading Real World OCaml then.
<sdegutis> It's confusing me.
<Drup> it's a common problem when reading Core
<Drup> but it's not that much of an issue really
mcclurmc_ has quit [Ping timeout: 244 seconds]
<ingsoc> looks like this eclipse plugin uses ocamlbuild under the covers to compile code. I seem to be referencing the opam installed libraries correctly "~/.opam/<version>/lib" but ocamlbuild still outputs "Error: Unbound module Core"
oriba_ has joined #ocaml
<ingsoc> do i need to compile files in "~/.opam/<version>/lib" first ?
<ingsoc> i am still a bit cluless as to what constitutes compiling to bytecode
doobi-sham-5008 has quit [K-Lined]
IbnFirnas has joined #ocaml
pdewacht has quit [Ping timeout: 256 seconds]
oriba has quit [Ping timeout: 276 seconds]
Kakadu has joined #ocaml
vanila has quit [Quit: Leaving]
pdewacht has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
shinnya has joined #ocaml
oriba__ has joined #ocaml
AlexRussia has quit [Ping timeout: 265 seconds]
oriba_ has quit [Ping timeout: 245 seconds]
tane has quit [Quit: Verlassend]
MercurialAlchemi has quit [Ping timeout: 272 seconds]
AlexRussia has joined #ocaml
ggherdov has joined #ocaml
AlexRussia has quit [Excess Flood]
AlexRussia has joined #ocaml
thomasga has joined #ocaml
pdewacht has quit [Ping timeout: 264 seconds]
labichn has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
moomin-aba has joined #ocaml
moomin-aba has quit [Remote host closed the connection]
ivan\ has quit [Read error: Connection reset by peer]
ivan\ has joined #ocaml
cdidd has joined #ocaml
tanguy` has quit [Quit: J’ai piscine.]
rgrinberg has joined #ocaml
labichn has quit [Quit: Page closed]
Kakadu has quit [Remote host closed the connection]
ingsoc has quit [Quit: Leaving.]
skinkitten has quit [Quit: Leaving]
Simn has quit [Quit: Leaving]
ingsoc has joined #ocaml
<chouser> Drup: I think I understand both your solutions, though I'm very far from being able to develop either myself.
<chouser> It would indeed be nice to specify t only once, since my real one is 10 variants instead of just 2. :-P
<Drup> the second solution is just the first with the functor manually applied
<chouser> cleans it up a lot
<Drup> since you don't really need the functor more than once, it's shorter to apply it
<chouser> Could t be stuffed into a third module and referred to by both the sig and struct of OrderedVal?
<Drup> I tried that, didn't managed to make it work
<Drup> didn't try very hard, though
<chouser> heh, well, I doubt there's much hope for me, then. But perhaps I'll try, so at least I can see the errors myself. :-)
swgillespie has joined #ocaml
<Drup> you start hitting sharp corners of the module system quite quickly when doing weird recursive manipulations like that
<chouser> that's certainly what I feel like I've been doing. :-)
rgrinberg has quit [Quit: Leaving.]
enitiz has quit [Ping timeout: 244 seconds]
jabesed has joined #ocaml
<chouser> Drup: hm, this seems to have done it: https://gist.github.com/Chouser/15bb2a380520c6b46fc7
<chouser> Though if you have a better suggestion for a name than VariantMod, I'm all ears.
<Drup> try to execute that.
<chouser> I did! I am.
<chouser> Do you mean more than just "ocaml mapmap.ml"?
<Drup> oh, it works
<Drup> hum.
<Drup> hum, surprising
<chouser> heh. well, I'm certainly surprised.
<Drup> ( mfp's solution didn't work because of this self recursive module)
rgrinberg has joined #ocaml
<mfp> Drup: what? I pasted another one that did type & run
<Drup> oh, I missed it
<Drup> I see now
<Drup> It's not a solution that I consider really satisfying
<mfp> essentially the same, just with a non-broken compare
<mfp> (same as the above gist)
<Drup> what I would prefer is to be able to define once a module that contains only types and the associated module types, since they are basically the same
<chouser> heh. mfp, any references I can read on the dangers of using Pervasives.compare?
<Drup> (I would advise ppx_deriving or deriving instead of defining the compare function manually)
<pippijn> I want ppx to work with ocamlfind -package
<pippijn> instead of passing things to -ppx, get the rewriters/plugins from the libraries you compile against
<Drup> pippijn: it's already the case
<pippijn> oh
<pippijn> great :)
enitiz has joined #ocaml
malc_ has quit [Quit: leaving]
Haudegen has quit [Ping timeout: 256 seconds]
<whitequark> pippijn: even works in toplevel
jabesed has quit [Ping timeout: 244 seconds]
Haudegen has joined #ocaml
rand000 has quit [Quit: leaving]
ingsoc has quit [Quit: Leaving.]