flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 4.00.1 http://bit.ly/UHeZyT | http://www.ocaml.org | Public logs at http://tunes.org/~nef/logs/ocaml/
mfp has quit [Ping timeout: 246 seconds]
watermind has quit [Quit: Konversation terminated!]
cdidd has quit [Remote host closed the connection]
cdidd has joined #ocaml
hinayana has joined #ocaml
chrisdotcode has quit [Ping timeout: 276 seconds]
chrisdotcode has joined #ocaml
zRecursive has joined #ocaml
thelema has quit [Read error: Connection reset by peer]
thelema_ has joined #ocaml
hinayana has quit [Quit: Quitte]
q66 has quit [Quit: Leaving]
madroach has quit [Ping timeout: 264 seconds]
madroach has joined #ocaml
ygrek has joined #ocaml
NaCl_ is now known as NaCl
darkf has joined #ocaml
Xom has joined #ocaml
cdidd has quit [Remote host closed the connection]
cdidd has joined #ocaml
ben_zen has joined #ocaml
ygrek has quit [Ping timeout: 264 seconds]
ygrek has joined #ocaml
contempt has quit [Ping timeout: 268 seconds]
contempt has joined #ocaml
shinnya has quit [Ping timeout: 256 seconds]
walter|r has joined #ocaml
walter|r has quit [Client Quit]
manud has quit [Read error: Connection reset by peer]
manud has joined #ocaml
hto has quit [Quit: Lost terminal]
<whitequark> pippijn: that's just basic HM?
<pippijn> yes
<pippijn> very basic
<pippijn> just as an exercise
<whitequark> ahem
<whitequark> how do I submit
<pippijn> you just write stuff?
<whitequark> nothing happens
<pippijn> weird
<whitequark> oh, you can't change environment
<pippijn> no
<pippijn> sorry :)
<whitequark> ok :)
<pippijn> would be easy to add, but I didn't
<pippijn> mostly because the JS interface is exactly the same as http://xinutec.org/~pippijn/home/projects/lang/cparser/online
<pippijn> ok, I'll make the thing on the right immutable
<zRecursive> i found ocaml is presumbly a good script language: https://github.com/sw2wolf/qachina/blob/master/db/doc/freebsd/bin/wmi.ml :)
tlockney has quit [Excess Flood]
<pippijn> heh
<pippijn> whitequark: it's readonly now
<pippijn> so it won't be confusing
tlockney has joined #ocaml
tlockney has left #ocaml []
<zRecursive> pippijn: different shebang ?
<pippijn> oh
<pippijn> I don't know why they do it with sh
<whitequark> perhaps to avoid hardcoding the entire path
<zRecursive> yeah
<whitequark> but then you have #!/usr/bin/env ocaml
<whitequark> that's what ruby folks do.
<pippijn> I usually do that
<pippijn> I don't know why I didn't
<zRecursive> i works here
<pippijn> it also works here
<pippijn> and I changed it
<pippijn> I don't remember why I had it like that
<pippijn> maybe it had some arguments
<zRecursive> oh
chrisdotcode__ has joined #ocaml
chrisdotcode has quit [Ping timeout: 245 seconds]
<whitequark> you can have them with env
<pippijn> hmm
<pippijn> yes
zRecursive is now known as zRecursive{away}
<pippijn> then I don't know
<pippijn> probably no reason
<pippijn> http://xinutec.org/~pippijn/home/aldor <- fun with syntax highlighting
<pippijn> that first bit is ocaml
ggole has joined #ocaml
Drup has quit [Quit: Leaving.]
zRecursive{away} is now known as zRecursive
djcoin has joined #ocaml
yacks has quit [Ping timeout: 256 seconds]
caligula__ has quit [Quit: Konversation terminated!]
ulfdoz has joined #ocaml
yacks has joined #ocaml
manud has quit [Quit: manud]
manud has joined #ocaml
manud has quit [Client Quit]
ygrek has quit [Ping timeout: 246 seconds]
Arsenik has joined #ocaml
chrisdotcode__ has quit [Ping timeout: 268 seconds]
ulfdoz has quit [Ping timeout: 256 seconds]
dnm_ has joined #ocaml
Snark has joined #ocaml
wwilly has joined #ocaml
hkBst has joined #ocaml
<fds> gasche: Yeah, that was the problem! I've (sort of) fixed that now it compiles, but when I run it and enter any expression it gives me "Parse error: illegal begin of expression", which presumably means my grammar isn't matching anything!
<fds> I'll resume work later, now it's time for breakfast.
caligula has joined #ocaml
Arsenik has quit [Remote host closed the connection]
wwilly has quit [Read error: Connection reset by peer]
hkBst has quit [Ping timeout: 264 seconds]
hkBst has joined #ocaml
hkBst has quit [Changing host]
hkBst has joined #ocaml
dnm_ has left #ocaml []
<gasche> fds: feel free to post your code somewhere and give the faulty input
<gasche> (and have a good breakfast)
dnm has joined #ocaml
ggole_ has joined #ocaml
ggole_ has quit [Client Quit]
zpe has joined #ocaml
Simn has joined #ocaml
mcclurmc has joined #ocaml
<fds> gasche: Here's my code: http://ocaml.nopaste.dk/p58263 I hope there's enough information to see what I'm trying to achieve!
<fds> I know some bits of it aren't right (e.g., the handling of atoms), but I just wanted to get something working first.
zpe has quit [Ping timeout: 245 seconds]
ygrek has joined #ocaml
skchrko has joined #ocaml
thomasga has joined #ocaml
gautamc has quit [Read error: Connection reset by peer]
gautamc has joined #ocaml
zRecursive has quit [Remote host closed the connection]
zpe has joined #ocaml
ben_zen has quit [Ping timeout: 245 seconds]
ollehar has joined #ocaml
Guest76158 is now known as joostvb
zpe has quit [Ping timeout: 276 seconds]
<gasche> fds: I think I have an idea what the problem may be
<gasche> it's your use of "0" and "1" as terminals
Kakadu has joined #ocaml
<gasche> if you use the default lexer, there has been a lexical-category-aware lexing already taking place
<gasche> and you will never get the tokens STRING "0" or KEYWORD "0", but INT "0"
<gasche> so you should rather use, I think the syntax is, `INT(_, 0) -> ...
<gasche> (it's a pattern-matching on an usual token constructor INT, as a stream element (hence the `), that has two parameters, first the string representation then the integer value)
<gasche> it's probably possible to write something like (0 = INT) as well but I don't remember the syntax
wwilly has joined #ocaml
<wwilly> bonjour
<fds> gasche: Aha! I think it's actually `INT(0, _), because that appears to work now. I mean, the generated code is definitely not what I want, but it looks like something I can work with!
<fds> Thanks a lot for your help!
zpe has joined #ocaml
AltGr has joined #ocaml
zpe has quit [Ping timeout: 276 seconds]
zpe has joined #ocaml
mfp has joined #ocaml
mcclurmc has quit [Quit: Leaving.]
chrisdotcode has joined #ocaml
q66 has joined #ocaml
Yoric has joined #ocaml
mcclurmc has joined #ocaml
Yoric has quit [Ping timeout: 268 seconds]
mcclurmc1 has joined #ocaml
mcclurmc has quit [Ping timeout: 264 seconds]
mcclurmc has joined #ocaml
mcclurmc1 has quit [Ping timeout: 245 seconds]
skchrko has quit [Quit: Leaving]
Neros has joined #ocaml
zRecursive has joined #ocaml
mort___ has joined #ocaml
wwilly has quit [Ping timeout: 245 seconds]
skchrko has joined #ocaml
Yoric has joined #ocaml
_andre has joined #ocaml
wwilly has joined #ocaml
yacks has quit [Ping timeout: 276 seconds]
zRecursive has quit [Remote host closed the connection]
yacks has joined #ocaml
ygrek has quit [Ping timeout: 245 seconds]
walter|r has joined #ocaml
Yoric has quit [Ping timeout: 245 seconds]
mort___ has quit [Quit: Leaving.]
Drup has joined #ocaml
Xom has quit [Remote host closed the connection]
Xom has joined #ocaml
Drup has quit [Ping timeout: 256 seconds]
ygrek has joined #ocaml
amirmc has joined #ocaml
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 264 seconds]
Drup has joined #ocaml
mort___ has joined #ocaml
Yonex has joined #ocaml
yezariaely has joined #ocaml
<yezariaely> anyone has a link to the predefined priorities of symbol in ocaml? I know there is a document where this is described, but I can't find it right now
<yezariaely> ehm associativity, not priorities
<thizanne> first table yezariaely
<yezariaely> ah thx.
<Kakadu> any recommendations about debugging programs with Obj.magic?\
<companion_cube> I think the canonical answer is "don't use Obj.magic"
<companion_cube> (or use gdb ?)
<ggole> 1) Remove the use of Obj.magic. 2) Debug as usual.
<Kakadu> The problem is that I don't know how to rewrite it without
<ggole> What are you using it for?
amirmc has quit [Quit: Leaving.]
<Kakadu> I have parser combinators which returns Parsed of 'a * stream | Failed
<Kakadu> and they took a lot of memory allocations
<Kakadu> I want to create a structure { parsed=true; result=...; stream=.. }
<Kakadu> And I want them to put parsing results to this structure with mutable field
<Kakadu> fields*
amirmc has joined #ocaml
<Kakadu> It's OK when all parsers return the same type
<ggole> So it's an allocation hack :/
<Kakadu> But what should I do If some parser return s t and another t option?
Yoric has joined #ocaml
dsheets has joined #ocaml
<companion_cube> I think parser combinators in OCaml are hard to make efficient
<Kakadu> why?
<gasche> I don't see how this unsafe structure would reduce the number of allocations
<gasche> besides, in practice yacc-style parsers also allocate a lot, if only in the production rules
<Kakadu> let (-->) r f s = match r s with Parsed (x,s) -> Parsed (f x, s) | Failed -> Failed
<Kakadu> mutable structure can avoid allocation of 2nd `Parsed`
amirmc has quit [Quit: Leaving.]
<gasche> so it's not that you want to flatten the sum type, it is a wish for strong updates
<gasche> but mutability also incurs its own performance costs
<gasche> it's unclear that a mutable version would be faster here
<Kakadu> Hm
<gasche> note that you could also avoid allocation by using a CPS style
<gasche> have your parser return a two-argument functions that takes the return and the rest of the stream
yezariaely has quit [Quit: Leaving.]
<gasche> s/return/take/
<ggole> How does that avoid allocation?
<ggole> Oh.
travisbrady has joined #ocaml
<Kakadu> I'm not very good in continuated parsers but brief look says that it will increase a count of `fun` constructs which are allocated at runtime
<Kakadu> recently I was trying to avoid that performing lamda lifting
<Kakadu> gabriel?
<gasche> I tried an implementation of parser combinators using GADTs once
<gasche> the idea is that you first build an AST of the grammar as a big GADT, then optimize it to death, then interpret it
<gasche> I think it could work well, but I got stopped by problems with the non-covariance of said GADTs and got diverted towards something else
<gasche> let (-->) r f s k = r s (fun x s -> k (f x) s) would be the continuation version
<gasche> but you're right, it still allocates once
<Drup> the gadt way is my plan for a combinator version of Lilis, but it get messy quite quickly :/
<kerneis> on the other hand, are you sure allocation is your bottleneck?
<kerneis> because I've seen programs using continuations beating hashconsed sets no later than last week-end (hmm)
djcoin has quit [Quit: WeeChat 0.4.0]
<Kakadu> kerneis: yep but I don't know what values are really allocated
<kerneis> so, as always, premature optimisation is the root of all evil
introom has joined #ocaml
<Kakadu> It's perf's output for my combintator parser. http://paste.in.ua/8581/raw/
<Kakadu> DOn't look If you haven't a great nerves ! :)
wwilly has quit [Remote host closed the connection]
ben_zen has joined #ocaml
<ggole> Ouch.
<kerneis> ok, you have an allocation issue :-)
<kerneis> I assume you already tried tweaking OCAMLRUNPARAM to no avail?
<Kakadu> well
<Kakadu> setting minor heap to 8Gb speeds up parsing more than twice
<kerneis> a bit overkill though
weie_ has quit [Quit: Leaving...]
<Kakadu> Any ideas how to understand what values are so much allocated ?
<gasche> I'm not convinced the allocation comes from the parser
<ggole> There's an allocation profiler somewhere
<gasche> you have Format function high in your profiles
<ggole> ocaml-memprof?
<gasche> if you're doing pretty-printing of the parsed result, it's likely to be the bottleneck
<gasche> for allocation profiling for OCaml, I used ygrek's poor man allocation profiler and it worked well
<Kakadu> gasche: I have used poor map allocation profiler and it have pointed to pretty printing functions
<Kakadu> Yeah, exactly ygrek's
<Kakadu> but the problem is that I use the same pretty printer when I parse via yacc
<Kakadu> and It doesn't run 26 seconds, only 2
<gasche> what happens if you remove the pretty-printing step and only check the time of building the parsetree?
<Kakadu> I don't build parse tree, I pretty print immediately
weie has joined #ocaml
<gasche> (for the reference, ygrek's profiler hack is available at http://ygrek.org.ua/p/code/pmpa )
<gasche> Kakadu: then you could build the parse tree instead?
<gasche> do you have code for us to play with?
<Kakadu> yeah, I can rewrite with parse tree, I think
smondet has joined #ocaml
<Kakadu> em
<gasche> (I must say I'm more curious about trying to optimize a parser combinator library than Qt examples :-')
<Kakadu> can somebody test 'opam remote add http://kakadu.github.io/opam-repo-ostap && opam install ostap' ?
<Kakadu> It's parser-combinator library written by my mentor
dsheets has quit [Ping timeout: 268 seconds]
<smondet> Kakadu: just tried the installation, it fails with `logger`
<Kakadu> Oh, shit
<smondet> "Internal error:
<smondet> "./configure": command not found.
<smondet> "
<Kakadu> wut
<smondet> sometimes the "command not found" comes from wrong URLs
<smondet> (i think because opam gets a 404 html page instead of the tar.gz)
<Kakadu> Oh
<Kakadu> this opam just hangs
weie has quit [Quit: Leaving...]
<Kakadu> Any ideas what opam was doing 40 seconds? http://paste.in.ua/8583/#173
hkBst has quit [Quit: Konversation terminated!]
dsheets has joined #ocaml
<thomasga> Kakadu: 00:41.485 000772 SYSTEM error: Cannot download http://ocsigen.org/opam/urls.txt, please check your connection settings.
yacks has quit [Ping timeout: 245 seconds]
<Kakadu> My connection is OK
mort___ has quit [Quit: Leaving.]
<Kakadu> thomasga: anyway it message means only that I have pressed ^C two lines above
<Kakadu> smondet: can I tell me your autoconf and automake version?
<gasche> anyway, if you want to show the code of a project, I'm not sure an opam remote is the best pointer to use
<gasche> (I'd rather get a git-web frontend or something; I don't have OPAM on this machine and no idea how to get actual sources from this URL)
<Kakadu> gasche: I have code, but it have dependecy on parser-combintor library at this moment
n06rin has joined #ocaml
wormphlegm has quit [Ping timeout: 264 seconds]
<Kakadu> (where prettty printers are taken from)
<Kakadu> If you only wnat to read You can open https://github.com/Kakadu/ostap_test/blob/master/HackParserLifting.ml
wormphlegm has joined #ocaml
tlockney has joined #ocaml
<thomasga> Kakadu: the message means that http://ocsigen.org/opam/urls.txt hangs
<thomasga> (it's a bad error message, I guess it should be better to add a timeout to the curl command)
<Drup> thomasga: for some reason, ocsigen.org is down, I don't know what's happening :(
<smondet> Kakadu: i don't have autoconf/automake in this machine, so maybe that was the error
<Kakadu> thomasga: there http://paste.in.ua/8583/#130 macro %{http_code}\n seems not to be expanded. Is it suspicious or not?
<thomasga> nope
<thomasga> that tells curl to prints the http-code it gets
<Kakadu> ah, OK
<thomasga> (200 here)
ben_zen has quit [Ping timeout: 245 seconds]
<n06rin> hello guys. I'm reading think OCaml. And can't make exercise
<n06rin> Can we make somethink like
<n06rin> let repeat "_" 5 and function out is like "_____" ? Need to make it without cycles
Xom has quit [Quit: ChatZilla 0.9.90.1 [Firefox 22.0/20130618035212]]
<Kakadu> you can always define own function instead of loop
<companion_cube> without cycles ?
<ggole> "Without cycles"?
<ggole> Nonrecursive?
<Kakadu> or If you don't care about speed you can think about String.concat
<n06rin> yes, without cycles, I'm at the beginning and need to make with non-recursive functions
<n06rin> or maybe skip this exersice)
<ggole> let repeat str n = let buf = Buffer.create (String.length str * n) in for i = 1 to n do Buffer.add_string buf str done; Buffer.contents buf
<ggole> You should really figure it out yourself though.
<Kakadu> or something very straight-forward like let repeat s n = String.concat "" (Array.to_list (Array.make n s));;
<Kakadu> hehe
<ggole> Hmm, Buffer.contents copies. Probably better to construct the string directly and use String.blit.
<Kakadu> I remember jabber-conference room about haskell where writing similar difficult function was selected as captcha
<ggole> Heh
<n06rin> here is the exercise.
<Kakadu> Oh
<Kakadu> It is summer
<Kakadu> All University students should be on holidays
<Kakadu> n06rin: Or are you studying OCaml for your own power?
<n06rin> need somethink like
<n06rin> " "(70 - String.length (s))^s
<n06rin> Kakadu, you're right
<Kakadu> and you forget repeat at the beginning
<n06rin> " " * (70 - String.length (s))^s
<n06rin> but it's not work
<Kakadu> what is * ?
<ggole> The function under discussion.
<n06rin> * is multiple
<ggole> I'd just print the char 70 times without messing with strings.
<n06rin> and?
shinnya has joined #ocaml
<n06rin> if length of string is more or less then 5 chars what to do?
<Kakadu> n06rin can u try to construct a string of spaces with length = 70 - String.length s ?
<n06rin> no. And this is trouble
<Kakadu> Use repeat function from previous exersice
<n06rin> how I can call repeat function 70 times?
tane has joined #ocaml
<ggole> for loop, or recursive function.
<n06rin> i still don't know how it make. I can read manual, but at this step i need make it without loop
amirmc has joined #ocaml
gnuvince- has quit [Ping timeout: 268 seconds]
<ggole> You can't loop without looping O_o
<n06rin> so, maybe I skip it.
<n06rin> yes, you're right.
<Kakadu> n06rin: http://paste.in.ua/8585/raw/ fill blank spaces
<n06rin> i don't know repeat konstruction. But thank a lot
<Kakadu> Omg
<Kakadu> repeat is function
<Kakadu> You probably have written it in previous exercise
<Kakadu> > <n06rin> let repeat "_" 5 and function out is like "_____" ? Need to make it without cycles
walter|r has quit [Quit: This computer has gone to sleep]
yacks has joined #ocaml
Yoric has quit [Ping timeout: 264 seconds]
thomasga has quit [Ping timeout: 264 seconds]
<n06rin> Kakadu, i don't understand at all. I need to make repeat, I haven't it written
<Kakadu> me and ggole have written two versions of repeat above
<n06rin> so, i need to think
<ggole> An activity central to programming, yes.
<mrvn> How about something like: let indent x = Printf.printf "%*s" x " "
darkf has quit [Quit: Leaving]
<n06rin> guys, about what repeat are you talking?
tianon has quit [Read error: Operation timed out]
<n06rin> i need to write it. It doesn't exsist
<ggole> We gave you working versions. Write and test the rest of the code, using them.
tianon has joined #ocaml
<ggole> Then, if you need to, you can write a replacement.
<ggole> It's very important to split things up into managable bits.
<n06rin> repeat is work, but it's not a decision, because i need to make it without concat. Only what I need to use is ^ and simple statement of function. And I have no idea how to make it
<mrvn> let rec repeat f acc = function 0 -> acc | n -> repeat f (f acc) (n-1);;
<mrvn> let repeat_concat s n = repeat ((^) s) "" n;;
dsheets has quit [Ping timeout: 276 seconds]
tlockney has quit [Excess Flood]
tlockney has joined #ocaml
AltGr has quit [Quit: Konversation terminated!]
tianon has quit [Ping timeout: 245 seconds]
Kakadu has quit [Quit: Konversation terminated!]
tianon has joined #ocaml
alexey has quit [Remote host closed the connection]
alexey has joined #ocaml
n06rin has left #ocaml []
Neros has quit [Ping timeout: 245 seconds]
ollehar has quit [Ping timeout: 246 seconds]
osa1 has joined #ocaml
tianon has quit [Ping timeout: 264 seconds]
amirmc has quit [Ping timeout: 246 seconds]
<kerneis> or even simpler, without the accumulator (because tail-recursion is confusing for beginners):
<mrvn> kerneis: Nah, then he could just hand that in as answere
<kerneis> let rec repeat f x n = if n = 0 then x else f (repeat f x (n-1))
<kerneis> ah, sorry
<kerneis> this is an exercise?
* kerneis didn't read the full backlog
zpe_ has joined #ocaml
tianon has joined #ocaml
zpe has quit [Ping timeout: 264 seconds]
smondet` has joined #ocaml
smondet has quit [Remote host closed the connection]
demonimin has quit [Quit: No Ping reply in 180 seconds.]
demonimin has joined #ocaml
introom has quit [Remote host closed the connection]
<mrvn> let repeat s n = let rec loop acc s = let s2 = s ^ s in function | 0 -> acc | n when n mod 2 = 0 -> loop acc s2 (n / 2) | n -> loop (acc ^ s) s2 (n / 2) in loop "" s n;;
<mrvn> let repeat s n = let rec loop acc s = let s2 = s ^ s in function | 0 -> acc | n -> loop (if n mod 2 = 0 then acc else acc ^ s) s2 (n / 2) in loop "" s n;;
yacks has quit [Read error: Operation timed out]
skchrko has quit [Quit: Leaving]
ben_zen has joined #ocaml
watermind has joined #ocaml
tianon has quit [Ping timeout: 256 seconds]
tianon has joined #ocaml
ben_zen has quit [Ping timeout: 256 seconds]
<bernardofpc> mrvn: a ^ b is O(1), O(len a) or O(len a + len b) ?
<mrvn> the later
<bernardofpc> oh
<mrvn> Does plain linux run on te Dragonboard?
<mrvn> ups
<bernardofpc> is there a reason for itering over b ?
<mrvn> bernardofpc: memcpy()
<bernardofpc> an ocaml string is a C string then ?
<mrvn> but I assume that has lots of binary drivers
<mrvn> bernardofpc: no. an ocaml string is a block with a length and data
<mrvn> ^ creates a new block and copies both a and b into it
<companion_cube> is prefixed by a block that indicates which kind of value it is (block) and its size
<bernardofpc> righ, is not like a list
<bernardofpc> (a list would be just O(len a), if b is immutable, because you follow cdr
<bernardofpc> and in that case, either s ^ s or s ^ acc has the same complexity)
<kerneis> correct
<mrvn> ocamlfind: Package `cstruct' not found
<mrvn> Anyone know what debian package that is in?
<ggole> mrvn: hmm, that looks a bit like the fast exponentiation algorithm
<mrvn> ggole: yes
<ggole> let repeat str n = let len = String.length str in let s = String.create (len * n) in for i = 0 to n - 1 do String.blit str 0 s (i * len) len done; s
<ggole> Ugly :/
<ggole> But probably faster
Drup has quit [Ping timeout: 256 seconds]
zpe_ has quit [Remote host closed the connection]
Neros has joined #ocaml
<mrvn> ggole: let repeat str = function | count when count <= 0 -> "" | 1 -> str | count -> let len = String.length str in let len2 = len * count in let s = String.create len2 in let rec loop n = if 2 * n >= len2 then String.blit s 0 s n (len2 - n) else begin String.blit s 0 s n n; loop (2 * n) end in String.blit str 0 s 0 len; loop len; s;;
zpe has joined #ocaml
mcclurmc has quit [Quit: Leaving.]
zpe has quit [Ping timeout: 264 seconds]
<ggole> Manual strength reduction?
<mrvn> How do I get myocamlbuild to install into debian/tmp instead of /? DESTDIR and PREFIX don't work.
Drup has joined #ocaml
ollehar has joined #ocaml
yacks has joined #ocaml
dsheets has joined #ocaml
ygrek has quit [Ping timeout: 264 seconds]
s4muel has joined #ocaml
mcclurmc has joined #ocaml
ben_zen has joined #ocaml
dsheets has quit [Read error: Connection reset by peer]
dsheets has joined #ocaml
ben_zen has quit [Ping timeout: 240 seconds]
<kerneis> mrvn: I assume you mean ocamlfind rather that myocamlbuild, right?
<mrvn> kerneis: oasis -> myocamlbuild -> ocamlfind
clog has joined #ocaml
clog has quit [^C]
clog has quit [^C]
clog has joined #ocaml
<mrvn> damn, too early: E: Failure("Command ''cp' '/home/mrvn/src/mirage/optcomp/_build/src/optcomp_o.native' '/usr/local/bin/optcomp-o'' terminated with error code 1")
<mrvn> now that I think is oasis.
mort___ has joined #ocaml
gautamc has quit [Read error: Connection reset by peer]
gautamc has joined #ocaml
tianon has quit [Ping timeout: 264 seconds]
tianon has joined #ocaml
ggole has quit []
tane has quit [Ping timeout: 240 seconds]
tane has joined #ocaml
levi has joined #ocaml
dsheets has quit [Ping timeout: 246 seconds]
ollehar has quit [Ping timeout: 240 seconds]
tane has quit [Quit: Verlassend]
levi has quit [Read error: Connection reset by peer]
mort___ has quit [Quit: Leaving.]
_andre has quit [Quit: leaving]
Xom has joined #ocaml
Arsenik has joined #ocaml
Arsenik has quit [Max SendQ exceeded]
Arsenik has joined #ocaml
manud has joined #ocaml
travisbrady has quit [Quit: travisbrady]
ben_zen has joined #ocaml
mort___ has joined #ocaml
Arsenik has quit [Remote host closed the connection]
mort___ has quit [Remote host closed the connection]
ben_zen has quit [Ping timeout: 245 seconds]
mort___ has joined #ocaml
Snark has quit [Quit: leaving]
Yoric has joined #ocaml
Yoric has quit [Read error: Connection reset by peer]
<watermind> so in OCaml, is it costumary to define a module whenever you want to abstract a type
<watermind> with the purpose of increasing type safety
<pippijn> I do that
<pippijn> I don't know about customs
<watermind> as opposed to Newtype = Con Oldtype
<pippijn> oh
<pippijn> no, I don't do that :)
<watermind> right
<pippijn> no need to add extra indirection
<watermind> interesting
<pippijn> you can do: type newtype = private oldtype (* in .mli *)
<pippijn> then you can cast newtype to oldtype if you need it
<pippijn> but you need to be explicit about it
<watermind> private being a keyword? or is it a constructor?
<pippijn> keyword
<watermind> right
<kerneis> a private type is a type that you can deconstruct (pattern-match) but not construct
<kerneis> (you need a function returning something of this type)
<pippijn> BatUTF8.t is a private string
<watermind> how do you deconstruct it by the way?
tlockney has left #ocaml []
travisbrady has joined #ocaml
<kerneis> type t = private A | B of int ;; let (x:t) = get_t() in match x with A -> ... | B i -> ...
<kerneis> in the case where it's just an alias, there is not much you can deconstruct I guess
<kerneis> just coerce
<watermind> I see, thanks
<kerneis> it's useful in particular when you want to force an invariant on your data structure
<kerneis> the user is forced to use your constructors
<kerneis> but otherwise, he can act on the data as usual
<kerneis> (like, generating a unique id, etc.)
<pippijn> I use that in my GLR parser generator
<pippijn> where I operate a lot on various IDs
<pippijn> nonterminal, terminal, production, dotted production, ...
<watermind> what confuses me is... how do you perform type inference, e.g. let decon_or_id x = x ;; is the returned x of the private type or coerced?
<pippijn> state :)
<watermind> I guess you can always desambiguate with type annotations...
<watermind> but is the above guaranteed to be id?
mcclurmc has quit [Quit: Leaving.]
Gertrude has joined #ocaml
Drup has quit [Quit: Leaving.]
Yonex has quit [Ping timeout: 276 seconds]
gasche has quit [Ping timeout: 240 seconds]
ollehar has joined #ocaml
gasche has joined #ocaml
mort___ has quit [Quit: Leaving.]
smondet` has quit [Quit: The Hunger]
Gertrude has quit [Read error: Connection reset by peer]
osa1 has quit [Read error: Connection reset by peer]
osa1 has joined #ocaml
osa1 has quit [Client Quit]
Simn has quit [Quit: Leaving]
<kerneis> watermind: by default, yes, I cannot see why it wouldn't
<kerneis> well, of type 'a -> 'a anyway
ollehar has quit [Ping timeout: 256 seconds]
ben_zen has joined #ocaml
ben_zen has quit [Ping timeout: 241 seconds]
watermind has quit [Quit: Konversation terminated!]
srcerer has quit [Quit: ChatZilla 0.9.90.1 [Firefox 22.0/20130618035212]]