adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml MOOC http://1149.fr/ocaml-mooc | OCaml 4.02.3 announced http://ocaml.org/releases/4.02.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
zarul has joined #ocaml
yegods has joined #ocaml
badon has quit [Disconnected by services]
badon_ has joined #ocaml
badon_ is now known as badon
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 248 seconds]
|jbrown| has joined #ocaml
pierpa has quit [Ping timeout: 248 seconds]
<pyon> Is it possible for a user-defined data constructor (basically, not (::)) to have an infix name?
<Drup> No
Algebr` has joined #ocaml
wolfcore has quit [Ping timeout: 240 seconds]
wiredsister has joined #ocaml
wolfcore has joined #ocaml
<mrvn> let ( + ) = Cons x y
noddy has quit [Ping timeout: 268 seconds]
ygrek has joined #ocaml
ygrek has quit [Ping timeout: 244 seconds]
|jbrown| has quit [Remote host closed the connection]
mistermetaphor has joined #ocaml
noddy has joined #ocaml
Haudegen has quit [Ping timeout: 240 seconds]
Haudegen has joined #ocaml
struk|desk|away is now known as struk|desk
Reshi has quit [Read error: Connection reset by peer]
nicholasf has joined #ocaml
misterme_ has joined #ocaml
mistermetaphor has quit [Ping timeout: 244 seconds]
Reshi has joined #ocaml
dsheets has joined #ocaml
BitPuffin|osx has quit [Ping timeout: 276 seconds]
hydan has joined #ocaml
dsheets has quit [Ping timeout: 250 seconds]
cdidd has quit [Quit: Leaving]
cdidd has joined #ocaml
noddy has quit [Ping timeout: 248 seconds]
johnelse has quit [Ping timeout: 248 seconds]
johnelse has joined #ocaml
JacobEdelman_ has quit [Quit: Connection closed for inactivity]
mistermetaphor has joined #ocaml
misterme_ has quit [Ping timeout: 252 seconds]
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
struk|desk is now known as struk|desk|away
mistermetaphor has quit [Remote host closed the connection]
teknozulu has joined #ocaml
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 250 seconds]
Algebr` has quit [Remote host closed the connection]
Algebr` has joined #ocaml
Algebr` has quit [Ping timeout: 268 seconds]
Algebr` has joined #ocaml
yegods has quit [Remote host closed the connection]
Sorella has quit [Quit: Connection closed for inactivity]
zarul has quit [Ping timeout: 244 seconds]
mistermetaphor has joined #ocaml
struk|desk|away is now known as struk|desk
MercurialAlchemi has joined #ocaml
slash^ has joined #ocaml
struk|desk is now known as struk|desk|away
nicholasf has quit [Read error: Connection reset by peer]
noddy has joined #ocaml
badon has quit [Disconnected by services]
badon_ has joined #ocaml
badon_ is now known as badon
leyyin has joined #ocaml
struk|desk|away is now known as struk|desk
noddy has quit [Ping timeout: 240 seconds]
silver has joined #ocaml
copy` has quit [Quit: Connection closed for inactivity]
struk|desk is now known as struk|desk|away
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 250 seconds]
nicholasf has joined #ocaml
noddy has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 250 seconds]
larhat has joined #ocaml
larhat has quit [Remote host closed the connection]
larhat has joined #ocaml
larhat has quit [Remote host closed the connection]
gfixler has joined #ocaml
Vintila has quit [Ping timeout: 248 seconds]
<gfixler> not quite understanding the bit about weak/strong ascription
<gfixler> "Weak ascription (:) means that the constructors of abstract types are still accessible, but the signature does hide all unrelated declarations in the module."
<gfixler> "Strong ascription (:>) makes the abstract types actually abstract.
<gfixler> "
freehck has joined #ocaml
adelbertc has quit [Quit: Connection closed for inactivity]
kolko has quit [Ping timeout: 244 seconds]
kolko has joined #ocaml
ggole has joined #ocaml
Simn has joined #ocaml
Reshi has quit [Ping timeout: 248 seconds]
<flux> I guess the concepts don't exactly match the ones of OCaml..
<gfixler> I guess not
myst|fon has quit [Ping timeout: 260 seconds]
myst|fon has joined #ocaml
teknozulu has quit [Ping timeout: 268 seconds]
sfri has quit [Ping timeout: 260 seconds]
sfri has joined #ocaml
<Algebr`> I am grateful that #ocaml isn't a cesspool like #c is.
Lasher` has quit [Read error: Connection reset by peer]
wolfcore has quit [Ping timeout: 260 seconds]
wolfcore has joined #ocaml
Kakadu has joined #ocaml
nicholasf has quit [Remote host closed the connection]
wiredsister has quit [Ping timeout: 250 seconds]
julien_t has joined #ocaml
Algebr` has quit [Remote host closed the connection]
Haudegen has quit [Ping timeout: 244 seconds]
mettekou has joined #ocaml
dwillems has joined #ocaml
<Simn> I want to move this module to a .ml + .mli: https://github.com/Simn/haxe/blob/idom_calculation/src/optimization/analyzer.ml#L645 Is there any way to do that without duplicating all the type declarations? I've read that they can be moved to a shared file, but then I would no longer have BasicBlock.t, I think.
MercurialAlchemi has joined #ocaml
orbifx has joined #ocaml
<orbifx> Can you recommend a library for.saving settings? Preferably in yaml or equivalent.
nicholasf has joined #ocaml
<lyxia> Simn: I think you can move the types to a single .ml, and then use include in other modules
mettekou has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Haudegen has joined #ocaml
<Simn> Thanks lyxia, that's what I found too. I was concerned about losing BasicBlock.t, but I suppose I can just `type t = whereverIMovedIt.t` in the .mli.
hydan has quit [Remote host closed the connection]
hydan has joined #ocaml
<lyxia> Simn: I mean you don't even need to type "type t = Blabla.t", you can make it just one include line in basicBlock.ml and basicBlock.mli
<Simn> What do you mean when you say "include line"?
<lyxia> this makes it as if you had "type x = X ; ..." inline in the BasicBlock.ml(i) files.
<Simn> Oh nice, I didn't realize that was a thing, thanks!
Reshi has joined #ocaml
mettekou has joined #ocaml
dwillems has quit [Ping timeout: 276 seconds]
mettekou has quit [Read error: Connection reset by peer]
<companion_cube> orbifx: I'd use toml, because I don't think there is yaml in OCaml
Vintila has joined #ocaml
dwillems has joined #ocaml
<orbifx> Thanks companion_cube. I think going with json might be more sustainable.
<companion_cube> why not
<companion_cube> the only bummer is the lack of comments
<orbifx> Also I would have preferred yaml.
<orbifx> Ocf provides a documentation ability, although I think it's a hack
<Drup> gfixler: in the provided example, if you have "module M = sig type key = int .... end"
<Drup> and you do M : MAP
<Drup> The equality M.key = int is still exposed. However, if you do M :> Map, then M.key is abstract
<Drup> In OCaml, you only have the second form. M : MAP is equivalent to sml's M :> MAP
mettekou has joined #ocaml
_andre has joined #ocaml
<Drup> I think there was a good reason, but I don't remember it.
<companion_cube> hmmm, is exception Foo = Bar.Foo allows?
<companion_cube> allowed*
<Drup> # exception Bar = Failure ;;
<Drup> exception Bar of bytes
<companion_cube> but in a .mli it seems to fail
<companion_cube> it weird, because I tried it in utop before
<def`> in a .mli you don't export the equality
<def`> it's not an alias
<companion_cube> oh, it's a copy?
<def`> there is no such thing as copy at the type (static) level
<def`> signature only cares about the interface
dwillems has quit [Ping timeout: 244 seconds]
<def`> structure cares whether it is a rebinding or a generative exception
schive has joined #ocaml
<def`> (this differs from module aliases which matter statically)
Sorella has joined #ocaml
hunteriam has quit [Quit: Connection closed for inactivity]
Vintila has quit [Ping timeout: 244 seconds]
noddy has quit [Ping timeout: 248 seconds]
dsheets has joined #ocaml
Reshi has quit [Ping timeout: 244 seconds]
Reshi has joined #ocaml
anoisz has joined #ocaml
leyyin has quit [Quit: So Long, and Thanks for All the Fish]
BitPuffin has joined #ocaml
copy` has joined #ocaml
nicholasf has quit [Remote host closed the connection]
noddy has joined #ocaml
pierpa has joined #ocaml
darkf has quit [Quit: Leaving]
yegods has joined #ocaml
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
noddy has quit [Ping timeout: 252 seconds]
<orbifx> Could someone take a look at Ocf's ppx? The -ppx ppx_ocf flag doesn't find it :-/
kushal has quit [Ping timeout: 240 seconds]
noddy has joined #ocaml
<orbifx> Is there some kind of opam operation to uodate its registered ppx preprocessors?
<companion_cube> I think it's ocamlfind-related, not opam per se
dhil has joined #ocaml
malina has joined #ocaml
noddy has quit [Ping timeout: 246 seconds]
<orbifx> Any suggestions on what to run for ocamlfind to find this ppx extension?
<Drup> the thing you find to the ppx flag is just an executable
<Drup> you pass*
<Drup> orbifx: juse use -package ocf.ppx
<Drup> you don't need the ppx flag
<orbifx> Thanks Drup.
ollehar has joined #ocaml
kushal has joined #ocaml
dsheets has quit [Remote host closed the connection]
<ollehar> uh, what kind of precision does float_of_string have?
<lyxia> is it not as much as float has?
<ollehar> hm
<ollehar> seems to be good enough, anyway.
<ollehar> trying to track down a calculation error in my compiler.
FreeBirdLjj has joined #ocaml
hxegon has joined #ocaml
dsheets has joined #ocaml
tristero has joined #ocaml
<ggole> Spell something wrong in a test, spend ten minutes scouring code for the bug. Sigh.
<ggole> Sometimes I think I've forgotten how to brain.
ollehar has quit [Remote host closed the connection]
ollehar has joined #ocaml
<orbifx> Is yojson the most prominent json library?
<companion_cube> mostly, yes
Sandlayth has joined #ocaml
Mees has joined #ocaml
<orbifx> Mostly?
mistermetaphor has quit [Remote host closed the connection]
Mees has left #ocaml [#ocaml]
dsheets has quit []
Reshi has quit [Ping timeout: 240 seconds]
<companion_cube> if you need streaming parsing, for instance, it's better to use jsonm
Sandlayth has left #ocaml ["WeeChat 1.3"]
<flux> and if you need to modify the code base, yojson might not be the choice (unless the usage of c preprocessor with ocaml doesn't scare you)
<orbifx> I'm after simple configuration storing and loading.
<orbifx> I either didn't understand ocf or it's incomplete.
<flux> yojson is probably the way to go, though I would also consider toml
<orbifx> So now looking for another lib.
<orbifx> Someone else suggested toml. Why is its format advantageous?
<flux> well, it's more approachable for human editors than an js object tree I think
<flux> [general]\nkey1 = "hello" etc
<flux> plus you can #comment stuff out in it
<flux> (sadly I think toml's saving doesn't know how to preserve said comments though)
<orbifx> Hmm, seems an arbitrary decision now.
dsheets has joined #ocaml
<flux> :)
<orbifx> I know people won't be dealing with these configs manually, there is a front end
<orbifx> Toml syntax seems nicer, but json is more popular.
<flux> well, if you want to stick ocaml records inside json, there are syntax extensions for that
<orbifx> The atd generator?
<edwin> there is a ppx too if you have 4.02.3
<flux> ppx_deriving_yojson
<orbifx> I do.
<edwin> and if it doens't have to be human editable you could use a sexp too
<orbifx> Which of the two libraries is more functionally oriented?
<flux> toml is pretty pure. it even provides lenses for mutations.
<flux> otoh, dealing with json is pretty pure as well. you get a tree out.
<orbifx> I'm going to end up rolling a d20 :-P
<flux> do both.. :)
<companion_cube> flux: cppo is pretty useful
<companion_cube> but I don't know if yojson abuses it
<companion_cube> https://github.com/toml-lang/toml about toml
ollehar has quit [Ping timeout: 246 seconds]
<flux> if you want to edit it that is
<orbifx> I think I'm going to byte the bullet and use toml
<flux> ym. "nibble the bullet"
<orbifx> Seems more appropriate and more yaml-Ish which would have been my preference.
<orbifx> Byte the bool-et
<orbifx> Or nibble the bool-et :-P
<dsheets> toml doesn't support nesting, afaik, which makes it useless for a lot of my uses... also the attitude of the specifiers is rather special
<orbifx> dsheets: it does have nesting..? nams
noddy has joined #ocaml
<dsheets> nams? istr that they didn't want deep nesting so they forbade recursive structures
<orbifx> Dots in th
<orbifx> Sorry typing on the mobile. It's torture :-P
<orbifx> Ow you mean recursion?
<companion_cube> hey dsheets, do you still use "sha" ?
<flux> dsheets, what kind of nesting do you mean? the toml language example has some? https://github.com/toml-lang/toml#user-content-example
<dsheets> not recursion in the data but in the types. perhaps path names are sufficient...
<flux> as in arrays of arrays?
<flux> hmm, it does support arrays of arrays
<dsheets> companion_cube: perhaps somewhere? i seem to recall that there was a project that depended on it in some way. I'd like to remove the dependency as it isn't maintained.
<dsheets> flux: perhaps it has changed in a recent version, i'll have another look. sorry for the fud
<flux> dsheets, I don't know remember what the toml library supports, but if it didn't support them at 1.x, it might support them now at 4.x
<dsheets> oh, i mean the actual specification was fairly special for a while
<companion_cube> dsheets: I'm asking the (non)maitnainer if he wants to pass the project
<companion_cube> the library looks really nice
palomer has joined #ocaml
<palomer> hey everyone
<palomer> I’m getting this error while using ocamlbuild/ocamlfind. I tried googling it to no avail
<palomer> Error: No implementations provided for the following modules: Str referenced from test2.cmx
<dsheets> ah, good, it needs to be maintained or an alternative used. i think nocrypto may eventually be suitable if it isn't already... there is some libgmp dep that is annoying right now, i think
ygrek has joined #ocaml
<dsheets> palomer: you need to use the `str` package with something like <*.{ml,mli}>: package(str) in _tags in your src dir
<dsheets> also `-use-ocamlfind` may be required as an argument to your `ocamlbuild` invocation
<palomer> dsheets: it’s there
<palomer> oh wait, it works now
<palomer> :P
<dsheets> \o/
<palomer> the dependency is also needed for all targets that depend on test2
Kakadu has quit [Quit: Page closed]
ollehar has joined #ocaml
<flux> wish -use-ocamlfind just ended up as the default :). or does it break something?
<dsheets> i think there was resistance to putting a dependency on ocamlfind from the distribution ocamlbuild
<dsheets> ocamlbuild has been moved out of the distribution now and i think its tracker has an issue discussing this very point with the idea that maybe it will shift to the default slowly
sgeisenh has left #ocaml ["WeeChat 1.2"]
<Drup> They tried to make it the default, but did that with the same release that they adedd -no-use-ocamlfind, which was not a great move
Haudegen has quit [Ping timeout: 250 seconds]
<Drup> no that -no-use-ocamlfind has been there for some release, it should not be such an issue
dsheets has quit [Remote host closed the connection]
struk|desk|away is now known as struk|desk
dsheets has joined #ocaml
<orbifx> Do I need to use the package flag for toml lenses?
<flux> "the package flag"?
<orbifx> It's telling me that table is not a function :-S
<orbifx> flux: -package toml-lenses
<orbifx> Or something like that.
<flux> no, there's only one package called toml
<flux> oh diety! I noticed this horrible thing from toml: requires = "str unix ISO8601"
<orbifx> ?
<flux> str!
<companion_cube> wat
<companion_cube> it's not in the opam dependencies
<companion_cube> depends: ocamlfind & menhir & ISO8601
<flux> well, it is in the meta file. I don't know if it actually uses it, though.
<orbifx> I found my typo, false alarm.
<companion_cube> awww, sounds like they didn't update the META file properly then
<flux> yep, seems it doesn't use it
<companion_cube> maybe we could open an issue
FreeBird_ has joined #ocaml
<flux> pretty easy to do single-line-pullrequests on github it seems
FreeBird_ has quit [Remote host closed the connection]
<flux> macwic gets to test it.. :)
FreeBird_ has joined #ocaml
<edwin> or travis, looks like the repo is setup for that
mistermetaphor has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 276 seconds]
slash^ has quit [Read error: Connection reset by peer]
FreeBird_ has quit [Ping timeout: 248 seconds]
mistermetaphor has quit [Remote host closed the connection]
ollehar has quit [Ping timeout: 246 seconds]
struktured has joined #ocaml
mistermetaphor has joined #ocaml
slash^ has joined #ocaml
Haudegen has joined #ocaml
<dsheets> ISO8601 has serious problems
<companion_cube> I feel like alcotest is the hipster version of ounit, am I right?
<companion_cube> nice work dsheets
struktured has quit [Ping timeout: 244 seconds]
<dsheets> ha, maybe. ounit got in my way too much and i'm not very fond of the 2.0 api. alcotest seems more accessible for contribution but maybe that's just me...
<companion_cube> ounit1 is fine, I think
<companion_cube> bleh, alcotest depends on oasis -_-
<dsheets> I think ptime's limited ISO8601 parsing may be the answer to the date parsing issue but someone needs to read the toml spec and decide what is really required for conformance
<dsheets> I'm not sure why it depends on oasis :-/ I wish people would stop using it.
<companion_cube> oasis?
<companion_cube> yeah, well, I use it quite a lot in some projects, but I generate files for releases
orbifx has quit [Quit: AtomicIRC: The nuclear option.]
malina has quit [Ping timeout: 260 seconds]
struktured has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
<Maelan> is there a predefined function that gives both the quotient and remainder of a division on regular ‘int‘s?
<companion_cube> sadly, no
malina has joined #ocaml
noddy has quit [Ping timeout: 248 seconds]
struktured has quit [Ping timeout: 252 seconds]
slash^ has joined #ocaml
palomer_ has joined #ocaml
palomer has quit [Ping timeout: 276 seconds]
palomer_ is now known as palomer
dwillems has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
mettekou has quit [Read error: Connection reset by peer]
larhat has quit [Quit: Leaving.]
yegods has quit [Remote host closed the connection]
jgjl has joined #ocaml
inr has quit [Read error: Connection reset by peer]
inr has joined #ocaml
dsheets has quit [Remote host closed the connection]
dhil has quit [Ping timeout: 264 seconds]
dsheets has joined #ocaml
dhil has joined #ocaml
ygrek has joined #ocaml
ollehar has joined #ocaml
yegods has joined #ocaml
<struk|desk> Maelan: made me realize that (extended) gcd probably isn't readily available either
aantron has quit [Remote host closed the connection]
anoisz has quit [Read error: Connection reset by peer]
aantron has joined #ocaml
noddy has joined #ocaml
leyyin has joined #ocaml
ollehar has quit [Quit: ollehar]
Anarchos has joined #ocaml
jgjl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mettekou has joined #ocaml
dhil has quit [Ping timeout: 260 seconds]
mettekou has quit [Read error: Connection reset by peer]
larhat has joined #ocaml
<malina> I keep getting syntax error, I used to do sml (mosml) but looking at my old sm bok.
<malina> combined wityh ocaml stuff form net, I kept moving *( around etc, but why isthis simple thing wrong?
<malina> pardon for those typos, my usb keyboard is a biit foobar
ollehar has joined #ocaml
<pierpa> malina: is wrong because it's sml, not ocaml
Haudegen has quit [Ping timeout: 260 seconds]
<ansiwen> I'm trying to give clang on Mac OS some compiler-flags when installing with opam by using `CFLAGS=... opam install ..." but they seem to be ignored... what am I doing wrong?
<Algebr> is this an oasis project
<ansiwen> Algebr: talking to me?
<Algebr> yes
<ansiwen> hmm, let's see
<ansiwen> Algebr: no, I don't think so: https://github.com/openvstorage/arakoon/
mettekou has joined #ocaml
<ansiwen> i mean, if I - as a test - enter `CFLAGS=foobar opam install arakoon`, it should immediately fail because of the "foobar", but it doesn't. still fails with the original error
<Algebr> maybe run with also OPAMVERBOSE=1, it might dump the actual compiliation commands?
<Algebr> see if its actually using the cflags
<ansiwen> Algebr: if OPAMVERBOSE=1 is the same as opam install --verbose arakoon, then no, it doesn not use the cflags
<Algebr> well it looks like the makefile is straightforward, seems to just need an extra arg to ocamlbuild https://github.com/openvstorage/arakoon/blob/1.9/Makefile#L18
<seangrove> companion_cube: What's qtest? Is it related to property-based/generative testing?
<companion_cube> yes
<companion_cube> it's a random testing library, + a tool for extracting tests from comments
<companion_cube> (optional)
<ansiwen> Algebr: so you mean, installing from sources? or can I "patch" the makefile from the opam call somehow?
<Algebr> maybe change the makefile, then do: opam pin add <package_name> .
jeffmo has joined #ocaml
kdas_ has joined #ocaml
kushal has quit [Ping timeout: 252 seconds]
Haudegen has joined #ocaml
<malina> pierpa, hi there, sorrry I was afk. Yes but could someone give me a hint, i feel I have covered theocaml stuff and I just always get syntax errors
<malina> for something this simple :/
ollehar has quit [Ping timeout: 246 seconds]
<malina> are undersocres not part of ocaml btw?
<lyxia> underscores mean wildcard pattern
<lyxia> you need to write either "function" or "match" to do pattern matching
<pierpa> malina: I posted an ocaml version of your function
<malina> pierpa, yes, sorry about that. I somehow missed it. :)
<malina> aha.. I have tried pretty muvh everything _except_ thiat line [] -> []
<malina> thanks :)
<pierpa> you're welcome (btw, the ; should be a l)
<malina> get a unbound error on the then {} clause
<pierpa> "let rec" instead of "let", sorry
<malina> it seems to me that x is of different type
<malina> aha
<malina> YES! hehe.. yes in sml rec didn't exists iirc
<pierpa> in ml all is rec by default
<pierpa> *in sml
<malina> thank you.. another silly question.. I read lines from a file into ocaml, and it is quite a long string list, does the memory allocation in a (buffer stream?) automatically size itself, or dcan it overflow?
<malina> can* sorry, usb keyb is broken
<pierpa> not sure I understand the question, but probably there's no need to worry about this
<malina> ok pierpa.. no it might be that my bash environment seems to be a bit odd with the output from ocaml when I pass a file into it.
<pierpa> or at least, worry about it when it doesn't work. If it works, leave it alone :)
<malina> :D
<malina> true, I for now did a head -n10 of the file (which has 3500 lines in it normally) :D
<pierpa> k
<malina> :)
<malina> I culd bash it in 10 mins but it is a nice problem to use to do my first ocaml program I think.
julien_t has quit [Ping timeout: 248 seconds]
<malina> (sort and trim old packages with somewhat pseudo-arbitrary revision numbers)
<mrvn> On 32bit strings are limited to 16MB. Just resizing might be enough.
<malina> presumtion: file has sorted strings . recent should in a sorted list, only keep the first encountered same basename (I understand that the 'sorted' and order might differ in a list in ml, that is next when I know it works)
<malina> ok thanks mrvn
<mrvn> lists are endless though
<malina> my `pwd` is right now marvin he
<malina> (as a homage to Marvin the optimist)
<malina> "optimist" rather
<malina> 16M is plenty, but I got output of a string list like [s1,s2,s3...... and it ended only at c (from a-z) suffixed with ...*] or so.. not sure if that is just my shell being weird as it seems to not paarse output so well.
<mrvn> the runtime has a recursion limit when printing. at some point it stops wiht ...
<pierpa> that is the ocaml toplevel trying t help you by not showing all of a big data structure
<malina> mrvn, pierpa : thank you, as expected (sorry about being so verbose.. I just was a bit new).. Aha, although am I right in thinking you provide x as a list, whereas I am looking for a string * list, no?
<malina> in if x= y, is x implicitly the head of l or l itself?
<malina> ah I see. the return is the list of non-repeated list elements. (Ok, I will be away and stop bothering you! :p) x
nicholasf has joined #ocaml
octachron has joined #ocaml
nicholasf has quit [Remote host closed the connection]
<pierpa> malina: I have no idea of what the function does. I just translated your sml to ocaml
dwillems has quit [Ping timeout: 244 seconds]
julien_t has joined #ocaml
<malina> ya.. as a sub-routine, I wanted to do something like a list of strings, where start popping the head, then check head(x::L) vs next head for equality(y), if yes, discard (first x), check y with next head and os on, so that no recurrences of a string is left.
<malina> if they are equal, then skip x, and set next head to x
<pierpa> ok
dsheets has quit [Remote host closed the connection]
<malina> I will just readon a bit on ocaml syntax till I make sure I get it right :) you have been a great help.
<pierpa> what are you reading?
dsheets has joined #ocaml
mettekou has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
seangrove has quit [Ping timeout: 252 seconds]
dsheets has quit [Read error: No route to host]
dsheets has joined #ocaml
slash^ has left #ocaml [#ocaml]
julien_t has quit [Ping timeout: 248 seconds]
dsheets has quit [Ping timeout: 244 seconds]
<malina> introduction to sml programming (Danish blokes MIke Hansen & Hans Rischel) + the ocaml.org things and just stack exchange and godknows how many messy 100 N tabs I have open
<malina> and I get all confused I guess :p
<pierpa> no wonder that you get syntax errors :D
<malina> :p
<pierpa> there are several free book about ocaml on the net. I think one of these would a better route to learning
<malina> pierpa, yes o fcourse.. I downloaded the manual of ocaml and have the turorials open. But I was reading this book whilst at hospital (visiting someone) so it was a way of refreshing an long lost memory
hxegon is now known as hxegon_AFK
hxegon_AFK is now known as hxegon
hydan has quit [Remote host closed the connection]
hydan has joined #ocaml
dsheets has joined #ocaml
dsheets has quit [Remote host closed the connection]
julien_t has joined #ocaml
dsheets has joined #ocaml
mettekou has joined #ocaml
julien_t has quit [Ping timeout: 244 seconds]
ggole has quit []
<Maelan> struk|desk, what do you mean, “readily”? it actually exists?
wiredsister has joined #ocaml
zarul has joined #ocaml
<struk|desk> Maelan: as I hoped, zarith has many of these number theoretic functions- isn't this what you wanted, earlier? https://github.com/talex5/zarith/blob/minios/big_int_Z.mli#L39
octachron has quit [Read error: Connection reset by peer]
octachron has joined #ocaml
dsheets has quit [Remote host closed the connection]
zarul has quit [Changing host]
zarul has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 264 seconds]
Haudegen has quit [Ping timeout: 252 seconds]
<Maelan> struk|desk, indeed, i used zarith recently and found these functions in the doc, but today my question was really for ints :-)
<struk|desk> Maelan: fair enough, yeah the int[32|64] function suite leaves much to be desired
mettekou has quit [Read error: Connection reset by peer]
dsheets has joined #ocaml
_andre has quit [Quit: leaving]
dwillems has joined #ocaml
schive has quit [Quit: Leaving]
dsheets has quit [Ping timeout: 240 seconds]
mettekou has joined #ocaml
leyyin has quit [Quit: So Long, and Thanks for All the Fish]
BitPuffin has quit [Read error: Connection reset by peer]
malina has quit [Ping timeout: 244 seconds]
julien_t has joined #ocaml
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
marsam has joined #ocaml
malina has joined #ocaml
nicholasf has joined #ocaml
dwillems has quit [Ping timeout: 248 seconds]
Kakadu has joined #ocaml
dwillems has joined #ocaml
octachron has quit [Ping timeout: 250 seconds]
<malina> why can't one do x::(alternatively @) function y (where y is of type a' list and x is of type a'), or rather: how can one recursively add x to a new list whilst popping y? recursively
<malina> y is not a cherry
<malina> except for (mar)y with the cherry
<mrvn> EPARSE
<malina> oki
<pierpa> malina: of course you can. Post the exact code it's not working
octachron has joined #ocaml
<malina> ok one sec
<malina> was too embarrasse dot ask and I have probably done 100 permutations though, until my eyes changed their positions
<malina> (let me just resahuffle a bit as last ones were just wrong)
noddy has quit [Ping timeout: 252 seconds]
<malina> forget that first one with [x;y] clause, was syntactically wrong.
<malina> the others when encounter the hd error out on type 'a which makes sense but I can't get how to do what I want. but headache an hour ago and I have given up and reisgned myself to being a snail or something.
<malina> (I am not bothered right now with the problem I was solving, just testing out compositions)
seangrove has joined #ocaml
struk|desk is now known as struk|desk|away
<pierpa> let's look at this line: | x::y::l -> if x = y then y @ recent l else x @ recent l;;
<pierpa>
<pierpa> "recent l" is not a list
<octachron> malina, what type do you want for "recent"?
<pierpa> recent takes two arguments. if you supply only one you have a partial application
<pierpa> so, it's not a list
snhmib has joined #ocaml
madroach has joined #ocaml
darkf has joined #ocaml
<malina> oops sorry
<malina> :(
<malina> I want
<malina> string list
yegods has quit [Remote host closed the connection]
<malina> sure i could do two args
<malina> string & string list
<malina> s/&*/
<malina> sorry guys. I was away from keyboard
yegods has joined #ocaml
<malina> recent l is I thought l (a list) as input to recent, and we define recent as taking a list as input, no?
<malina> I have a list, which as I pop the head, I wish to only keep the last occurence of a member of that list, i.e. the base case(s) would be either empty set or a singleton . (also, single occurrences should be kept )
<malina> also, I have ordered the list so that any occurrences of an element will be in succession
<malina> hence the if x::y::L <-> if x !=y, keep x, else keep y as x
<malina> and keep traversing so to speak
<mrvn> match it
<malina> keeping means here adding to an empty list which can be returned say
<mrvn> x::y::zs when x = y ->
mettekou has quit [Read error: Connection reset by peer]
<malina> ok.. hmm, I am sorry for being so ignoran,t but could you give me a paste of how this would look like?
dwillems has quit [Ping timeout: 246 seconds]
<malina> for as it seems, I keep just messing up and I am literally feeling like a 4 year old today.
<mrvn> let rec loop = function [] -> [] | x::(y::_ as xs) when x = y -> loop xs | x::xs -> x :: (loop xs)
chindy has joined #ocaml
<malina> thanks, brb , will try.
<malina> that looks sane
<malina> btw
<mrvn> not tail recursive though
<malina> WORKS
<malina> YES oh my Lords and Heavens and Hells!!! <3333
<malina> no, but I can probably figure that out if it is needed.. I just needed to figure this out, and wow, half a day gone :'( but thank you though vry much for your (pl.) patience!
mettekou has joined #ocaml
<malina> I can label the occurences, so I don't think in the simple problem I was working on needs it.
<malina> (tail recursion I mean)*
<malina> this feels a bit like trying to cook an egg whilst dancing and changing a tyre on a car, when none have been attempted before! :)
<Algebr> yep
<malina> Now shall follow a week of reading ! then I shall take over the world (read: my mini projects locally on a computer) :))
<Algebr> gluck
julien_t has quit [Ping timeout: 248 seconds]
octachron has quit [Quit: Leaving]
Reshi has joined #ocaml
<malina> Canuck?
<malina> :p
<Algebr> gevent is like python's version of lwt
wiredsister has quit [Ping timeout: 250 seconds]
darkf has quit [Read error: Connection reset by peer]
darkf has joined #ocaml
wiredsister has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
snhmib has quit [Ping timeout: 240 seconds]
marsam has quit [Read error: Connection reset by peer]
mettekou has quit [Read error: Connection reset by peer]
Simn has quit [Quit: Leaving]
Reshi has quit [Ping timeout: 248 seconds]
BitPuffin|osx has joined #ocaml
malina has quit [Ping timeout: 246 seconds]
Kakadu has quit [Remote host closed the connection]
madroach has quit [Ping timeout: 244 seconds]
madroach has joined #ocaml
hxegon has quit [Ping timeout: 264 seconds]
Haudegen has joined #ocaml