<companion_cube>
my list of issues for containers 1.2 looks… big :D
AlexDenisov has quit [Remote host closed the connection]
richi235 has joined #ocaml
infinity0 has joined #ocaml
Onemorenickname has joined #ocaml
<Leonidas>
companion_cube: may I add something like Stringext.split? :p
dhil has joined #ocaml
<TheLemonMan>
companion_cube, I can send you a PR with a tail-recursive List.combine :)
<Leonidas>
with a ~max argument :)
dmi3y has joined #ocaml
<Onemorenickname>
I have a module type with a module Elt with type t. In module type is defined a type value depending on type Elt.t
<Onemorenickname>
How can I enforce that value = Elt.t ?
<Onemorenickname>
(like a recursive definition)
<Onemorenickname>
Actually, it's better formulated as : I have two mutually recursive types defined in different modules, can I do that ?
<flux>
onemorenickname, no. usually the solutions are: 1) define one of the types polymorphic, so it the recursion can be parametrized 2) move the definitions to the same file and use same-module-solutions.
<Onemorenickname>
oh.
<Onemorenickname>
it's not only about two types, but also about many functions.
<Onemorenickname>
sadness.
<flux>
functors may be then be similarly helpful
<flux>
or objects!
<Onemorenickname>
I was doing this with functors
<Onemorenickname>
But got problems with constraint
<Onemorenickname>
constraints
<Onemorenickname>
Hence my question
govg has quit [Ping timeout: 240 seconds]
<companion_cube>
Leonidas: there are split functions in CCString
<companion_cube>
but maybe a ~max argument can help
<companion_cube>
if it's not there already
<Leonidas>
companion_cube: yes, I know, but ~max is missing and it's kinda awkward
<Leonidas>
took me a while to realize I was looking for CCString.Split.list_cpy
<Leonidas>
Drup: your tyre example from 0.2 does not work
<Leonidas>
Drup: it can't find <*>
<companion_cube>
Leonidas: honestly I might add a simple alias to Split.list_cpy
<companion_cube>
sth like CCString.split_list
<Leonidas>
companion_cube: maybe, yeah. I was wondering why _cpy, but then when I saw "regular", non-cpy result, with indices I understood what was happening
<companion_cube>
yeah, yeah, but in retrospect I should have made "_cpy" the default
<companion_cube>
anyway, a simple alias might help
<Leonidas>
companion_cube: why reimplementing split_at_char and then using cppo to not use it?
<Leonidas>
Tyre is intriguing
<companion_cube>
Leonidas: rather, reimplement it, and alias to split_at_char if it's present
<companion_cube>
so it's available on all versions of OCaml
<companion_cube>
now I'm excited by the perspective of a better bitvector implem!!
<Leonidas>
Drup: is there a way to have a <&> that will spit out a list of matches instead of 2-tuples?
<Leonidas>
Drup: Tyre.(int <&> (str" " *> int) <&> (str " " *> int)) is what I have, but I'd rather have an int list as a result
<TheLemonMan>
companion_cube, what's the point of combining the two recursion schemes?
<companion_cube>
o/
<companion_cube>
speed :-)
<companion_cube>
in the particular case of short lists
<companion_cube>
direct recursion is slightly faster
<companion_cube>
that's why benchmarks are good, too
<mrvn>
why doesn't inlineing make that the same? Are recursions never inlined?
<companion_cube>
inlining doesn't change the coe
<companion_cube>
code
<companion_cube>
it just removes some function calls
<companion_cube>
but it will not turn List.rev_map into List.map :-)
<mrvn>
true, but why would you want that? I usualy go the other way.
<companion_cube>
well sometimes you want to keep the order of elements
<companion_cube>
so List.map
<companion_cube>
but you also want tail-rec functions
<mrvn>
yeah, you want to reverse two places so they balance.
<companion_cube>
so CCList.map is actually a mix of both (direct style on the first elements, then List.rev_map |> List.rev on the remaining elements if the list is long)
<mrvn>
wasn't the best to split the data into chunks, make normal lists for each chunk and then stitch them together by modifying the tail of each list?
<companion_cube>
mutation? that's black magic ^^
<mrvn>
not black, just Obj. :)
<companion_cube>
honestly that is black magic
<companion_cube>
I don't touch Obj
<companion_cube>
except in very very rare cases
<companion_cube>
(e.g. to change the tag on some array of integers)
<companion_cube>
but that's really something I try to avoid
<companion_cube>
especially now with flambda :-)
<def`>
(and in preparation of multicore)
<mrvn>
you would need linear types to create a mutable list and then turn it into a immutable list.
<companion_cube>
yeah, if I had linear types many things would be different
<companion_cube>
including iterators…
MK__ has joined #ocaml
sepp2k has joined #ocaml
<TheLemonMan>
companion_cube, done!
<companion_cube>
just missing the authors entry, I believe :-)
<sspi>
can anyone fix the js_of_ocaml website? thanks
<TheLemonMan>
it should be in now, sorry for the noise :)
govg has joined #ocaml
mfp has joined #ocaml
`slikts has joined #ocaml
<Drup>
Leonidas: you could easily write a converter for that
<Drup>
There is a bug report that talk about having bounded repetition, which would probable solve that problem
<Drup>
(I just fixed the example in the readme, thanks for the report)
<Leonidas>
Drup: you mean with Tyre.conv? (Sorry, if I'm being dense)
<Drup>
yes
zpe has joined #ocaml
al-damiri has joined #ocaml
<Leonidas>
Drup: ok, so I have a converter val tup3 : (('_a * '_b) * '_c) Tyre.t -> ('_a * '_b * '_c) Tyre.t = <fun>
<Drup>
eta expand.
<Drup>
let tup3 re = conv f g re
<Leonidas>
turns out I wanted tup4 :)
<Drup>
I have a branch named "tuple"
<Drup>
It's not merged in just yet, because my conclusion was that most of the time, you actually want to return records, but I could change my mind, given a sufficiently convincing API.
<mrvn>
if we had named tuples there would be no difference.
Onemorenickname has quit [Ping timeout: 258 seconds]
<Leonidas>
Drup: I have to say, I quite enjoy the Tyre API
<Drup>
cool :)
octachron has joined #ocaml
nomicflux has joined #ocaml
nomicflux has quit [Client Quit]
dhil has quit [Ping timeout: 240 seconds]
Onemorenickname has joined #ocaml
nomicflux has joined #ocaml
nomicflux has quit [Client Quit]
<TheLemonMan>
qtest is a really cool piece of software
Onemorenickname has quit [Remote host closed the connection]
Onemorenickname has joined #ocaml
Onemorenickname has quit [Remote host closed the connection]
Onemorenickname has joined #ocaml
Onemorenickname has quit [Remote host closed the connection]
<companion_cube>
isn't it? :-)
<TheLemonMan>
same goes for its mantainer heh
dhil has joined #ocaml
<companion_cube>
well I'm only the maintainer, not the author
andrewalker has joined #ocaml
kamog has quit [Remote host closed the connection]
richi235 has quit [Ping timeout: 255 seconds]
ciniglio has joined #ocaml
richi235 has joined #ocaml
rpg has joined #ocaml
sh0t has joined #ocaml
Mercuria1Alchemi has quit [Ping timeout: 240 seconds]
dmi3y has quit [Ping timeout: 255 seconds]
copy` has joined #ocaml
moei has joined #ocaml
dhil has quit [Ping timeout: 260 seconds]
govg has quit [Ping timeout: 260 seconds]
AltGr has left #ocaml [#ocaml]
AltGr has joined #ocaml
dhil has joined #ocaml
jbrown has quit [Quit: Leaving]
dmi3y has joined #ocaml
nahra has quit [Remote host closed the connection]
nahra has joined #ocaml
nahra has quit [Remote host closed the connection]
<kapitan>
of course, I was trying to find \< everywhere :)
ryanartecona has quit [Quit: ryanartecona]
<kapitan>
great thanks a lot, btw I am trying to port some of the tuareg2 code to be able to identify phrase in Reason
ryanartecona has joined #ocaml
<Drup>
reason doesn't have an emacs mode ?
<kapitan>
it does, but it does not understand phrases, which I would like to have...and send then to their equivalent to utop
<Drup>
right
<Drup>
that should be easier in reason, with all the explicit { } delimiters
<Leonidas>
Did OCaml 4.04 add result but without any >>=?
dhil has quit [Ping timeout: 260 seconds]
<kapitan>
it should be easy yeah, I am just porting from tuareg, then probably refine. OCaml syntax is very new to me so I am a bit overwhelmed now :D
<companion_cube>
Leonidas: well some libraries provide >>= ;)
MK__ has joined #ocaml
maarhart has joined #ocaml
<Leonidas>
companion_cube: there is CCPervasives?
mrshark has joined #ocaml
<companion_cube>
in CCResult
<Leonidas>
<3
orbifx has quit [Ping timeout: 255 seconds]
<Leonidas>
I find it increasingly difficult to program OCaml without containers
<octachron>
Leonidas, the idea was to only add the type in stdlib for compatibility's sake and let external libraries implements a proper interface around the type
<mrshark>
Hey guys! I have a (hopefully) quick question about why my compile is erroring out. I'm pretty new to the OCaml env, and when I'm using oasis to compile a project that uses Opium, I get the error "Reference to undefined global `Opium'". Anyone have any idea what's going on?
<mrshark>
For reference, I'm running `ocaml setup.ml -build`, which I _think_ is the default build command. As I said, I'm pretty new to tne env
<Drup>
you added opium to your dependencies in the _oasis file ?
<mrshark>
Yeah
<mrshark>
I have `BUildDepends: opium` in there at least
<mrshark>
that's all I need right?
<Drup>
did you re-run oasis setup after modifying said _oasis file :)
<mrshark>
yeah
<Drup>
hum.
<Drup>
I invoke rgrinberg
<mrshark>
haha I missed that the first time actually, but ran it and now I think this is my last barrier to compilation :P
maarhart has quit [Ping timeout: 260 seconds]
<mrshark>
If it helps, when I compile it directly with `ocamlbuild -pkg opium main.native`, I get the following errors:
<mrshark>
Opium_app referenced from main.cmx
<mrshark>
and:
<mrshark>
Opium referenced from main.cmx
<companion_cube>
Leonidas: heh… 1.2 will be big
<rgrinberg>
mrshark: which version of opium do you have installed?
<mrshark>
uhh 0.15.1
<mrshark>
rgrinberg:
<rgrinberg>
Ok I'll be back home in 20 minutes and will help you out. Meanwhile see if pinning to dev solves the issue for you
<mrshark>
Ooo I'll try that rgrinberg
<mrshark>
how do I do that? hah
<mrshark>
opam pin?
<rgrinberg>
Opam pin add opium --dev-repo
kakadu has quit [Quit: Konversation terminated!]
<mrshark>
rgrinberg: got it pinned, thanks!
<mrshark>
Still ahving the same issue unfortunately
pitastrudl has quit [Remote host closed the connection]
<mrvn>
BUildDepends or BuildDepends
<mrshark>
I'm definitely just doing something wrong in the compile process and I don't know
<mrshark>
@mrvn: I'm using `BuildDepends`
pitastrudl has joined #ocaml
<mrshark>
I just wiped everythign and here's what I ran: oasis setup; ocaml setup.ml -configure; ocaml setup.ml -build
jao has joined #ocaml
zpe has joined #ocaml
pandabo has joined #ocaml
<rgrinberg>
mrshark: do you have somthing on github that we can look up?
<rgrinberg>
mrshark: and what's inside main.ml btw?
<companion_cube>
hmm, is it me or is pp_print_text weirdly implemented?
<companion_cube>
like, it prints char by char
maarhart has joined #ocaml
<Drup>
yes
<Leonidas>
Drup: is there a way to expand a 'a Tyre.gen into an 'a list?
<Leonidas>
I saw that the .ml has a Gen.to_list but it seems not to be exposed
<Drup>
Leonidas: Tyre.list ?
maarhart has quit [Ping timeout: 252 seconds]
<Drup>
if you want lists, you can use Tyre.list instead of Tyre.rep, and it should work alright
<companion_cube>
ok, this is weird
<companion_cube>
well that gives me a good excuse to reimplement it
<Leonidas>
ah. I was surprised how that woudl work with Tyre.gen
<Drup>
Leonidas: also, in general, Tyre.gen = Gen.t
<Drup>
if you want to do anything remotely complex with gen, use the gen library
<Leonidas>
Drup: excellent, Tyre.list was exactly what I was looking for
pandabo has quit [Quit: pandabo]
<Leonidas>
though I would argue, it has a strange name
<rgrinberg>
mrshark: ah yes, you should use -pkg opium.unix
<mrshark>
ahhh
<mrshark>
okay so I built it using ocamlbuild
<mrshark>
any idea how to do that with that setup.m
<mrshark>
setup.ml?
<mrshark>
Ooo just changed BuildDepends: opium to BuildDepends: opium.unix and it worked like a charm!
<mrshark>
I gotta get into this build process more, there are so many filetypes that I don't know about
spew has quit [Quit: foobar]
<mrshark>
thanks for the help rgrinberg !
<rgrinberg>
yup you got it. it will be a lot simpler in the next version hopefully. There will be two opam packages so it should be obvious which one you'd be using
<mrshark>
ahh, like a unix one and a non-unix one?
<rgrinberg>
Tentatively it's going to be opium and opium_kernel (where opium is the unix one).
<rgrinberg>
the point being that opium-unix is far more popular so it should have the shorter name
<mrshark>
gotya, that totally makes sense
<mrshark>
I look forward to it!
rpg_ has joined #ocaml
rpg_ has quit [Read error: Connection reset by peer]
mrshark has left #ocaml [#ocaml]
rpg has quit [Read error: Connection reset by peer]
rpg_ has joined #ocaml
rpg_ has quit [Read error: Connection reset by peer]
ryanartecona has joined #ocaml
dmi3y has quit [Quit: dmi3y]
_andre has quit [Quit: leaving]
<Drup>
rgrinberg: maybe you should swap the ocamlfind name, then :)
<Drup>
opium and opium.kernel
<rgrinberg>
Drup: yup, I wlil do that. Except that I will not use findlib sub packages
<rgrinberg>
those are a nuisance that I've always regretted using
<kapitan>
can I ask another newbie question? what is a monadic operator in OCaml/Reason?
pandabo has joined #ocaml
pandabo has quit [Client Quit]
<rgrinberg>
kapitan: do you mean bind?
<octachron>
kapitan, your question is two question in one, "what is a monad/a monadic operator" and "how monads are implemented in OCaml/Reason"; which one did you mean to ask?
pandabo has joined #ocaml
florian_ has joined #ocaml
ollehar has joined #ocaml
Simn has quit [Quit: Leaving]
<kapitan>
octachron: yep I know the concept of monad, probably my question is more the latter, I guess there is a custom operator for bind in OCaml?
florian_ has left #ocaml ["Leaving"]
<octachron>
kapitan, like in haskell, it is possible to define custom operator in OCaml, so (>>=) is commonly used for bind
orbifx has joined #ocaml
<octachron>
ie. "let (>>=) = bind "
<kapitan>
ok yeah, I am familiar with Haskell >>= too, so thanks, now I know that is no rocket science :)
<kapitan>
I guess it is so common that there is a specific `reason-in-monadic-op-p` predicate in tuareg2 (OCaml light)
<octachron>
does reason use the name "Ocaml light"?, it is a bit of an unfortunate name
<kapitan>
no no
<kapitan>
I mean, I found it in tuareg-light.el :) Sorry did not want to mixup thing, Reason is Reason, OCaml light is OCaml light
tane has quit [Quit: Leaving]
moei has quit [Quit: Leaving...]
maattdd_ has joined #ocaml
maattdd has quit [Ping timeout: 240 seconds]
<_y>
OCaml Light is not
maattdd has joined #ocaml
maattdd_ has quit [Ping timeout: 240 seconds]
octachron has quit [Ping timeout: 260 seconds]
<tautologico>
there was Caml Light, then Objective Caml, now OCaml