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
oscar_toro has quit [Ping timeout: 245 seconds]
<pippijn> I can get jenga to work perfectly with only building bytecode or only building native code
<pippijn> but not both
<pippijn> because both ocamlc and ocamlopt write .cmi files
pyon has quit [Ping timeout: 246 seconds]
<pippijn> and jenga notices this and says "oh noes, my dependency changed"
<pippijn> if I make ocamlc and ocamlopt both output .cmi, jenga complains "two rules for .cmi"
<pippijn> if I make .cmx depend on .cmi and .cmo, then jenga complains that .cmi changed while executing ocamlopt (true, because ocamlopt did that)
<pippijn> I could probably make it work by compiling byte and native in separate directries
<pippijn> directories
<pippijn> jenga doesn't like that: "non-local rule-targets generated"
lu324_ has quit [Remote host closed the connection]
lu324_ has joined #ocaml
lu324_ has quit [Max SendQ exceeded]
lu324_ has joined #ocaml
eikke has joined #ocaml
rand000_ has quit [Quit: leaving]
Kakadu has quit [Remote host closed the connection]
pyon has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
swgillespie has quit [Ping timeout: 264 seconds]
madroach has quit [Ping timeout: 264 seconds]
madroach has joined #ocaml
swgillespie has joined #ocaml
rgrinberg has joined #ocaml
RossJH has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
hhugo has quit [Quit: Leaving.]
ygrek has joined #ocaml
nullcat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kmicinski has quit [Quit: leaving]
pyon has quit [Quit: stupid emacs]
pyon has joined #ocaml
cdidd has quit [Ping timeout: 244 seconds]
cdidd has joined #ocaml
Thooms has quit [Quit: WeeChat 1.0.1]
lu324_ is now known as lu324
swgilles_ has joined #ocaml
swgillespie has quit [Ping timeout: 252 seconds]
rock_neurotiko has quit [Ping timeout: 264 seconds]
Thooms has joined #ocaml
Thooms has quit [Client Quit]
swgilles_ has quit [Ping timeout: 264 seconds]
struktured has quit [Ping timeout: 245 seconds]
lambdahands has joined #ocaml
kmicinski has joined #ocaml
<kmicinski> Drup: ah yeah, I just saw your z3 bindings and remembered I'd looked at them before
cmtptr has left #ocaml [#ocaml]
<kmicinski> they're quite nice and after I finish my work on this project using my older bindings, I'll switch to using them, but I wasn't aware of the ml-ng branch for z3 until you pointed me at it
<Drup> my thing is an overlay for ml-ng
<Drup> but ml-ng by itself is already much nicer than the old bindings
<kmicinski> right
swgillespie has joined #ocaml
swgillespie has quit [Client Quit]
struk|dtut has joined #ocaml
rock_neurotiko has joined #ocaml
joness has joined #ocaml
<joness> I have just noticed that ocaml does not give a warning if you have incomplete pattern matches in a lambda. why is that? and is there a way to get a warning?
<ousado> really?
<ousado> do yo have an example?
<joness> let f = fun [] -> 0
<whitequark> -w +8
<joness> actually i was wrong
<ousado> I get a warning
<joness> http://try.ocamlpro.com/ gave no warning
<joness> ocaml interpreter did
<pippijn> right
<pippijn> maybe that's a bad thing
<joness> what is?
<pippijn> that it doesn't warn
hhugo has joined #ocaml
rock_neurotiko has quit [Ping timeout: 240 seconds]
kmicinski has quit [Quit: Lost terminal]
enitiz has quit [Ping timeout: 240 seconds]
lambdahands has quit [Ping timeout: 245 seconds]
lambdahands has joined #ocaml
lambdahands has quit [Ping timeout: 272 seconds]
cdidd_ has joined #ocaml
cdidd has quit [Ping timeout: 245 seconds]
enitiz has joined #ocaml
lambdahands has joined #ocaml
struk|dtut has quit [Ping timeout: 246 seconds]
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
ygrek has quit [Ping timeout: 276 seconds]
darkf has joined #ocaml
chinglish has joined #ocaml
hhugo has quit [Quit: Leaving.]
martintrojer has quit [Ping timeout: 240 seconds]
igitoor has quit [Ping timeout: 244 seconds]
martintrojer has joined #ocaml
igitoor has joined #ocaml
igitoor has joined #ocaml
igitoor has quit [Changing host]
lambdahands has quit [Ping timeout: 256 seconds]
rgrinberg has quit [Quit: Leaving.]
joness has quit [Quit: IRCGate CGI:IRC User]
nonuby has joined #ocaml
<nonuby> RWO, records chapter, where it says "The hook that the compiler uses in this case to figure out the type is the record field name." doees it mean the first field name?
lambdahands has joined #ocaml
huza has joined #ocaml
<whitequark> yes
<nonuby> whitequark, but a few lines down where it infers timestamped from the fn passed to list.reduce it will search through if first one doesnt match, i.e. time is 2nd field of timestamped?
<nonuby> nvm, i think this is covered by heartbeat example later on, cheers
<nonuby> okay, just another example if you have two record types, person and address, person has 1 address, and these are simply dumb, you would name the field address so access could be person_1.address.zipcode, but if Address is module with various funcctions and the address record is defined by Address.t, you would call the field Address in the person record definition, this is just naming conventions?
<whitequark> you can't call the field "Address", it has to start with a lowercase letter
<nonuby> hmm yeah, it does that say that near start of chapter, but then I see hb.Heartbeat.time, okay so this is where modules are first class, so that instance of hb has its own module of Heartbeat? if Im completely out, these questions usually resolve themselves a few more pages in..
<whitequark> no, "Heartbeat.time" is just a qualified field name
<whitequark> the dot after hb and the dot after Heartbeat mean different things.
<nonuby> okay, thanks, noted
lordkryss has quit [Quit: Connection closed for inactivity]
chinglish has quit [Ping timeout: 276 seconds]
swgillespie has joined #ocaml
vanila has joined #ocaml
struktured has joined #ocaml
q66 has quit [Quit: Leaving]
chinglish has joined #ocaml
BitPuffin has quit [Ping timeout: 240 seconds]
pyon is now known as inf-groupoid
nonuby has quit [Ping timeout: 272 seconds]
rgrinberg has joined #ocaml
badkins has quit [Remote host closed the connection]
rgrinberg has quit [Client Quit]
nullcat has joined #ocaml
enitiz has quit [Ping timeout: 264 seconds]
rgrinberg has joined #ocaml
huza has quit [Ping timeout: 245 seconds]
nonuby has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
tcpc has joined #ocaml
<tcpc> hi
<tcpc> why [\+\-\*/] does match +, *, / but not - ?
<whitequark> try matching \
<tcpc> like \\- ?
<tcpc> doesn't work neither
<struktured> tcpc: really? seems to work for me...
<tcpc> hm, are you using utop ?
<tcpc> (coz i am and it doesn't work ya)
<tcpc> well, \(+\|-\|*\|/\) seems to be working
<struktured> tcpc: let r= Str.regexp "[-\\+\\*/]" ;; matches on - + * and /
<tcpc> oh, you put the backslashs *after* the special characters
<tcpc> ok, thanks
<struktured> tcpc: you could put the "-" at the end, wouldn't matter. it doesn't need to be escaped, evidently
<struktured> tcpc: although perhaps an expression like "[0-9]" would require escaping...
<whitequark> also, use re instead of str
<tcpc> exactly, i had "[0-9]" expressions in mind so i thought "-" would need to be escaped
<tcpc> my bad, thx
<struktured> whitequark is right, btw. although I have zero experience with regex in ocaml, re is what I'd start using
<whitequark> yes
inf-groupoid is now known as pyon
<tcpc> i can't, i needed regex for a competition of algorithms
<tcpc> you know, kind of you can't use extern libraries
<tcpc> but nevermind, thanks coz i didn't know ocaml-re (maybe useful for me in the future) :d
<struktured> tcpc: good luck, and fwiw, you can probably compile in re if that skips around the rules
jao has quit [Ping timeout: 265 seconds]
rgrinberg has joined #ocaml
<tcpc> thx
huza has joined #ocaml
psy_ has quit [Ping timeout: 252 seconds]
booly-yam-4706 has quit [Ping timeout: 264 seconds]
badkins has joined #ocaml
badkins has quit [Ping timeout: 240 seconds]
huza has quit [Ping timeout: 245 seconds]
_5kg has quit [Ping timeout: 245 seconds]
ygrek has joined #ocaml
huza has joined #ocaml
shinnya has quit [Ping timeout: 256 seconds]
ebzzry has quit [Remote host closed the connection]
booly-yam-4706 has joined #ocaml
chinglish has quit [Quit: Nettalk6 - www.ntalk.de]
swgillespie has quit [Ping timeout: 264 seconds]
keen__________36 has quit [Read error: Connection reset by peer]
swgillespie has joined #ocaml
keen__________36 has joined #ocaml
booly-yam-4706 has quit [Ping timeout: 255 seconds]
slash^ has joined #ocaml
swgillespie has quit [Ping timeout: 252 seconds]
psy_ has joined #ocaml
mcc has joined #ocaml
swgillespie has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
_5kg has joined #ocaml
swgilles_ has joined #ocaml
swgilles_ has quit [Client Quit]
swgillespie has quit [Read error: Connection reset by peer]
swgillespie has joined #ocaml
ggole has joined #ocaml
MercurialAlchemi has joined #ocaml
mcc has quit [Ping timeout: 244 seconds]
rgrinberg has joined #ocaml
nonuby has quit [Ping timeout: 264 seconds]
swgilles_ has joined #ocaml
swgillespie has quit [Ping timeout: 245 seconds]
swgillespie has joined #ocaml
swgilles_ has quit [Ping timeout: 264 seconds]
Kakadu has joined #ocaml
swgillespie has quit [Ping timeout: 246 seconds]
swgilles_ has joined #ocaml
swgillespie has joined #ocaml
swgilles_ has quit [Ping timeout: 245 seconds]
nonuby has joined #ocaml
nonuby has quit [Changing host]
nonuby has joined #ocaml
booly-yam-4706 has joined #ocaml
lambdahands has quit [Ping timeout: 245 seconds]
nullcat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mahem1 has quit [Ping timeout: 240 seconds]
booly-yam-4706 has quit [Ping timeout: 245 seconds]
ane has joined #ocaml
nonuby has quit [Remote host closed the connection]
ousado has quit [Ping timeout: 276 seconds]
mahem1 has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
booly-yam-4706 has joined #ocaml
leowzukw has joined #ocaml
lambdahands has joined #ocaml
robink has quit [Ping timeout: 244 seconds]
lambdahands has quit [Ping timeout: 265 seconds]
RossJH has joined #ocaml
Haudegen has quit [Ping timeout: 272 seconds]
Haudegen has joined #ocaml
testcocoon has quit [Quit: Coyote finally caught me]
lordkryss has joined #ocaml
booly-yam-4706_ has joined #ocaml
booly-yam-4706 has quit [Ping timeout: 246 seconds]
hhugo has joined #ocaml
swgillespie has quit [Ping timeout: 246 seconds]
swgillespie has joined #ocaml
huza has quit [Ping timeout: 265 seconds]
swgillespie has quit [Max SendQ exceeded]
ousado has joined #ocaml
swgillespie has joined #ocaml
tane has joined #ocaml
psy_ has quit [Ping timeout: 276 seconds]
pyx has joined #ocaml
pyx has quit [Client Quit]
aluuu has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Simn has joined #ocaml
ygrek has quit [Ping timeout: 255 seconds]
aluuu_ has joined #ocaml
ousado has quit [Changing host]
ousado has joined #ocaml
aluuu_ has quit [Client Quit]
aluuu has quit [Ping timeout: 240 seconds]
demonimin has quit [Remote host closed the connection]
demonimin has joined #ocaml
lambdahands has joined #ocaml
Unhammer has joined #ocaml
lambdahands has quit [Ping timeout: 240 seconds]
zwer_h has joined #ocaml
booly-yam-4706_ has quit [Ping timeout: 240 seconds]
zwer has quit [Ping timeout: 250 seconds]
ingsoc has joined #ocaml
hhugo has quit [Quit: Leaving.]
darkf has quit [Ping timeout: 246 seconds]
johnelse has joined #ocaml
johnelse is now known as Guest58109
darkf has joined #ocaml
hhugo has joined #ocaml
oscar_toro has joined #ocaml
lambdahands has joined #ocaml
Hannibal_Smith has joined #ocaml
lambdahands has quit [Ping timeout: 244 seconds]
rand000 has joined #ocaml
enitiz has joined #ocaml
booly-yam-4706_ has joined #ocaml
badkins has joined #ocaml
testcocoon has joined #ocaml
testcocoon has quit [Quit: Coyote finally caught me]
testcocoon has joined #ocaml
BitPuffin has joined #ocaml
Thooms has joined #ocaml
testcocoon has quit [Quit: Coyote finally caught me]
rock_neurotiko has joined #ocaml
badkins has quit [Remote host closed the connection]
testcocoon has joined #ocaml
testcocoon has quit [Client Quit]
hhugo has quit [Quit: Leaving.]
testcocoon has joined #ocaml
hhugo has joined #ocaml
shinnya has joined #ocaml
testcocoon has quit [Quit: Coyote finally caught me]
testcocoon has joined #ocaml
testcocoon has quit [Client Quit]
q66 has joined #ocaml
contempt has quit [Ping timeout: 245 seconds]
pdewacht has quit [Ping timeout: 252 seconds]
testcocoon has joined #ocaml
contempt has joined #ocaml
leowzukw has quit [Quit: Lost terminal]
lambdahands has joined #ocaml
hekmek has joined #ocaml
lambdahands has quit [Ping timeout: 244 seconds]
hhugo has quit [Quit: Leaving.]
ebzzry has joined #ocaml
hhugo has joined #ocaml
RossJH has quit [Ping timeout: 255 seconds]
hhugo has quit [Quit: Leaving.]
anemator has joined #ocaml
hhugo has joined #ocaml
anemator has quit [Client Quit]
badkins has joined #ocaml
ingsoc has quit [Remote host closed the connection]
lambdahands has joined #ocaml
badkins has quit [Ping timeout: 272 seconds]
ygrek has joined #ocaml
Rebelion has joined #ocaml
Rebelion has quit [Client Quit]
lambdahands has quit [Ping timeout: 245 seconds]
RossJH has joined #ocaml
booly-yam-4706_ has quit [Ping timeout: 245 seconds]
testcocoon has quit [Quit: Coyote finally caught me]
MercurialAlchemi has quit [Ping timeout: 264 seconds]
lambdahands has joined #ocaml
struktured has quit [Quit: Konversation terminated!]
MercurialAlchemi has joined #ocaml
lostman_ has joined #ocaml
NoNNaN has joined #ocaml
Haudegen has quit [Ping timeout: 244 seconds]
testcocoon has joined #ocaml
Haudegen has joined #ocaml
nicoo has quit [Ping timeout: 250 seconds]
darkf has quit [Quit: Leaving]
ygrek has quit [Remote host closed the connection]
ygrek_ has joined #ocaml
psy_ has joined #ocaml
mort___ has joined #ocaml
hhugo has quit [Quit: Leaving.]
ygrek_ has quit [Ping timeout: 272 seconds]
nicoo has joined #ocaml
hhugo has joined #ocaml
rock_neurotiko has quit [Ping timeout: 256 seconds]
mort___ has quit [Quit: Leaving.]
ygrek has joined #ocaml
robink has joined #ocaml
chinglish has joined #ocaml
waneck has joined #ocaml
nonuby has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
booly-yam-4706_ has joined #ocaml
bytbox has quit [Ping timeout: 245 seconds]
booly-yam-4706_ has quit [Ping timeout: 246 seconds]
hhugo has quit [Quit: Leaving.]
hhugo has joined #ocaml
rock_neurotiko has joined #ocaml
mort___ has joined #ocaml
leowzukw has joined #ocaml
mort___ has quit [Quit: Leaving.]
jeroud has joined #ocaml
rock_neurotiko has quit [Remote host closed the connection]
rock_neurotiko has joined #ocaml
swgillespie has joined #ocaml
bytbox has joined #ocaml
bytbox has quit [Remote host closed the connection]
divyanshu has quit [Ping timeout: 265 seconds]
n1ftyn8 has quit [Ping timeout: 265 seconds]
booly-yam-4706_ has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
n1ftyn8 has joined #ocaml
jao has joined #ocaml
divyanshu has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
booly-yam-4706_ has quit [Remote host closed the connection]
araujo has joined #ocaml
araujo has joined #ocaml
booly-yam-4366 has joined #ocaml
bobpoekert has quit [Read error: Connection reset by peer]
__marius______ has quit [Read error: Connection reset by peer]
bobpoekert has joined #ocaml
leifw has joined #ocaml
__marius______ has joined #ocaml
<Leonidas> am I the only one slightly surprised by this: https://sympa.inria.fr/sympa/arc/caml-list/2015-01/msg00082.html?
S11001001 has quit [Ping timeout: 252 seconds]
chinglish has quit [Quit: Nettalk6 - www.ntalk.de]
<Drup> depends, which way are you surprised ?
lambdahands has quit [Ping timeout: 256 seconds]
mfp_ is now known as mfp
booly-yam-4366 has quit [Ping timeout: 246 seconds]
swgillespie has joined #ocaml
lambdahands has joined #ocaml
_5kg has quit [Ping timeout: 245 seconds]
Thooms has quit [Quit: WeeChat 1.0.1]
S11001001 has joined #ocaml
swgillespie has quit [Client Quit]
nullcat has joined #ocaml
booly-yam-4366 has joined #ocaml
lambdaha1ds has joined #ocaml
lambdahands has quit [Ping timeout: 256 seconds]
swgillespie has joined #ocaml
mxv has joined #ocaml
leowzukw has quit [Ping timeout: 246 seconds]
leowzukw has joined #ocaml
bytbox has joined #ocaml
yminsky has joined #ocaml
<yminsky> Anyone feel competent to answer a GADT question?
<Drup> worst case, we'll tell you we don't know :)
<ggole> Nope, but let's hear it anyway
<yminsky> I’m trying to figure out why (and when) locally abstract types are required to make inference go through properly.
<Drup> ah, that's a bit more "details of the typechecker" than just gadts
<yminsky> For example, consider this type for representing an array type that might be a compact byte array, and might be a general purpose ocaml array: type ‘a t = Array : ‘a array -> ‘a t | Bytes : bytes -> char t
<companion_cube> I think if your GADT hides an existential type (is that it?) inference is mostly going not to work
<yminsky> (No existentials here.)
<yminsky> If I try to write the length function, I get an overly specific type:
<yminsky> let length t =
<yminsky> match t with
<yminsky> | Bytes b -> Bytes.length b
<yminsky> | Array a -> Array.length a
<yminsky> ;;
<yminsky> val length : char t -> int = <fun>
<yminsky> But with a locally abstract type, I get what I want:
<yminsky> let length (type el) (t:el t) =
<yminsky> match t with
<yminsky> | Bytes b -> Bytes.length b
<yminsky> | Array a -> Array.length a
<yminsky> ;;
<yminsky> val length : 'a t -> int = <fun>
<yminsky> The question is: why?
<rom1504> what are you trying to get the length of ?
<ggole> Hmm, when you need the type variable to be polymorphic I think
<Drup> what ggole said, as soon as you need polymorphism across several cases, you need to annotate
<yminsky> Indeed, a truly polymorphic type variable is what’s required. And I guess that’s the right explanation.
<yminsky> In the absence of tying a type variable to a locally abstract one, you’ll get an ordinary variable which is tied to a single type for all uses.
<Drup> basically, inference of forall is impossible.
<Drup> (or rather, OCaml doesn't do it)
<yminsky> Yeah, that all fits. I knew this was a limitation of inference, but that helps me nail it down a bit further.
<yminsky> Thanks all!
<companion_cube> yminsky: if you replace 'a array with, say, int array, the function won't type
<companion_cube> it's not even polymorphism, it's simply inference with GADT
<companion_cube> type _ foo = | Int : int list -> int foo | Float : float list -> float foo;;
<companion_cube> let length = function Int l -> List.length l | Float l -> List.length l;;
<companion_cube> your example did type only because the 'a t could unify with char t
Haudegen has quit [Ping timeout: 264 seconds]
<yminsky> It is polymorphism, I believe. If you use an ordinary type variable for the ‘a in ‘a foo, you’ll get the kind that can only have one value.
<yminsky> Thus, your example won’t typecheck, but with the locally abstract variable, it will.
n1ftyn8 has quit [Ping timeout: 245 seconds]
Haudegen has joined #ocaml
<Drup> yminsky: things become weird when you compose gadt-function and pattern match ocasionally
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<yminsky> Example?
<Drup> sometimes you will need to annotate, sometimes not, it's very dependent of the order of the traversal the typer is doing
<ggole> GADTs have that effect, yeah
<ggole> Losing or-patterns is particularly annoying
<Drup> that too
<Drup> yminsky: I don't have a nice example right now, but I encountered the issue several time.
<Drup> expecting not to have to annotate and being wrong.
<yminsky> I’ve definitely seen it too. The rules for when you need to help the inference engine along aren’t simple.
<companion_cube> with merlin, you know quickly you have to annotate
<ggole> And "natural" structures sometimes simply cease to work
<companion_cube> in practice I didn't find it too annoying to have to annotate GADT code
<ggole> You had an array or record but now you need existentials, time for a fiddly encoding
NoNNaN has quit [Ping timeout: 250 seconds]
<Drup> (well, there is polymorphic recursion too that you need to annotate ...)
rock_neurotiko has quit [Quit: No Ping reply in 180 seconds.]
booly-yam-4366 has quit [Ping timeout: 245 seconds]
<ggole> I wonder whether there is language design work that could make using them less troublesome
<Drup> ggole: fully dependently typed language ? :D
<ggole> *Less* troublesome :)
<companion_cube> TYPED HOLES IN MERLIN
<ggole> I dunno, maybe that's the path to go down if you want that stuff.
<Drup> companion_cube: wouldn't help for the boxing issue
<Drup> ggole: in my experience, using a fully dependently type language is actually less annoying than using gadts
<Drup> because the language is actually design to embed proof and type-level programming
<ggole> Like ATS, Idris, etc?
<Drup> ATS is a different can of worm by itself, because low level + linear types + ...
<companion_cube> boxed issue? how is that related?
<Drup> companion_cube: you have to box things in existential to hide the type and be able to fit everything in the same container
<Drup> it's a common and very annoying pattern with gadts
<Drup> ggole: I mostly tried Agda, never did big things though.
* ggole reimplemented the stdlib to avoid that
<ggole> (Just as an exercise.)
booly-yam-4366 has joined #ocaml
<ggole> Only half worked, since I ended up needing the wrapper elsewhere anyway.
<Drup> ggole: well, you also did the boxing thing, for basic blocks
<ggole> Right.
_5kg has joined #ocaml
<ggole> I have a tentative design that sort-of avoids that, but it involves pretty heavy changes to the form of the IR
<Drup> like ?
<ggole> Putting only "scheduled" instructions (stores, calls, etc) in basic blocks and everything else floating free as in a graph IR
<ggole> The scheduled_insn type gives an opportunity to introduce the necessary existentials.
<ggole> I doubt it's worth it.
hhugo has quit [Quit: Leaving.]
<Drup> that would be awkward to write transformation.
<ggole> It introduces simplicities in some parts, complexity in others
<ggole> Eg to introduce a value instruction you don't need to fiddle around with placing it in a block
<ggole> (But you need a scheduling pass later.)
rock_neurotiko has joined #ocaml
mxv has quit [Ping timeout: 264 seconds]
booly-yam-4366 has quit [Ping timeout: 264 seconds]
booly-yam-4366 has joined #ocaml
hekmek has quit [Quit: Verlassend]
nullcat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
n1ftyn8 has joined #ocaml
arj has joined #ocaml
_5kg has quit [Ping timeout: 245 seconds]
_5kg has joined #ocaml
mxv has joined #ocaml
<pippijn> which mailing list should I direct questions about jenga at?
Nahra``` has quit [Remote host closed the connection]
NoNNaN has joined #ocaml
Nahra``` has joined #ocaml
enitiz has quit [Ping timeout: 252 seconds]
leowzukw has quit [Ping timeout: 245 seconds]
enitiz has joined #ocaml
badkins has joined #ocaml
MC__ has joined #ocaml
manud has joined #ocaml
<pippijn> is caml-list@inria.fr appropriate?
<MC__> Hi, I have added a dependency to _oasis of a library. When reinstalling, it doesn't build the dependency automatically and exists with an error
hhugo has joined #ocaml
<MC__> is there any way to configure the library to automatically install dependenceis?
<pippijn> MC__: not with oasis, but with opam yes
<MC__> how I can do it?
<pippijn> the library's opam package also needs the dependency added
<MC__> awesome! Thanks
anemator has joined #ocaml
struktured has joined #ocaml
wwilly has joined #ocaml
anemator has quit [Client Quit]
<yminsky> jenga questions should go to the core list I would think
<yminsky> ocaml-core@googlegroups.com
<pippijn> alright
ygrek has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
ane has left #ocaml [#ocaml]
MercurialAlchemi has quit [Ping timeout: 246 seconds]
MercurialAlchemi has joined #ocaml
pyon has quit [Read error: Connection reset by peer]
pyon has joined #ocaml
pyon has quit [Client Quit]
pyon has joined #ocaml
manud has quit [Quit: Lingo: www.lingoirc.com]
manud has joined #ocaml
ollehar has joined #ocaml
<ollehar> easy way to dump type to string?
<companion_cube> none :/
<ollehar> D:
<ollehar> no syntax extension?
<Drup> ollehar: ppx_deriving
<companion_cube> ollehar: you mean, dump values of a given type?
<companion_cube> or thetype itself?
<pippijn> ollehar: cause a compiler error
<ollehar> ehr
<pippijn> you won't get a runtime string out of it
_5kg has quit [Ping timeout: 245 seconds]
<ollehar> the value of a type
<pippijn> but you'll see the type on the compiler output
<companion_cube> :D
<pippijn> types don't have values in ocaml
<companion_cube> oh, if it's a printer for values, I'd say ppx_deriving.show, indeed
<pippijn> ah, yes
<companion_cube> or otherwise, printer combinators (less convenient but still tractable)
ygrek has quit [Ping timeout: 245 seconds]
<ollehar> will try, thanks
mistym has joined #ocaml
arj has quit [Quit: Leaving.]
ggole has quit []
Thooms has joined #ocaml
lordkryss has quit [Quit: Connection closed for inactivity]
MC__ has quit [Ping timeout: 246 seconds]
<ollehar> can I define a record type within a function?
<pippijn> yes
<pippijn> but you need a module around it
<ollehar> ah, of course
<Leonidas> do types even exist at runtime?
<pippijn> no
<Leonidas> yeah, so printing them wouldn't work anyway.
<mrvn_> except for very rudimentary integer/pointer/block/string/float array
<mrvn_> Leonidas: define a function to print the type and pass that along
<mrvn_> a pretty printer
<Leonidas> yeah
<pippijn> I once wrote a sizeof function for ocaml
<pippijn> that traverses the data structure and tells you how much memory is reachable from a given object
<pippijn> Drup: do you know coq?
<whitequark> Leonidas: ppx_deriving!
<Leonidas> that was ollehar's question, originally :)
<Leonidas> but I agree ppx_deriving is awesome, need to use it more once my exams are done.
yminsky has quit [Quit: yminsky]
Snark has joined #ocaml
<Drup> pippijn: a little bit
<Drup> pippijn: as in "I used it for a master project and that was enough for me"
<pippijn> can I operate on types and generate code from them?
<pippijn> given a type, generate a function that does something with that type
<whitequark> not at runtime
<pippijn> then when?
<whitequark> at compile-time, yes. write a ppx_deriving plugin :]
<Drup> whitequark: the question is in coq, not ocaml
<whitequark> oh
<whitequark> nevermind then
manud has quit [Quit: manud]
<Drup> pippijn: maybe, never used it that way, so don't know
<pippijn> :\ ok
<Drup> (I used it mostly for proof, not programming)
<ollehar> you can pattern match on types in coq, no?
<pippijn> can you?
<Drup> probably yes
<Drup> pippijn: go ask coq people instead :]
<pippijn> where?
<ollehar> since there's no clear line between types and values (and sets, and that other thing)
<ollehar> #coq channel
<ollehar> or stackoverflow
<pippijn> ok
<Drup> ollehar: well, there is a clear line between set and prop
<ollehar> hm
<ollehar> ueah
<ollehar> yeah
<ollehar> or?
yminsky has joined #ocaml
<ollehar> 2deep4me
<adrien> gasche: "and I haven't proposed anywhere"
<adrien> so no wedding for now? ='(
<ollehar> ppx_deriving doesn't work on classes?
<whitequark> no
<pippijn> ollehar: there are no classes in ocaml *jedi-hand-wave*
<ollehar> :D
<pippijn> whitequark: does it work on GADTs?
_5kg has joined #ocaml
<whitequark> pippijn: in principle, yes, but the usefulness is limited
<whitequark> there's an open issue for GADT support in default derivers
jonludlam has joined #ocaml
enitiz has quit [Quit: Leaving]
lordkryss has joined #ocaml
<Drup> whitequark: it does at least work on gadt that are adt in disguise, right ?
<whitequark> yes
yminsky has quit [Quit: yminsky]
<whitequark> type x = A : int -> x | B : float -> x val pp_x : Format.formatter -> x -> unit = <fun>
wwilly has quit [Quit: Leaving]
<pippijn> there is no way to make arbitrary length tuples in GADTs, is there?
<whitequark> don't think there is
<whitequark> how would you deconstruct it, anyway?
<pippijn> yeah
<pippijn> C++ can do that :\
<whitequark> C++ special-cases tuples
<pippijn> in what way?
<mrvn> pippijn: make a list instead of tuple
<pippijn> mrvn: but then making it heterogeneous is hard
<pippijn> or at least ugly
<Drup> pippijn: you can, sort of
<Drup> but they are imbricated (x1, (x2, (x3, (x3, ())))
<pippijn> Drup: without it effectively turning into a list?
<pippijn> yeah
<pippijn> that's a list
<Drup> not really
<mrvn> type nil type _ tuple = Nil : nil tuple | Cons : 'a * 'b tuple -> ('a -> 'b) tuple
<Drup> as you said it, it can be heterogeneous
<pippijn> right
<pippijn> I'll probably do that
<mrvn> and define an infix operator to construct
<Drup> mrvn: I wouldn't do 'a -> 'b
<Drup> just 'a * 'b
<mrvn> Drup: then you get ('a * ('b * ('c * 'd)))) types
<Drup> I don't see how it's an issue
<mrvn> ('a -> 'b -> 'c -> 'd) tuple, less ()
<Drup> that's a stupid reason to do expose a type that doesn't fit the semantic of the value
<Drup> it's a tuple-like value, use a tuple-like type
<mrvn> well, in my case it actually is a witness for a function.
<Drup> right, not the general case then
<pippijn> I want to describe network packet formats
<mrvn> anyway, both work. Use whatever feels best
<pippijn> and then have val decode : 'a packet_format -> bytes -> 'a (or something like that)
<pippijn> or:
<pippijn> val decode : 'a packet_format -> bytes -> ('a -> 'b) -> 'b
<pippijn> in the latter case, it would make sense to turn it into -> rather than *
<mrvn> ('a -> 'b -> 'c -> 'd) tuple -> bytes -> ('a -> 'b -> 'c -> 'd) -> 'd
<mrvn> yeah. for a scanf use the -> is better
<Drup> pippijn: that would rather be 'a packet_format -> bytes -> 'a, in fact
<Drup> if it's a function type
<mrvn> pippijn: There is a better package though for network packets and other bit/byte structured data. Not sure about the name. melange?
<pippijn> hmm
<mrvn> Drup: depends wether you encode the output type of the accepting function into the format or not.
<pippijn> mrvn: interesting
<pippijn> not in opam?
<pippijn> wow
<pippijn> it's 6 years old
<pippijn> (the last commit)
<pippijn> it generates classes
ollehar has quit [Quit: ollehar]
<pippijn> mrvn: I'm not sure I want to use this
manud has joined #ocaml
Hannibal_Smith has quit [Quit: Leaving]
rand000 has quit [Quit: leaving]
Thooms has quit [Ping timeout: 272 seconds]
lambdaha1ds has quit [Ping timeout: 272 seconds]
manud has quit [Quit: manud]
manu3000 has joined #ocaml
Thooms has joined #ocaml
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
tane has quit [Quit: Verlassend]
mxv has quit [Ping timeout: 265 seconds]
decaf has joined #ocaml
<decaf> hi. can I force garbage collection in repl (utop)?
jao has quit [Ping timeout: 244 seconds]
<pippijn> decaf: does Gc.compact () work?
<decaf> pippijn: it does. thank you
enitiz has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 276 seconds]
<struktured> decaf: curious, how did you verify that it worked?
<decaf> htop is great tool
Kakadu has quit [Ping timeout: 272 seconds]
<decaf> Itried to get a stack overflow with this: List.init 1000000000 ~f:(fun x -> x);;
<decaf> but I've got whole lotta swapping
vanila has quit [Quit: Leaving]
<mbac> looks tail recursive to me
rock_neurotiko has quit [Remote host closed the connection]
rock_neurotiko has joined #ocaml
Thooms has quit [Quit: WeeChat 1.0.1]
AlexRussia has quit [Ping timeout: 255 seconds]
AlexRussia has joined #ocaml
<pippijn> mrvn: how do you do the -> thing?
<pippijn> mrvn: right now I have val decode : type a. string -> a packet -> (a -> 'b) -> 'b
<pippijn> mrvn: and Cons makes an ('a * 'b) packet
AlexRussia has quit [Ping timeout: 240 seconds]
AlexRussia has joined #ocaml
jao has joined #ocaml
nojb has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
<pippijn> what does decode look like for Cons if Cons makes an ('a -> 'b) packet?
swgillespie has joined #ocaml