<dr_toboggan>
with foo and bar, just passing foo directly doesn't compile
pierpa has quit [Ping timeout: 268 seconds]
<dr_toboggan>
but line 13 does work
<dr_toboggan>
my complaint was that, based on the error message, there was sufficient information to insert that let foo ~prefix... conversion automatically
<dr_toboggan>
however
<dr_toboggan>
that has a performance hit
<dr_toboggan>
thus not including that sort of automatic conversion was a design decision
<dr_toboggan>
correct?
badon has quit [Quit: Leaving]
govg has joined #ocaml
govg has quit [Ping timeout: 250 seconds]
govg has joined #ocaml
yegods has quit [Ping timeout: 260 seconds]
silver has quit [Quit: rakede]
badon has joined #ocaml
dsheets has joined #ocaml
bba has joined #ocaml
govg has quit [Ping timeout: 250 seconds]
govg has joined #ocaml
dsheets has quit [Ping timeout: 250 seconds]
govg has quit [Ping timeout: 244 seconds]
darkf has joined #ocaml
yegods has joined #ocaml
govg has joined #ocaml
solrize has quit [Ping timeout: 268 seconds]
govg has quit [Ping timeout: 250 seconds]
govg has joined #ocaml
govg has quit [Ping timeout: 240 seconds]
hxegon has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bba has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
hxegon has joined #ocaml
sh0t has quit [Ping timeout: 276 seconds]
yegods has quit [Read error: Connection reset by peer]
dsheets has joined #ocaml
dsheets has quit [Remote host closed the connection]
jimt_ is now known as jimt
yegods has joined #ocaml
hxegon has quit [Ping timeout: 252 seconds]
noddy has quit [Ping timeout: 240 seconds]
cdidd has quit [Ping timeout: 246 seconds]
hxegon has joined #ocaml
FreeBirdLjj has joined #ocaml
hxegon has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
yegods has quit [Remote host closed the connection]
jfntn has joined #ocaml
hxegon has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
adelbertc has quit [Quit: Connection closed for inactivity]
yegods has joined #ocaml
hxegon has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
kandu has quit [Ping timeout: 260 seconds]
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
iorivur has quit [Ping timeout: 268 seconds]
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
badon_ has joined #ocaml
badon has quit [Disconnected by services]
badon_ is now known as badon
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
cdidd has joined #ocaml
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
Reshi has joined #ocaml
yegods has joined #ocaml
kandu has joined #ocaml
kandu is now known as Guest17036
yegods has quit [Remote host closed the connection]
johnelse_ has quit [Ping timeout: 276 seconds]
johnelse has joined #ocaml
shinnya has quit [Ping timeout: 250 seconds]
johnelse has quit [Ping timeout: 240 seconds]
artart78_ is now known as artart78
johnelse has joined #ocaml
hxegon has joined #ocaml
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
rgrinberg has quit [Quit: WeeChat 1.4]
yegods has joined #ocaml
tumdum has quit [Ping timeout: 260 seconds]
jfntn has quit [Ping timeout: 260 seconds]
tumdum has joined #ocaml
tumdum has quit [Changing host]
tumdum has joined #ocaml
yegods has quit [Remote host closed the connection]
hxegon has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
adrien_znc has quit [Ping timeout: 260 seconds]
adrien_znc has joined #ocaml
ohama has quit [Ping timeout: 260 seconds]
please_help has quit [Ping timeout: 260 seconds]
please_help has joined #ocaml
ohama has joined #ocaml
manud has quit [Quit: manud]
FreeBirdLjj has quit [Remote host closed the connection]
adelbertc has joined #ocaml
solrize has joined #ocaml
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 250 seconds]
john51 has joined #ocaml
vcfg has joined #ocaml
dsheets has joined #ocaml
hxegon has joined #ocaml
john51_ has quit [Ping timeout: 260 seconds]
dsheets has quit [Ping timeout: 250 seconds]
hxegon has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
hxegon has joined #ocaml
MercurialAlchemi has joined #ocaml
toolslive has quit [Ping timeout: 250 seconds]
TheLemonMan has joined #ocaml
dsheets has joined #ocaml
copy` has quit [Quit: Connection closed for inactivity]
toolslive has joined #ocaml
dsheets has quit [Ping timeout: 250 seconds]
hxegon has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Guest17036 has quit [Remote host closed the connection]
badon has quit [Quit: Leaving]
kandu has joined #ocaml
kandu is now known as Guest72748
nicholasf has joined #ocaml
jknick_ has quit [Ping timeout: 268 seconds]
jknick has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
ygrek has joined #ocaml
badon has joined #ocaml
nicholasf has quit []
jknick has quit [Ping timeout: 244 seconds]
Reshi has quit [Ping timeout: 250 seconds]
jknick has joined #ocaml
matason has joined #ocaml
matason has quit [Ping timeout: 246 seconds]
iorivur has joined #ocaml
seangrove has joined #ocaml
averell has joined #ocaml
sepp2k has joined #ocaml
iorivur has quit [Ping timeout: 260 seconds]
iorivur has joined #ocaml
kushal has joined #ocaml
Simn has joined #ocaml
Guest72748 has quit [Ping timeout: 260 seconds]
jwatzman|work has joined #ocaml
ygrek has quit [Ping timeout: 250 seconds]
dsheets has joined #ocaml
bba has joined #ocaml
sgronblo_ has joined #ocaml
jknick has quit [Ping timeout: 246 seconds]
jknick has joined #ocaml
kandu has joined #ocaml
kandu is now known as Guest28036
orbifx has joined #ocaml
<orbifx>
Any fictional programming languages for embedded programming?
<orbifx>
Any signs of ocaml running on a system without mmu?
pierpa has joined #ocaml
<companion_cube>
rust?
<companion_cube>
(well, it's not fictional)
<flux>
ocapic
<flux>
but it's not native afaik
<flux>
still, pretty cool!
<flux>
I don't see why you would need MMU for ocaml in any case
<flux>
does mirage on top of xen use mmu.. :)
<toolslive>
because you want to give each process its own memory space ?!
<toolslive>
but ocaml shouldn't be affected as far as I can see.
<reynir>
flux: from presentations I've watched I think no
<orbifx>
So gc can run in environments without mmu?
<toolslive>
you're contemplating to run ocaml on something like singularity?
<toolslive>
TempleOS ? ;)
<orbifx>
NuttX would be an example
<orbifx>
Lol, temple os.. crazy
<orbifx>
Impressive what someone can do even if schizophrenic
Nahra has joined #ocaml
vcfg has quit [Ping timeout: 250 seconds]
yegods has joined #ocaml
jknick has quit [Ping timeout: 260 seconds]
<sgronblo_>
Can someone help me get started with Core? I can't take working with the weak stdlib any more.
<sgronblo_>
Are we using some sort of sandboxes in the ocaml world when installing dependencies?
<Leonidas>
sgronblo_: no, the only way to sandbox would be to have multiple switches
<Leonidas>
sgronblo_: but OTOH compatibility is mostly pretty alright so you can just install all the things into one switch
<sgronblo_>
Whats a switch?
<Leonidas>
sgronblo_: an opam switch, basically a compiler with a set of libraries installed
<sgronblo_>
oh
<sgronblo_>
is the switch local to a project?
<sgronblo_>
i have opam installed
<Leonidas>
no, it's not
<sgronblo_>
do i need to start by explicitly creating a switch or?
<Leonidas>
it's like pre 1.18 cabal
jknick has joined #ocaml
<Leonidas>
sgronblo_: no, I would advise you to just run opam switch 4.02.3 and then opam install core.
<sgronblo_>
im not that versed in the various versions of cabal unfortunately
<Leonidas>
having sandboxes in opam would be cool tho'
yegods has quit [Remote host closed the connection]
<Leonidas>
no worries, I was just giving that as an example in case you were familiar with it :)
jknick has quit [Ping timeout: 240 seconds]
jknick has joined #ocaml
Kakadu has joined #ocaml
jknick has quit [Ping timeout: 276 seconds]
jknick has joined #ocaml
silver has joined #ocaml
seangrove has quit [Remote host closed the connection]
seangrove has joined #ocaml
kushal has quit [Quit: Leaving]
octachron has joined #ocaml
njrt has joined #ocaml
njrt has quit [Client Quit]
njrt has joined #ocaml
yegods has joined #ocaml
fraggle_ has quit [Read error: Connection reset by peer]
dsheets has quit [Remote host closed the connection]
tane has joined #ocaml
<reynir>
wow, I didn't have merlin installed on this laptop! :o
<orbifx>
Dangerous stuff
yegods has quit [Ping timeout: 260 seconds]
adelbertc has quit [Quit: Connection closed for inactivity]
Reshi has joined #ocaml
yegods has joined #ocaml
BitPuffin has joined #ocaml
<Leonidas>
oh, gasche has published an article on LWN!
dsheets has joined #ocaml
A1977494 has joined #ocaml
A19774941 has quit [Read error: Connection reset by peer]
fraggle_ has joined #ocaml
ggole has joined #ocaml
sepp2k has quit [Quit: Leaving.]
sepp2k has joined #ocaml
<orbifx>
Subscribers only
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
<sgronblo_>
Leonidas: so when i do opam install core it goes into some user-specific or global package storage?
StrykerKKD has joined #ocaml
<Leonidas>
sgronblo_: it goes to $HOME/.opam/<name-of-switch>/<path>
iorivur has quit [Quit: No Ping reply in 180 seconds.]
iorivur has joined #ocaml
StrykerKKD has quit [Quit: Konversation terminated!]
dsheets has quit [Remote host closed the connection]
<flux>
leonidas, "sandboxes in opam"? sounds like docker would be pretty suitable.
dsheets has joined #ocaml
<sgronblo_>
Leonidas: so if you would be developing two different projects with the same compiler version you are gonna be in a big mess?
yegods has quit [Read error: Connection reset by peer]
<Leonidas>
sgronblo_: why would you?
<Leonidas>
flux: I think docker would be kinda overkill (and not even possible for Windows users)
bba has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
copy` has joined #ocaml
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
<silver>
sgronblo_, there's "opam switch"
<silver>
it's not full-blown sandboxes as far as I know, but it lets you to work with different compilers
<toolslive>
the ocaml compiler is pretty strict so you don't accidentally link libraries that have a version mismatch.
<silver>
oh, you need same compiler but different set of dependencies
<Drup>
you can do several switches for the same compiler version using --alias-of
<toolslive>
the opam repository is almost a sandbox. you can have different opams installed next to each other on your system.
<silver>
oh that's cool
hcarty has joined #ocaml
<toolslive>
anybody any idea when opam's travis will move to a less ancient ubuntu <cough>16.04</cough> ?
<Leonidas>
toolslive: what is the issue with the current ubuntu?
<toolslive>
there's no issue in general, but if you're developing a library that needs system libraries that are not present on travis's ubuntu, you cannot automatically publish your package via opam
<toolslive>
as the package verification process fails.
yegods has joined #ocaml
<Leonidas>
toolslive: ah I see, this makes perfect sense. Is 16.04 available on travis already? I remember previous updates to be quite painful
<toolslive>
might be painful to upgrade, but new installs should be easy (and travis is docker like, so there it should be almost trivial)
bba has joined #ocaml
yegods has quit [Remote host closed the connection]
FreeBird_ has joined #ocaml
<Leonidas>
my point being that it is a point to be raised at Travis, not really at OPAM :)
<toolslive>
no. travis is not to blame. There are some scripts that are automatically invoked on opam-repository pull requests. These scripts start from ubuntu 12.04
FreeBirdLjj has quit [Ping timeout: 252 seconds]
FreeBird_ has quit [Ping timeout: 252 seconds]
<Leonidas>
toolslive: then filing a PR that switches that to 16.04 should be easy
<apache2>
let a ~(foo : int) = foo;; a ~foo:2 ;; (* so far so good *) ~foo:2 |> a ;; (*Error: Syntax error *)
<toolslive>
they are not my scripts
<apache2>
is there a reason you can't curry named/labeled arguments?
<Leonidas>
toolslive: but surely they are on github somewhere?
<hcarty>
apache2: ~foo:2 on its own is not valid OCaml syntax as far as I know
<ggole>
Hmm? You can curry named arguments fine.
<hcarty>
apache2: It's a limitation of labeled arguments that (2 |> a) won't work
<Leonidas>
yes, this does not work, because ~foo:2 would need to be an expression
<Leonidas>
but this is a very interesting catch
iorivur has quit [Quit: No Ping reply in 180 seconds.]
iorivur has joined #ocaml
<ggole>
It wouldn't work even if ~foo:2 was somehow an expression, since the type of |> is not compatible with a function argument of type name:_ -> _
Reshi has quit [Ping timeout: 260 seconds]
<apache2>
best I can come up with is
<apache2>
let a ~(foo : int) b = b ~foo ;; (a ~foo:2) @@ p ;;
FreeBirdLjj has joined #ocaml
<ggole>
Is there some reason you can't just apply the function?
<apache2>
and this to chain them, which also gets ugly ((a ~foo:2) @@ a) @@ p ;;
<apache2>
ggole: it was just a thought experiment based on yesterday's discussion about labeled/optional arguments
<ggole>
Hmm... you can "unlabel" a function like this: fun x y -> f x y
<ggole>
You could use that if you are desperate
<ggole>
Seems rather obscure to me though
fraggle_ has quit [Read error: Connection reset by peer]
noddy has joined #ocaml
njrt has quit [Quit: Page closed]
hxegon has joined #ocaml
Reshi has joined #ocaml
fraggle_ has joined #ocaml
<reynir>
hm, you can write [let (++) ~a ~b = a + b]
<reynir>
But you can't use the labels infix
bba has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
hxegon has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<apache2>
haha ggole
<Drup>
ggole: it's the usual technique ..
<Drup>
It's quite notorious that labels behaves badly with high order functions
<apache2>
but you can also do let x ~b ~c = b + c ;; x 1 2 ;;
kushal has joined #ocaml
<Drup>
apache2: that only works for total application
<sgronblo_>
Leonidas: if one project requires version x of one package and the other project requires another version?
<flux>
drup, I wonder if it can ever be fixed
<sgronblo_>
or am I missing something?
<flux>
because I happen to like the labels as a concept, perhaps not as how they work :(
<Drup>
flux: hard to say
<flux>
the worst offender IMO is conversion from labeled polymorphic functions to unlabeled in full application, but the partial cases are not-nice as well
<apache2>
the full application thing is not super nice either
<apache2>
I pretty much only use labels to distinguish arguments when they have the same type
<apache2>
like let power ~base ~nth = base ** nth ;;
<companion_cube>
it's also useful for partial application with |>
tane has quit [Quit: Verlassend]
<flux>
someone should implement type-guided application.. :)
tane has joined #ocaml
<apache2>
yes!
<flux>
doable with the typed ppx thingy I think.
<flux>
well except maybe for higher-order functions.. :)
<apache2>
speaking of types, I'm trying to implement a module with a type like `module type Make_t = functor (A: B) -> sig A :B type t end`
<apache2>
but I'm not sure how to create the `module Make : Make_t = struct ... end`
<lyxia>
module Make (A : B) = struct ... end
<apache2>
then I lose the 'type t' I added to the signature that I want it to implement
<lyxia>
module Make : Make_t = functor (A : B) -> struct ... end
<lyxia>
I didn't know we could do this 2 minutes ago.
<apache2>
neat, thanks!
<lyxia>
apache2: I wouldn't say you would lose the type t
<Leonidas>
sgronblo_: that doesn't happen as much as you fear it does :)
<apache2>
no, but I lose the ability to enforce it :)
<sgronblo_>
So how do I get merlin to realize that I have installed core and that List.split_n should be defined?
<lyxia>
apache2: right, something like that sounds better
<sgronblo_>
Leonidas: really? Ive seen it happening a lot in basically every other language so far.
<Leonidas>
usually projects depend on a version higher than X, not lower than Y, so that's not much of a problem in reality.
<Leonidas>
sgronblo_: Debian ships lots of Python packages and they don't all conflict with each other either :)
<apache2>
I deal with that problem /every/ /day/ in node.js
<apache2>
and in ruby on rails, and I don't code neither node.js nor ruby, so it's pretty frustrating.
<Leonidas>
apache2: doesn't npm duplicate dependencies for the exact versions?
<apache2>
there are options to install locally in the current directory for both
<apache2>
and you can use rbenv or similar to cheat
<Leonidas>
apache2: for me, every dependency comes with its own dependencies in a subdir
<Leonidas>
so I don't have conflicts in npm.
<apache2>
but it seems to me that we can do better in opam. I mean, we can figure out the exact interfaces we need, so we can fetch the latest version that satisfies the .mli
<Leonidas>
apache2: it's not that easy, since the interface might be the same, but a bug preventing an old version to be used nonetheless
<apache2>
each 'ABI' would have an incrementing version number to be able to issue non-breaking updates
<apache2>
sure, we can't detect if it will work, but we can detect if it won't, and refuse to run that.
<apache2>
the ability to have separate versions installed for separate software would be nice though. like if you want to compile ocaml-nocrypto pinned to your own branch for some purpose, and at the same time not reinstall all of mirage + everything every time you update that
<apache2>
not even sure how to implement that with switches if you want to use the same compiler version
<Drup>
opam switch foo --alias-of 4.02.3
SomeDamnBody has joined #ocaml
<SomeDamnBody>
Is there a way to test if two core_kernel maps have any common keys?
<apache2>
Drup: ah, nice!
sh0t has joined #ocaml
<SomeDamnBody>
Ah I think I can convert each to a sequence and just evaluate each key value pair
yegods has joined #ocaml
<apache2>
lyxia: hm, any idea how to to then do let f () = (module Make(A) : Make_t(A)) ?
<apache2>
I can do let f () = (module Make : Make_t) , but I don't get this "functor" syntax completely.
<sgronblo_>
hmm. i manged to screw up my merlin setup after i ran opam switch 4.02.3
<sgronblo_>
I'm not getting syntastic output any more
<lyxia>
apache2: It doesn't seem like valid syntax and I'm not sure what your intent is here
<apache2>
having a partially appplied signature to be able to deal with partially applied functors/modules?
hxegon has joined #ocaml
SomeDamnBody has left #ocaml ["Leaving..."]
leyyin has joined #ocaml
<octachron>
apache2, you cannot use functor application (i.e. Make_t(A)) at the type level, you need to write the resulting signature yourself
dsheets has quit [Remote host closed the connection]
dsheets has joined #ocaml
A19774941 has joined #ocaml
yegods has quit [Read error: Connection reset by peer]
yegods has joined #ocaml
<sgronblo_>
all right, i had forgotten i needed to re-install merlin for my newly created switch
Reshi has quit [Ping timeout: 240 seconds]
<sgronblo_>
so back to the original problem of merlin syntastic showing List.split_n as an error even though I installed core. any ideas?
A1977494 has quit [Ping timeout: 276 seconds]
<chelfi>
sgronblo_: I know next to nothing about merlin but I think you need make it aware of extra dependencies through a .merlin file or something along those lines
<chelfi>
I think it should look like "PKG core" in your case
seangrove has quit [Read error: Connection reset by peer]
seangrove has joined #ocaml
<Leonidas>
sgronblo_: does it compile?
<Leonidas>
maybe Merlin doesn't know it is supposed to check in core
<Leonidas>
and you need these PKG lines in your .merlin
<apache2>
is there a convenient way to printf a type definition?
<apache2>
or to force the compiler to spit it out at compile time?
seangrove has quit [Ping timeout: 246 seconds]
slash^ has joined #ocaml
<adrien>
"spit it out at compile time"?
yegods has quit [Read error: Connection reset by peer]
<sgronblo_>
what is PKG for?
<sgronblo_>
what editor do you guys use?
<hcarty>
apache2: merlin, ocamlc -i foo.ml, utop
<sgronblo_>
package perhaps?
yomimono has joined #ocaml
<hcarty>
sgronblo_: (neo)vim, emacs, atom, sublime text all seem to have reasonable support
<hcarty>
vim personally
yegods has joined #ocaml
<sgronblo_>
hmm, do i need to like open Core to use it?
<sgronblo_>
hmm nope
<sgronblo_>
List.split_n is still an unbound value
iorivur has quit [Quit: No Ping reply in 180 seconds.]
iorivur has joined #ocaml
<lyxia>
> The following modules will be in scope after you open Core.Std
yegods has quit [Remote host closed the connection]
<hcarty>
sgronblo_: 'open Core.Std'
<sgronblo_>
hcarty: ok fantastic, thanks
yegods has joined #ocaml
iorivur has quit [Client Quit]
iorivur has joined #ocaml
<apache2>
hcarty: that only gives you types for "public" things, not the instantiation of a functor 100 lines down from the main function
<hcarty>
apache2: I use merlin for that
<hcarty>
:MerlinTypeOf
mistermetaphor has joined #ocaml
<sgronblo_>
oh my god, this is so awesome
<hcarty>
And :MerlinYankLatestType if I need the text of the type
Kyo9142 has joined #ocaml
yegods has quit [Remote host closed the connection]
orbifx has quit [Quit: AtomicIRC: The nuclear option.]
hxegon has quit [Ping timeout: 260 seconds]
iorivur has quit [Quit: No Ping reply in 180 seconds.]
profan_ is now known as profan
Kyo9142 has quit [Ping timeout: 252 seconds]
g4143 has joined #ocaml
Kyo9142 has joined #ocaml
<g4143>
Ubuntu 16.04 and Python 3/Vim/Merlin problems. Has anyone heard of a solution?
<sgronblo_>
oh yay, now the indentation works too after installing ocp-indent
GG4143 has joined #ocaml
GG4143 has quit [Client Quit]
<sgronblo_>
what was the name of the proper regex library for ocaml?
<orbitz>
If I have a variant that I know will be used in an option almost all the time, is it worth collapsing the None value into being part of the variant? Seems like I could be giving myself an extra layer of allocation if I use option
<hcarty>
sgronblo_: re
<hcarty>
sgronblo_: That one's pure OCaml
<hcarty>
There are also bindings to PCRE
<sgronblo_>
im interested in the one that has the nicest API
<hcarty>
g4143: What's the problem? Haven't tried that combination yet.
<Drup>
sgronblo_: re then
<hcarty>
orbitz: If the addition of a My_none case doesn't make things ambiguous then it seems like an reasonable thing to do
<g4143>
hcarty: Ubuntu 16.04 has Python 3 instead of Python 2 and apparently merlin/vim does not play with Python3.
<orbitz>
hcarty: I am thinking of using polymorphic variants and I could just ahve `None in each variant, that should work, right?
<hcarty>
g4143: There should be a python2 package (not sure what the name is) available to install as a work-around
wiredsister has joined #ocaml
<hcarty>
orbitz: It should, yes
<orbitz>
I belive polymorphic variants consume an extra word but I don't think that is an extra allocation, just a bigger allocation, but I could be wrong.
<Drup>
orbitz: benchmark, but I'm not sure the cost of having one less indirection is bigger than the cost of using polymorphic variants
nicoo has quit [Ping timeout: 240 seconds]
<Drup>
If you were to use non-poly variants, then maybe, but unless it's in a hot loop, it doesn't matter
<g4143>
hcarty: I was thinking about that too but I but I'm wondering what else I would break if I installed Python2.
ygrek has joined #ocaml
<orbitz>
Drup: in this case I expect to be creating and destroying these type of objects a lot.
<orbitz>
Drup: but yes, I'll benchmark of course.
<Drup>
Then don't use poly variants
<orbitz>
Drup: how come?
<Drup>
they are slower
<Drup>
use normal variants
darkf has quit [Quit: Leaving]
badon has quit [Disconnected by services]
badon_ has joined #ocaml
badon_ is now known as badon
<orbitz>
Drup: how come they are slower?
<orbitz>
I can get away with a normal variant in this case, I'm just curious.
hxegon has joined #ocaml
badon has quit [Remote host closed the connection]
shinnya has joined #ocaml
<Drup>
Hum, apparently, they store only one extra integer
<Drup>
Right, constructors for extensible types store much more information, poly variant is not so costly
<sgronblo_>
I find it cute and a little bit worrying that the benchmarks for ocaml-re are reported to have been run on a pentium III 500 Mhz
<Drup>
sgronblo_: me too, I didn't wanted to touch them, I feel it has sentimental value :D
<orbitz>
There is probably a compiled version of the docs around somewhere, but it won't tell you much more than that itnerface file
nicoo has joined #ocaml
<orbitz>
Usually I just fire up utop and do like #show Re;;
<companion_cube>
ocp-browser is nice for this
<orbitz>
or whatever library. I, usually, find teh tyep ssufficient.
<ggole>
One extra integer?
<sgronblo_>
what was this val stuff again?
<ggole>
Oh, because the tag byte is too small. Right.
<orbitz>
sgronblo_: it just says the type of a value
<sgronblo_>
is this just how its done in .mli files?
<orbitz>
it's the interface quivalent of 'let'
<orbitz>
let f x y = x + y ==> val f : int -> int -> int
<sgronblo_>
yeah, makes sense
lokien_ has joined #ocaml
yegods has joined #ocaml
<sgronblo_>
oh so with this re thing you dont write a crappy string and then pray you got everything right? you build up a regular expression by combination?
<orbitz>
Yes
<Drup>
You can also write a crappy string if that's what you like (there are several modules implementing various syntaxes)
<sgronblo_>
Drup: no, i hate writing crappy strings :)
<Drup>
me too, but for some reason, some people do
<Drup>
regex combinators are nice, though
<sgronblo_>
well some people like using dynamic typing too, and believe there is something good about that
<sgronblo_>
so how do i say match this first and then that?
g4143 has quit [Quit: Leaving]
<Drup>
seq
<orbitz>
sgronblo_: if you haven't already, you should run utop and play with some stuff in the repl
<sgronblo_>
Drup: thanks, was going up and down the .mli file but didnt notice seq
<sgronblo_>
heres another thing i dont get, i was able to search for re in opam and found re and then can install it. but how do i figure out what i need to add to .merlin and what i need to open in my file to use the new dependency.
<sgronblo_>
I'm guessing the thing that goes into .merlin should be the same as the name i use with opam install?
<sgronblo_>
but what about the module name?
<Drup>
for well behaved packages, it's easy
<Drup>
(for example, it's re, re and Re ...)
<Drup>
you can run that too: ocamlfind list | grep "re"
<sgronblo_>
well for core it wasnt Core
<Drup>
the module name ? It was core
<Drup>
Core*
adelbertc has joined #ocaml
<orbitz>
Does merlin make you put module names in its config?
<Drup>
No, it's the ocamlfind name
<sgronblo_>
yeah there is a .merlin file that you have add a new PKG entry for
<orbitz>
ok
<sgronblo_>
ah so its not technically the module name i guess
<sgronblo_>
but i need to know the module name by the time i attempt to use it at least
<orbitz>
no, it' sthe package naem
octachron has quit [Quit: Page closed]
Simn has quit [Quit: Leaving]
<orbitz>
sgronblo_: since you are reading re.mli, and file's map to module names, it'd be Re
dsheets has quit [Remote host closed the connection]
<sgronblo_>
orbitz: ah
sepp2k has quit [Quit: Leaving.]
dsheets has joined #ocaml
cdidd has quit [Ping timeout: 246 seconds]
cdidd has joined #ocaml
sepp2k has joined #ocaml
<sgronblo_>
hmm unbound module Group
<orbitz>
Re.Group
cdidd has quit [Read error: Connection timed out]
cdidd has joined #ocaml
<sgronblo_>
unbound module Re.Group
yegods has quit [Ping timeout: 246 seconds]
<orbitz>
Works for me
<orbitz>
Depending on where you are you probably aren't linking against Re
<Drup>
sgronblo_: update your re
yegods has joined #ocaml
Kyo9142 has quit [Ping timeout: 260 seconds]
jeffmo has joined #ocaml
yegods has quit [Remote host closed the connection]
sepp2k has quit [Quit: Leaving.]
yomimono has quit [Ping timeout: 250 seconds]
j0sh has quit [Ping timeout: 244 seconds]
j0sh has joined #ocaml
jwatzman|work has quit [Quit: jwatzman|work]
yegods has joined #ocaml
hxegon has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<twobitsp1ite>
is there any way to have multidimensional bigarrays of structs?
hxegon has joined #ocaml
dsheets has quit [Remote host closed the connection]
dsheets has joined #ocaml
ollehar has joined #ocaml
dsheets has quit [Ping timeout: 250 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
yegods has quit [Read error: Connection reset by peer]
ollehar has quit [Quit: ollehar]
yegods has joined #ocaml
<hcarty>
twobitsp1ite: No, not really
<hcarty>
twobitsp1ite: Are these OCaml record types or C structs?
<hcarty>
For OCaml records you could create a set of bigarrays, one per field, if all the fields fit into the available bigarray types
Anarchos has joined #ocaml
marsam has joined #ocaml
noddy has quit [Ping timeout: 260 seconds]
lokien_ has quit [Quit: Connection closed for inactivity]
Kakadu has quit [Quit: Page closed]
hxegon has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
hxegon has joined #ocaml
badon has joined #ocaml
yegods has quit [Ping timeout: 260 seconds]
dch has quit [Read error: Connection reset by peer]
shinnya has quit [Ping timeout: 244 seconds]
yegods has joined #ocaml
dch has joined #ocaml
wiredsister has quit [Ping timeout: 244 seconds]
sh0t has quit [Ping timeout: 250 seconds]
BitPuffin has quit [Read error: Connection reset by peer]
tane has quit [Ping timeout: 276 seconds]
Kakadu has joined #ocaml
ggole has quit []
tane has joined #ocaml
yegods has quit [Ping timeout: 246 seconds]
<hcarty>
Drup: There was a discussion somewhat recently about concurrent consumers from a feed in Lwt. What is the recommended way to handle N consumers for one Lwt_stream.t?
<Drup>
frankly, I don't know this part of the codebase and I never used lwt_stream.
<companion_cube>
lalala
<hcarty>
Drup: Fair enough, on to other options
dsheets has joined #ocaml
dsheets has quit [Remote host closed the connection]
<companion_cube>
hcarty: what other options are you considering?
mistermetaphor has quit [Read error: Connection reset by peer]
<hcarty>
companion_cube: That's what I need to figure out :-) And now talking to you... maybe GenM?
mistermetaphor has joined #ocaml
<hcarty>
I'm not sure if that would work though
<companion_cube>
no, but I have a Lwt_pipe
<companion_cube>
although it probably needs more thorough testing
<hcarty>
Ah, maybe that's what I was thinking of. Is that in Containers or outside of it?
<companion_cube>
it's outside currently, I removed the lwt stuff from containers
<hcarty>
Ah, I see - containers-lwt
<hcarty>
companion_cube: Thanks!
<hcarty>
I'll give it a try
<companion_cube>
take a look in it, first, if you have a bit of time
<companion_cube>
it needs a bit more testing, really
slash^ has quit [Read error: Connection reset by peer]
<companion_cube>
but hopefully it should be robust, design-wise (can block writers and readers)
mistermetaphor has quit [Remote host closed the connection]
matason has joined #ocaml
<companion_cube>
hcarty: if you want, we can make a separate library for this
<hcarty>
The pull configuration of Lwt_stream is nice as I want the consumers to dictate the rate of stream progress
<companion_cube>
Lwt_stream?
<hcarty>
Lwt_stream.from leaves the generation rate up to the consumer rather than the producer
<companion_cube>
ah yeah
<companion_cube>
this should work with lwt_pipe, too (if you give it a bounded size)
malc_ has joined #ocaml
<hcarty>
companion_cube: And yes, a separate library would be good. I've needed this some kind of thing a handful of times. If I come up with something useful I'll contribute it back, either to Lwt_pipe or a new library if that makes more sense
<companion_cube>
do you want me to create a repo then?
mistermetaphor has joined #ocaml
<hcarty>
For Lwt_pipe?
<companion_cube>
yeah
<hcarty>
Sure, thanks
yegods has joined #ocaml
<companion_cube>
ok, just a sec
<companion_cube>
so much boilerplate for creating a new project...
<hcarty>
My preference goes to lwt-pipe in both, but as long as they're consistent I'm ok with the naming
<companion_cube>
but I'm not sure, does findlib handle 'lwt-pipe' properly?
<hcarty>
It should. I have a few foo-bar libraries installed
<companion_cube>
hmmm
<companion_cube>
ok, give me a sec
<companion_cube>
but not for .cmxa files?
ygrek has quit [Ping timeout: 260 seconds]
<companion_cube>
ok, changed it
<companion_cube>
also, changed the repo name
mcc has joined #ocaml
<hcarty>
companion_cube: Thanks - and I'm not sure for the .cm* files, I don't recall
sh0t has joined #ocaml
yegods has quit [Read error: Connection reset by peer]
yegods has joined #ocaml
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 250 seconds]
<hcarty>
companion_cube: Why is the error type built into the basic pipe?
ygrek has joined #ocaml
matason has quit [Ping timeout: 260 seconds]
leyyin has quit [Quit: So Long, and Thanks for All the Fish]
<companion_cube>
hmm, I don't even remember exactly
<companion_cube>
I think it's because this is designed for IO, so failures are to be expected everywhere
ygrek has quit [Ping timeout: 268 seconds]
ygrek_ has joined #ocaml
<companion_cube>
do you think it's really bad?
tcpc has joined #ocaml
jeffmo has quit [Quit: jeffmo]
<hcarty>
I would prefer that it not be in the base type, so for example a consumer of Lwt_pipe.read isn't forced to handle a potentially unused error case
<companion_cube>
but what if there is a failure during the read?
sh0t has quit [Ping timeout: 250 seconds]
<hcarty>
My immediate use is a program which grabs files, does a bit of processing, then shoves the successful results into a stream/pipe
<companion_cube>
note that I can add _exn alternatives to most functions
<companion_cube>
that would use Lwt.fail instead
<hcarty>
I don't think there should be an assumption that failure is possible
<companion_cube>
oh.
<hcarty>
In my current use case the producer only pushes onto the pipe if there is a valid value to push and the consumer relies on that
<hcarty>
consumers that is
<companion_cube>
yes, but the input is a file
<companion_cube>
and this can fail
<hcarty>
For Lwt_pipe.IO that's true
<companion_cube>
and failures should propagate through the pipe
yegods has quit [Ping timeout: 250 seconds]
<hcarty>
But in this case if the producer fails it just moves onto the next item on its list of things to handle - downstream doesn't care about those failures so they never get written to the pipe
<hcarty>
s/this/my current/
<hcarty>
Imagine: read a line -> if the line is valid then push (f line) to the pipe else repeat
<companion_cube>
but other users might want to know about failures
<companion_cube>
(if you have read_exn, etc., it should be fine, shouldn't it?)
<hcarty>
And in that case a user can explicitly write 'a Result.result to the pipe
<hcarty>
If it's read_exn then there's a hidden failure state
<companion_cube>
ok, fair enough
<companion_cube>
I'll change this then
<companion_cube>
opinion on the pseudo ownership thingie?
<hcarty>
The `r, `w permissions?
yegods has joined #ocaml
<hcarty>
I need to leave for now, but thank you! What's there already works after dropping it into my existing code. Take care and have a good night
<companion_cube>
nice!
<companion_cube>
good night
<companion_cube>
I was more asking about the `connect` part
hcarty has quit [Ping timeout: 244 seconds]
cross has joined #ocaml
jeffmo has joined #ocaml
jeffmo has quit [Read error: Connection reset by peer]
marsam has quit [Read error: Connection reset by peer]
jeffmo has joined #ocaml
tane has quit [Quit: Verlassend]
sh0t has joined #ocaml
malc_ has quit [Remote host closed the connection]
MercurialAlchemi has quit [Ping timeout: 250 seconds]
mistermetaphor has quit [Remote host closed the connection]
mistermetaphor has joined #ocaml
jeffmo has quit [Read error: Connection reset by peer]
jeffmo has joined #ocaml
ygrek_ has quit [Ping timeout: 252 seconds]
jeffmo has quit [Read error: Connection reset by peer]
jeffmo has joined #ocaml
Simn has joined #ocaml
hxegon has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ollehar has joined #ocaml
yegods has quit [Ping timeout: 246 seconds]
hxegon has joined #ocaml
yegods has joined #ocaml
Simn has quit [Quit: Leaving]
dr_toboggan has quit [Remote host closed the connection]
hcarty has joined #ocaml
hcarty has quit [Ping timeout: 260 seconds]
eagleflo has joined #ocaml
A19774941 has quit [Quit: Leaving.]
pierpa has quit [Read error: Connection reset by peer]
pierpa has joined #ocaml
Kakadu has quit [Remote host closed the connection]
mcc has quit [Quit: Connection closed for inactivity]
ygrek_ has joined #ocaml
yegods has quit [Ping timeout: 250 seconds]
pyon is now known as loli-pyon
badon has quit [Disconnected by services]
badon_ has joined #ocaml
badon_ is now known as badon
darkf has joined #ocaml
yegods has joined #ocaml
sh0t has quit [Ping timeout: 276 seconds]
madroach has quit [Ping timeout: 244 seconds]
mistermetaphor has quit [Read error: Connection reset by peer]
mistermetaphor has joined #ocaml
madroach has joined #ocaml
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
rgrinberg has joined #ocaml
yegods has quit [Ping timeout: 276 seconds]
tcpc has left #ocaml ["WeeChat 1.2"]
mistermetaphor has quit [Read error: Connection reset by peer]