flux 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.03.0 announced http://ocaml.org/releases/4.03.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
<Algebr> okay why oh why doesn't stdlib's Array come with filter
dsheets has joined #ocaml
<pierpa> because it would be a very wasteful function, I guess
<mrvn> Algebr: because you don't know how long each array is.
<Algebr> mrvn: how and where is this relevant
<mrvn> Algebr: you have to allocate the result arrays with the right size. you can't efficiently append to it as you filter.
dsheets has quit [Ping timeout: 265 seconds]
<mrvn> "filter : ('a -> bool) -> 'a array -> 'a list * 'a list" might make sense but not "-> 'a array * 'a array"
<Algebr> ahhh
ril has joined #ocaml
hay207__ has joined #ocaml
<pierpa> here's an efficient Array.filter: https://bpaste.net/show/795fc7864444
<pierpa> only, is a bit non tail recursive :)
hay207_ has quit [Ping timeout: 244 seconds]
Maxdaman1us is now known as Maxdamantus
<pierpa> and this works for any array: https://bpaste.net/show/95f071a977ec
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 276 seconds]
<mrvn> ahh right, I was thinking partition, not filter.
<mrvn> same reason though
hay207__ has quit [Ping timeout: 240 seconds]
<pierpa> partition can be done in the same way
<mrvn> yeah, just needs 2 counts
<mrvn> or count and len-count
<pierpa> yes, can be tuned in several way
<mrvn> you should make 2 passes over the array to make it tail recursive
<pierpa> and call the function 2 times for each element. No way! :D
<mrvn> pierpa: no, first pass call f a.(i), store the result in an array and count the trues. Second pass copy the trues in one array (and the false in a second for partition).
<pierpa> storing the result in an array kind of defeats the whole machinery, no?
<mrvn> pierpa: only way to make it tail recursive without calling f twice I think
<pierpa> well, yes. In the end the most practical way is to build a list
<pierpa> and maybe convert to an array if one really really really wants an array in the end
<pierpa> (This is just for the sake of a fun exercise. If one has fun with this kind of things :)
<pierpa> then if there could be a way to not use Array.make count a.(0), which I don't like, that would be super
walter|r has quit [Remote host closed the connection]
walter|r has joined #ocaml
walter|r has quit [Ping timeout: 265 seconds]
Reshi has joined #ocaml
Reshi has quit [Ping timeout: 276 seconds]
walter|r has joined #ocaml
dsheets has joined #ocaml
hay207__ has joined #ocaml
dsheets has quit [Ping timeout: 276 seconds]
<Algebr> okay lwt...lwt(timeout): uncaught exception after timeout:
Reshi has joined #ocaml
hay207 has joined #ocaml
hay207__ has quit [Ping timeout: 260 seconds]
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 276 seconds]
silver has quit [Read error: Connection reset by peer]
clog has quit [Ping timeout: 250 seconds]
_habnabit has quit [Ping timeout: 250 seconds]
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 244 seconds]
_habnabit has joined #ocaml
mistermetaphor has joined #ocaml
scarygelatin has quit [Remote host closed the connection]
misterme_ has quit [Ping timeout: 260 seconds]
darkf has joined #ocaml
pierpa has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
mistermetaphor has quit [Remote host closed the connection]
toomuchtvrotsurb has joined #ocaml
Algebr has quit [Remote host closed the connection]
Algebr has joined #ocaml
butts_butts has joined #ocaml
dsheets has joined #ocaml
unbalanced has joined #ocaml
hay207_ has joined #ocaml
dsheets has quit [Ping timeout: 276 seconds]
hay207 has quit [Ping timeout: 276 seconds]
walter|r has quit [Remote host closed the connection]
walter|r has joined #ocaml
walter|r has quit [Ping timeout: 265 seconds]
walter|r has joined #ocaml
walter|r has quit [Remote host closed the connection]
walter|r has joined #ocaml
unbalanced has quit [Quit: WeeChat 1.4]
unbalanced has joined #ocaml
unbalanced has quit [Client Quit]
walter|r has quit [Ping timeout: 240 seconds]
unbalanced has joined #ocaml
dexterph has quit [Ping timeout: 250 seconds]
butts_butts has quit [Ping timeout: 252 seconds]
johnelse has quit [Ping timeout: 276 seconds]
clog has joined #ocaml
hay207__ has joined #ocaml
hay207_ has quit [Ping timeout: 260 seconds]
unbalanced has quit [Quit: WeeChat 1.4]
unbalanced has joined #ocaml
unbalanced has quit [Quit: WeeChat 1.4]
unbalanced has joined #ocaml
johnelse has joined #ocaml
tennix has quit [Ping timeout: 240 seconds]
dsheets has joined #ocaml
slash^ has joined #ocaml
dsheets has quit [Ping timeout: 276 seconds]
unbalanced has quit [Ping timeout: 252 seconds]
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 276 seconds]
sh0t has quit [Ping timeout: 276 seconds]
toomuchtvrotsurb has quit [Remote host closed the connection]
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 276 seconds]
g4143 has joined #ocaml
lostman_ has joined #ocaml
g4143 has quit [Quit: Ex-Chat]
mistermetaphor has joined #ocaml
Ravana has quit [Ping timeout: 260 seconds]
Ravana has joined #ocaml
toomuchtvrotsurb has joined #ocaml
dsheets has joined #ocaml
toomuchtvrotsurb has quit [Remote host closed the connection]
dsheets has quit [Ping timeout: 260 seconds]
Bahman_ has joined #ocaml
Bahman_ has quit [Remote host closed the connection]
Bahman has joined #ocaml
<Bahman> Greetings.
tennix has joined #ocaml
tmtwd has joined #ocaml
<Algebr> hi
tennix has quit [Quit: WeeChat 1.4]
wolfcore has quit [Ping timeout: 252 seconds]
dsheets has joined #ocaml
mistermetaphor has quit [Remote host closed the connection]
zaquest has joined #ocaml
wolfcore has joined #ocaml
tmtwd has quit [Ping timeout: 265 seconds]
dsheets has quit [Ping timeout: 276 seconds]
A1977494 has joined #ocaml
mistermetaphor has joined #ocaml
unbalancedparen has quit [Quit: WeeChat 1.5]
butts_butts has joined #ocaml
tane has joined #ocaml
butts_butts has quit [Ping timeout: 244 seconds]
A1977494 has quit [Quit: Leaving.]
hay207 has joined #ocaml
hay207__ has quit [Ping timeout: 252 seconds]
toomuchtvrotsurb has joined #ocaml
mistermetaphor has quit [Remote host closed the connection]
leyyin has joined #ocaml
MercurialAlchemi has joined #ocaml
ygrek has joined #ocaml
struk|desk has quit [Read error: Connection reset by peer]
struk|desk has joined #ocaml
sfri has quit [Remote host closed the connection]
lindig has joined #ocaml
ygrek has quit [Ping timeout: 276 seconds]
sfri has joined #ocaml
Bahman has quit [Quit: ave atque vale]
lindig has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
FreeBirdLjj has joined #ocaml
silver has joined #ocaml
ygrek has joined #ocaml
lindig has joined #ocaml
lindig has quit [Client Quit]
Stalkr has joined #ocaml
Stalkr has left #ocaml [#ocaml]
ygrek has quit [Ping timeout: 276 seconds]
StatelessCat has quit [Quit: WeeChat 1.4]
StatelessCat has joined #ocaml
butts_butts has joined #ocaml
shinnya has joined #ocaml
d0nn1e has quit [Ping timeout: 265 seconds]
d0nn1e has joined #ocaml
xyproto has joined #ocaml
butts_butts has quit [Ping timeout: 240 seconds]
lindig has joined #ocaml
scarygelatin has joined #ocaml
<companion_cube> Algebr: of course there is CCArray.filter ;)
darkf_ has joined #ocaml
darkf has quit [Ping timeout: 276 seconds]
picolino has quit [Remote host closed the connection]
darkf has joined #ocaml
darkf_ has quit [Ping timeout: 250 seconds]
darkf_ has joined #ocaml
darkf has quit [Ping timeout: 276 seconds]
dsheets has joined #ocaml
Maxdamantus has quit [Ping timeout: 276 seconds]
Maxdamantus has joined #ocaml
dsheets has quit [Remote host closed the connection]
dsheets has joined #ocaml
bba has joined #ocaml
darkf_ is now known as darkf
kolko has quit [Ping timeout: 244 seconds]
kolko has joined #ocaml
shinnya has quit [Ping timeout: 276 seconds]
lindig has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ggole has joined #ocaml
lindig has joined #ocaml
pierpa has joined #ocaml
Guest93688 is now known as kandu
Functor has joined #ocaml
darkf_ has joined #ocaml
Functor is now known as Guest44374
darkf has quit [Ping timeout: 250 seconds]
A1977494 has joined #ocaml
darkf has joined #ocaml
darkf_ has quit [Ping timeout: 276 seconds]
lindig has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
toomuchtvrotsurb has quit [Remote host closed the connection]
leyyin has quit [Ping timeout: 246 seconds]
dsheets has quit [Remote host closed the connection]
walter|r has joined #ocaml
vbmithr has quit [Quit: leaving]
vbmithr has joined #ocaml
AlexRussia has joined #ocaml
lindig has joined #ocaml
butts_butts has joined #ocaml
dsheets has joined #ocaml
hay207_ has joined #ocaml
hay207 has quit [Ping timeout: 276 seconds]
lindig has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
lindig has joined #ocaml
hay207_ has quit [Ping timeout: 252 seconds]
lindig has quit [Client Quit]
toomuchtvrotsurb has joined #ocaml
butts_butts has quit [Ping timeout: 244 seconds]
rgrinberg has joined #ocaml
Simn has joined #ocaml
sh0t has joined #ocaml
Reshi has quit [Ping timeout: 244 seconds]
Reshi has joined #ocaml
AlexRussia has quit [Ping timeout: 276 seconds]
rgrinberg has quit [Ping timeout: 240 seconds]
mistermetaphor has joined #ocaml
Reshi has quit [Quit: WeeChat 1.4]
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
intTree123 has left #ocaml ["Ex-Chat"]
intTree123 has joined #ocaml
unbalancedparen has joined #ocaml
dsheets has quit [Remote host closed the connection]
dsheets has joined #ocaml
dexterph has joined #ocaml
shinnya has joined #ocaml
dexterph has quit [Remote host closed the connection]
dexterph has joined #ocaml
Algebr has quit [Read error: Connection reset by peer]
tmtwd has joined #ocaml
Algebr has joined #ocaml
AlexRussia has joined #ocaml
dexterph has quit [Remote host closed the connection]
dexterph has joined #ocaml
Guest44374 has quit [Ping timeout: 250 seconds]
unbalancedparen has quit [Quit: WeeChat 1.5]
unbalancedparen has joined #ocaml
unbalancedparen has quit [Quit: WeeChat 1.5]
dexterph has quit [Remote host closed the connection]
unbalancedparen has joined #ocaml
dexterph has joined #ocaml
rgrinberg has joined #ocaml
scarygelatin has quit [Quit: Leaving]
hay207_ has joined #ocaml
unbalancedparen has quit [Quit: WeeChat 1.5]
unbalancedparen has joined #ocaml
unbalancedparen has quit [Client Quit]
unbalancedparen has joined #ocaml
rgrinberg has quit [Ping timeout: 246 seconds]
funct_ has joined #ocaml
lindig has joined #ocaml
hay207__ has joined #ocaml
hay207_ has quit [Ping timeout: 246 seconds]
FreeBird_ has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 246 seconds]
dexterph has quit [Remote host closed the connection]
Stalkr^ has joined #ocaml
A19774941 has joined #ocaml
cyc has joined #ocaml
A1977494 has quit [Ping timeout: 246 seconds]
<cyc> Hi, is there recently (like with 4.03) a change in the behavior of linking with C code?
<cyc> I have a program that refuse to compile, and it failed to find the module implemented by my C code
<Algebr> like linking?
<cyc> Algebr, exactly
<Algebr> Is there a small example?
<cyc> wait a minute, I will provide
<adrien> which architecture? what are the compialtion calls and linking calls?
unbalancedparen has quit [Quit: WeeChat 1.5]
<cyc> adrien, linux 64bits (arch)
struktured has joined #ocaml
<flux> cyc, do you have an .mli file that defines the externals without a matching .ml file?
<cyc> flux, yes
<flux> I believe this case is then different with 4.03
<cyc> Here my small example. I can't compile it.
<cyc> It fails to find module Test
<cyc> It builds with old 4.02.3
<flux> I'm not sure how it is fixed, though. perhaps you need to replicate the definitions in the .ml
<flux> (I mean I don't know if there's a shorter solution)
<cyc> flux, you mean declare them as external in a new .ml and not just in .mli?
unbalancedparen has joined #ocaml
unbalancedparen has quit [Remote host closed the connection]
<flux> well, if you don't have anything else in the .mli why not just rename it to .ml
<flux> but otherwise an .ml must provide whatever the .mli provides
<adrien> or symlink
unbalancedparen has joined #ocaml
<adrien> (although that's bad for sources)
<flux> .ml and .mli format are not the same in general..
<adrien> yeah, that only works in limited cases :)
<flux> alternatively you can just provide only the signature (val foo : int -> int) in the .mli and then the external part in the .ml file for implementation
Simn has quit [Read error: Connection reset by peer]
<Algebr> I read there is a small runtime penalty for that but makes the abstraction cleaner.
<cyc> flux, i try to create a .ml with the external definitions, and just the val declaration .mli
<cyc> sorry, it works
<cyc> thx you
<cyc> But why does it change?
<flux> I imagine it's a by-product of some other change, not something that was explicitly planned..
AlexRussia has quit [Ping timeout: 252 seconds]
<flux> and I do wonder if the old functionality will ever be brought back
Stalkr^ has quit [Ping timeout: 265 seconds]
tmtwd has quit [Remote host closed the connection]
butts_butts has joined #ocaml
tmtwd has joined #ocaml
rgrinberg has joined #ocaml
unbalancedparen has quit [Quit: WeeChat 1.5]
cyc has quit [Quit: Leaving]
govg has joined #ocaml
tmtwd has quit [Ping timeout: 265 seconds]
pecan has quit [Ping timeout: 250 seconds]
dsheets has quit [Remote host closed the connection]
FreeBird_ has quit [Remote host closed the connection]
dsheets has joined #ocaml
lindig has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pecan has joined #ocaml
d0nn1e has quit [Ping timeout: 276 seconds]
butts_butts has quit [Ping timeout: 244 seconds]
leyyin has joined #ocaml
struktured has quit [Ping timeout: 240 seconds]
tane has quit [Quit: Verlassend]
rgrinberg has quit [Ping timeout: 260 seconds]
AlexRussia has joined #ocaml
ygrek has joined #ocaml
larhat has joined #ocaml
chenglou has quit [Ping timeout: 260 seconds]
darkf has quit [Quit: Leaving]
rgrinberg has joined #ocaml
chenglou has joined #ocaml
picolino has joined #ocaml
kolko has quit [Quit: ZNC - http://znc.in]
picolino has quit [Ping timeout: 276 seconds]
rgrinberg has quit [Ping timeout: 240 seconds]
dsheets has quit [Remote host closed the connection]
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 260 seconds]
funct_ has quit [Quit: Page closed]
ggole has quit []
dsheets has joined #ocaml
toomuchtvrotsurb has quit [Remote host closed the connection]
govg has quit [Ping timeout: 246 seconds]
dsheets has quit [Ping timeout: 276 seconds]
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 265 seconds]
slash^ has quit [Read error: Connection reset by peer]
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 240 seconds]
lindig has joined #ocaml
govg has joined #ocaml
picolino has joined #ocaml
larhat has quit [Quit: Leaving.]
dsheets has joined #ocaml
Algebr has quit [Ping timeout: 260 seconds]
dsheets has quit [Ping timeout: 276 seconds]
dsheets has joined #ocaml
Omerta has joined #ocaml
<Omerta> hi, does anyone know how to use deriving show with polymorphic types?
scarygelatin has joined #ocaml
dsheets has quit [Ping timeout: 246 seconds]
butts_butts has joined #ocaml
dsheets has joined #ocaml
Omerta has quit [Quit: Leaving]
dsheets has quit [Ping timeout: 246 seconds]
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 260 seconds]
lindig has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
yunxing has joined #ocaml
butts_butts has quit [Ping timeout: 252 seconds]
sh0t has quit [Read error: Connection reset by peer]
sh0t has joined #ocaml
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 276 seconds]
ygrek has quit [Ping timeout: 246 seconds]
Wth has joined #ocaml
leyyin has quit [Quit: So Long, and Thanks for All the Fish]
Typs has joined #ocaml
<Typs> Hello guys
mistermetaphor has quit [Remote host closed the connection]
<Typs> I have a little question, I want to create a function : unit -> ('a,'b)list
<Typs> but I don't know how to make the ('a,'b)list
<Typs> can someone help me ?
<Drup> This is a homework ? :)
<Typs> yep haha
dsheets has joined #ocaml
<mrvn> There is only one ('a, 'b) list you can make out of thin air: The empty list.
<Typs> ok but it will just be a 'a list no ?
<mrvn> which can be unified with ('b, 'c) list
<Typs> Ok I think I see the thing thanks :)
dsheets has quit [Ping timeout: 276 seconds]
<mrvn> you can annotate the type if you must or write an mli file
<Typs> yeah I've got type('a,'b)dict = ('a *'b)list
Wth has quit [Ping timeout: 250 seconds]
<Typs> and I'm trying to write let new_dict () =
<mrvn> There is no trying, only doing.
dsheets has joined #ocaml
mistermetaphor has joined #ocaml
yunxing has quit [Remote host closed the connection]
yunxing has joined #ocaml
dsheets has quit [Ping timeout: 250 seconds]
yunxing has quit [Read error: Connection reset by peer]
toomuchtvrotsurb has joined #ocaml
yunxing has joined #ocaml
aphprentice has quit [Quit: Connection closed for inactivity]
MercurialAlchemi has quit [Ping timeout: 240 seconds]
Stalkr has joined #ocaml
Stalkr has quit [Quit: Leaving...]
ril has joined #ocaml
govg has quit [Ping timeout: 252 seconds]
govg has joined #ocaml
dsheets has joined #ocaml
Typs has quit [Remote host closed the connection]
dsheets has quit [Ping timeout: 244 seconds]
Earnestly has joined #ocaml
govg has quit [Ping timeout: 246 seconds]
govg has joined #ocaml
madroach has quit [Ping timeout: 244 seconds]
madroach has joined #ocaml
d0nn1e has joined #ocaml
bba has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
govg has quit [Ping timeout: 260 seconds]
govg has joined #ocaml
govg has quit [Ping timeout: 246 seconds]
govg has joined #ocaml
silver has quit [Quit: rakede]
toomuchtvrotsurb has quit [Remote host closed the connection]
rgrinberg has joined #ocaml