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
lobo has quit [Quit: leaving]
lobo has joined #ocaml
Kakadu has quit [Remote host closed the connection]
oxcsh has joined #ocaml
oxcsh has quit [Ping timeout: 240 seconds]
sh0t has quit [Ping timeout: 240 seconds]
dhil has quit [Ping timeout: 246 seconds]
cat5e has quit [Ping timeout: 276 seconds]
cat5e has joined #ocaml
tennix has quit [Ping timeout: 244 seconds]
tennix has joined #ocaml
ygrek has joined #ocaml
keep_learning has quit [Quit: This computer has gone to sleep]
Anarchos_ has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
arjunguha has joined #ocaml
arjunguha has quit [Client Quit]
nuuit2 has quit [Ping timeout: 248 seconds]
struk|desk|away is now known as struk|desk
hxegon has quit [Ping timeout: 244 seconds]
FreeBirdLjj has joined #ocaml
Reshi has joined #ocaml
silver_ has joined #ocaml
silver_ has quit [Max SendQ exceeded]
silver_ has joined #ocaml
silver has quit [Ping timeout: 246 seconds]
silver_ has quit [Client Quit]
struk|desk is now known as struk|desk|away
ygrek has quit [Ping timeout: 240 seconds]
shinnya has quit [Ping timeout: 252 seconds]
yunxing has quit [Remote host closed the connection]
Vintila has joined #ocaml
struk|desk|away is now known as struk|desk
<Vintila> Any reason why #load "obj.cmo" works in top but not utop?
jayphelps has joined #ocaml
tennix has quit [Ping timeout: 252 seconds]
tennix has joined #ocaml
<jayphelps> noob question to FP langs: I really like the self-documenting nature of explicitly providing parameter type annotations and while langs like ocaml let do you so, I rarely see it in the wild. I presume FP people don't feel that same self-documenting advantage in practice or am I missing something?
<pierpa`> sometimes the code has a more general type then what you are thinking of. This is good. Constraining it to what is your current need is bad.
oxcsh has joined #ocaml
<pierpa`> and also, sometimes type expressions can get very complicated and writing them down is a hassle
<pierpa`> better to let the compiler figure them out
pierpa` is now known as pierpa
<jayphelps> pierpa: I def see that, just obv see a different pros vs cons result. like most things I assume I'll just get used to it and eventually even prefer it hah
oxcsh has quit [Ping timeout: 240 seconds]
<pierpa> Just try writing them by hand. You'll tire soon :)
<jayphelps> pierpa: I have been, actually. I'm used to it from my day-langs.
<Drup> jayphelps: people do it in ocaml too, in .mli files
<jayphelps> just trying to adopt community preferences now that I'm getting the swing of ocaml
<pierpa> I see. But types in Ocaml can get much more complicated than one typically gets in other languages
<jayphelps> pierpa: I prolly haven't written any sufficiently complex ocaml to see that yet.
<jayphelps> or we vary on our definitions of complex :)
<pierpa> :)
<jayphelps> Drup: :thumbsup
<jayphelps> 'ppreciate the chime-ins from all. I don't want to fight the community preferences, just understand how they landed on them so I can accept it
<pierpa> nobody will frown on code with type annotations, I think :)
<pierpa> just nobody does it because it's tedious
<jayphelps> that's good to hear.
<pierpa> and it adds another possible source of mistakes :)
yegods_ has quit [Remote host closed the connection]
yegods has joined #ocaml
<Enjolras> jayphelps: you can rely on tool. Like Merlin will give you the type of any function at any point
FreeBirdLjj has quit [Remote host closed the connection]
<Enjolras> and you can extract doc with ocamldoc
<Enjolras> i don't see the point of writting the type manually unless you want to constrain the type
<jayphelps> Enjolras: merlins is tits. Thanks!
oxcsh has joined #ocaml
struktured has joined #ocaml
Ruff has joined #ocaml
struk|desk is now known as struk|desk|away
Ruff has quit [Quit: Leaving]
yegods has quit [Remote host closed the connection]
aantron has quit [Remote host closed the connection]
lostman_ has joined #ocaml
yegods has joined #ocaml
myst|fon has quit [Quit: Connection closed for inactivity]
yunxing has joined #ocaml
keep_learning has joined #ocaml
keep_learning has quit [Client Quit]
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
pierpa has quit [Ping timeout: 244 seconds]
yegods has quit [Ping timeout: 248 seconds]
mysiticity has joined #ocaml
Reshi has quit [Ping timeout: 264 seconds]
pierpa has joined #ocaml
jayphelps has quit [Quit: Connection closed for inactivity]
pierpa has quit [Ping timeout: 244 seconds]
pierpa has joined #ocaml
GeorgeHahn has quit [Read error: Connection reset by peer]
pierpa has quit [Ping timeout: 276 seconds]
pierpa has joined #ocaml
ggole has joined #ocaml
therac25 has joined #ocaml
hxegon has joined #ocaml
pierpa has quit [Ping timeout: 246 seconds]
slash^ has joined #ocaml
huza has joined #ocaml
pierpa has joined #ocaml
ggole_ has joined #ocaml
ggole__ has joined #ocaml
seangrove has joined #ocaml
ggole has quit [Ping timeout: 244 seconds]
pierpa has quit [Ping timeout: 260 seconds]
ggole_ has quit [Ping timeout: 250 seconds]
pierpa has joined #ocaml
huza has quit [Quit: WeeChat 1.0.1]
keep_learning has joined #ocaml
pierpa has quit [Ping timeout: 260 seconds]
kolko has quit [Ping timeout: 260 seconds]
pierpa has joined #ocaml
kolko has joined #ocaml
ggole_ has joined #ocaml
copy` has quit [Quit: Connection closed for inactivity]
ggole__ has quit [Ping timeout: 276 seconds]
hxegon has quit [Quit: BRB]
pierpa has quit [Read error: Connection reset by peer]
pierpa has joined #ocaml
AlexRussia has quit [Ping timeout: 276 seconds]
ggole__ has joined #ocaml
mysiticity has quit [Ping timeout: 276 seconds]
ggole_ has quit [Ping timeout: 264 seconds]
yegods has joined #ocaml
<flux> funny how adding a Unix.select [] [] [] 0.2 into my lablgtk app makes widget resizing and other stuff work
<flux> whereas 0.1 makes it not work
<flux> or removing the select altogether will make it not work
yegods has quit [Ping timeout: 260 seconds]
<flux> seems like it forgets events when there is high cpu load
<flux> with Thread.delay 0.107 it mostly works but not at times. I'll put in the 0.15 value, that's the rock solid option! [for my computer]
<ggole__> Sounds super reliable and not sketchy at all!
oxcsh has quit [Remote host closed the connection]
<flux> hey, even if there issues, I could simply just inrease the value!
<flux> what could be easier than that?!
<flux> maybe it's the Cairo bindings that are to blame
<flux> I've had this same issue with another program as well (using Cairo)
<flux> for example: right-clicking to open a popup menu does open the frame of the popup menu, but not the contents
<flux> and then I can click elsewhere and eventually the menu closes ok, or I can click within the menu and eventually it chooses the option
* ggole__ is blissfully ignorant of the pleasures of GUI programming
<flux> you should try it's, fuuunnnn...
malc_ has joined #ocaml
lostman_ has quit [Quit: Connection closed for inactivity]
pierpa has quit [Ping timeout: 244 seconds]
pierpa has joined #ocaml
oxcsh has joined #ocaml
myst|fon has joined #ocaml
oxcsh has quit [Ping timeout: 240 seconds]
Simn has joined #ocaml
ggole_ has joined #ocaml
kolko has quit [Read error: Connection reset by peer]
ggole__ has quit [Ping timeout: 276 seconds]
kolko has joined #ocaml
Sorella has quit [Quit: Connection closed for inactivity]
Vintila has quit [Ping timeout: 240 seconds]
pierpa has quit [Ping timeout: 260 seconds]
<mrvn> flux: Maybe you should help me with Qt5 bindings. :)
yunxing has quit [Remote host closed the connection]
yunxing has joined #ocaml
yunxing has quit [Ping timeout: 240 seconds]
ygrek has joined #ocaml
freehck has quit [Remote host closed the connection]
ygrek has quit [Ping timeout: 250 seconds]
<Leonidas> great, one would think that string_of_sexp would convert a Type.t into a string/bytes but no, it fails with an obscure error :-/
<mrvn> which would be?
ggole__ has joined #ocaml
<companion_cube> what's a Type.t?
<mrvn> companion_cube: presumably the value representing the sexp of a type that the ppx addon builds
ggole_ has quit [Ping timeout: 276 seconds]
<Leonidas> companion_cube: yes, exactly as mrvn says.
<Leonidas> Pre_sexp.Of_sexp_error (Failure "string_of_sexp: atom needed", Sexplib.Pre_sexp.List [Sexplib.Pre_sexp.List [Sexplib.Pre_sexp.Atom "sth"; Sexplib.Pre_sexp.Atom "42"]]).
<Leonidas> type foo = {sth:int} [@@deriving sexp]
therac25 has quit [Quit: therac25]
<Leonidas> Not quite sure why it is a Type.t and not Sexp.t, but the signatures check out
kolko has quit [Ping timeout: 250 seconds]
cic has joined #ocaml
badon has quit [Quit: Leaving]
badon has joined #ocaml
ggole__ is now known as ggole
ggole_ has joined #ocaml
ggole has quit [Ping timeout: 276 seconds]
Anarchos_ has joined #ocaml
kolko has joined #ocaml
abbiya has joined #ocaml
CaptainCoward has joined #ocaml
huza has joined #ocaml
* Anarchos_ just gets merlin working with vim on HaikuOS \o/
Haudegen has quit [Ping timeout: 244 seconds]
sgnb has quit [Remote host closed the connection]
orbifx1 has joined #ocaml
mysiticity has joined #ocaml
* malc_ dusts of his BeOS4:PE
mysiticity has quit [Ping timeout: 268 seconds]
silver has joined #ocaml
orbifx1 has quit [Ping timeout: 276 seconds]
tane has joined #ocaml
Haudegen has joined #ocaml
<Harzilein> hmm
<Harzilein> stuff like debian's libdbm-ocaml-dev, is it supposed to turn up in ocamlfind?
<mrvn> yes
<Harzilein> hi mrvn :)
<Harzilein> hmm
<mrvn> does it have a META file?
<Harzilein> no :/
axiles has joined #ocaml
<mrvn> there you go then, it's supposed to have one
<Harzilein> camldbm 1.0-2, from jessie
<flux> no bugs filed for the package, you get to be the first one :)
<Harzilein> argh, but then people would be glad to see a patch with it and i have no clue about ocamlfind really :D
<Harzilein> or ocaml debhelper matters
<mrvn> build the source and check that it has or builds a META file.
<Harzilein> do META files come from upstream?
<mrvn> oasis builds them
<flux> the opam version does have a META file
<Harzilein> is it comparable to a something.pc vs something.pc.in file?
<mrvn> yes
ggole__ has joined #ocaml
<Harzilein> harzi@relax:~/.debian-pkg/c/debian-pkg-camldbm/camldbm$ ls
<Harzilein> Changelog cldbm.c configure dbm.ml dbm.mli debian LICENSE Makefile META README testdbm.ml
<Harzilein> hmm
<Harzilein> libdbm-ocaml.install.in
<Harzilein> 2:@OCamlStdlibDir@/dbm/META
<flux> so it's there but it doesn't install it?
<Harzilein> sure enough, it's in the non-dev package, sorry, did not look there at first
ggole_ has quit [Ping timeout: 246 seconds]
<Harzilein> argh, sorry, i tried ocamlfind Dbm, not ocamlfind dbm
<mrvn> and you findlib dbm?
<flux> so the problem still is ocamlfind doesn't know about it?
manizzle has quit [Ping timeout: 244 seconds]
<mrvn> Harzilein: :)
<Harzilein> sure enough, it works :)
<flux> ocamlfind list|grep -i dbm is the way to do it in the future :)
<Harzilein> harzi@relax:~$ ocamlfind query dbm
<Harzilein> /usr/lib/ocaml/dbm
<flux> sometimes the names can be unexpected
<Harzilein> now i'm looking at this:
<Harzilein> and it's built with
manizzle has joined #ocaml
<Harzilein> calling ocamlopt like this (from the error message):
<Harzilein> Command '['ocamlopt.opt', '-g', '-w', 'A-4', '-o', '/home/harzi/garstow/gar.scripts/fast-wrapper', 'dbm.cmxa', 'unix.cmxa', 'str.cmxa', '/home/harzi/garstow/gar.scripts/fast_wrapper.ml']' returned non-zero exit status 2
<Harzilein> Error: Unbound module Dbm
<flux> it doesn't use ocamlfind
<Harzilein> is this some case of "the author has dbm compiled into his ocaml runtime" or something?
<mrvn> sounds like it
<Harzilein> meh
malc_ has left #ocaml ["ERC (IRC client for Emacs 25.0.50.2)"]
<mrvn> maybe opam installs it differently so it's in the path automatically.
<Harzilein> LIBDEPS += ocaml/ocaml ocaml/ocaml-findlib
<Harzilein> mrvn: ah, okay. but doesn't he need to open it then?
Anarchos_ has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
<mrvn> Harzilein: no, using Dbm.foo works just fine. With open Dbm it would be just foo.
<mrvn> open Dbm probably gives "Error: Unbound module Dbm"
CaptainCoward has left #ocaml [#ocaml]
shinnya has joined #ocaml
<mrvn> Puh, that was a big change to my Qt5 bindings: 31 files changed, 834 insertions(+), 546 deletions(-)
<mrvn> I can open a window with one push button and see when it gets clicked or when it receives events.
yomimono has joined #ocaml
mettekou has joined #ocaml
orbifx has joined #ocaml
<flux> mrvn, cool! how many memory leaks?-)
<mrvn> 0
<flux> mrvn, btw, is your project on the inter webs?
orbifx2 has quit [Ping timeout: 268 seconds]
<flux> mrvn, btw, do you plan to implement the Qt Grahpics View alond with the Graphics Scene?
<mrvn> never used those
<mrvn> hmm, correction: ==13171== Mismatched free() / delete / delete []
<flux> so you don't have any particular needs for visualization?
<mrvn> so far I've only used standard widgets.
<mrvn> is Qt Grahpics View and Graphics Scene the right thing to draw fractals or 3d polygons?
<flux> perhaps bitmaps would be more appropriate for fractals and opengl for 3d polygons. qt5 dose have a 3d module though..
<flux> the graphicsscene would be suitable for displaing graphs or charts, or perhaps 2d game scenes
darkf has quit [Quit: Leaving]
TheLemonMan has joined #ocaml
ggole_ has joined #ocaml
<Leonidas> oh, btw, I solved my problem by not using string_of_sexp but Sexplib.Sexp.of_string.
<companion_cube> hu...
ggole__ has quit [Ping timeout: 248 seconds]
abbiya has quit [Ping timeout: 276 seconds]
<Leonidas> yeah, no idea.
orbifx has quit [Ping timeout: 250 seconds]
yegods has joined #ocaml
wolfcore has quit [Ping timeout: 244 seconds]
wolfcore has joined #ocaml
<mrvn> ==19541== in use at exit: 6,871,008 bytes in 3,510 blocks
<mrvn> ==19541== total heap usage: 21,825 allocs, 18,315 frees, 280,427,818 bytes allocated
<mrvn> Now is that my code or Qt5?
<flux> valgrind tells you where the allocations happen
<mrvn> a lot of it is ==19562== by 0x6F6FFB0: g_type_register_fundamental (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.4600.2)
<flux> backtrace of said locations?
thomasga has joined #ocaml
<mrvn> call_init.part.0 (dl-init.c:78)
<mrvn> seems to be the initializer function for libgobject itself.
<mrvn> A bunch of QT functions leak too. Nothing from my side.
TheLemonMan has quit [Ping timeout: 244 seconds]
TheLemonMan has joined #ocaml
tane has quit [Quit: Verlassend]
rossberg has quit [Ping timeout: 264 seconds]
aantron has joined #ocaml
cross has quit [Quit: leaving]
cross has joined #ocaml
rossberg has joined #ocaml
aantron has quit [Remote host closed the connection]
oxcsh has joined #ocaml
Anarchos_ has joined #ocaml
oxcsh has quit [Ping timeout: 240 seconds]
xavierm02 has joined #ocaml
dhil has joined #ocaml
lobo has quit [Quit: leaving]
<xavierm02> Hi. I was wondering if there are good reasons to use "type t = A of int * int" over "type t = B of (int * int)". Thanks in advance for your answers.
<mrvn> no extra indirection
AlexRussia has joined #ocaml
<mrvn> companion_cube: it sees that it is not.
<mrvn> ups, ewin
lobo has joined #ocaml
ggole__ has joined #ocaml
aantron has joined #ocaml
ggole_ has quit [Ping timeout: 252 seconds]
thomasga has quit [Quit: Leaving.]
ggole_ has joined #ocaml
ggole__ has quit [Ping timeout: 244 seconds]
huza has quit [Quit: WeeChat 1.0.1]
struk|desk|away is now known as struk|desk
ggole__ has joined #ocaml
thomasga has joined #ocaml
d0nn1e has quit [Ping timeout: 240 seconds]
ggole_ has quit [Ping timeout: 260 seconds]
<infinity0> how do i express the equivalent of java's <?> in ocaml?
d0nn1e has joined #ocaml
<infinity0> e.g. i want to define "type ('a, 'b) t = X of ('a, 'b) x | Y of ('a, 'b, 'c) y1 * 'c y2"
<infinity0> but it's giving me an unbound type parameter 'c
<Anarchos_> infinity0 where does 'c come from ?
<mrvn> infinity0: yes it does.
<mrvn> infinity0: is there a question in there?
<infinity0> i want to express the fact that consumers of ('a, 'b) t never need to care about what 'c is
<mrvn> infinity0: but it does.
<mrvn> type ('a, 'b +'c) t?
<mrvn> type ('a, 'b, +'c) t?
<mrvn> infinity0: or you need to make a GADT
<infinity0> hm not exactly... actually i think the most elegant solution would be modular implicits here
<infinity0> there is a parameter in the type ('c) for which, whenever we instantiate it we're always able to convert it into a 'b (so clients don't need to care what 'c is)
<mrvn> then why not ('a, 'b, 'b) y1 * 'b y2?
thomasga has quit [Quit: Leaving.]
<ggole__> Sounds a bit like an existential
FreeBirdLjj has joined #ocaml
oxcsh has joined #ocaml
Sorella has joined #ocaml
<infinity0> yeah, 'c is not necessarily a subtype of 'b
tristero has quit [Quit: tristero]
larhat has joined #ocaml
Vintila has joined #ocaml
mysiticity has joined #ocaml
struk|desk is now known as struk|desk|away
<flux> infinity0, if you want to have consumers of "X of ('a, 'b) x", you should instead just have consumers of "('a, 'b) x"
ggole__ is now known as ggole
<infinity0> yeah it's the second part of that that's causing the unbound type param... i'll take a look at GADTs they seem promising for this
mysiticity has quit [Ping timeout: 260 seconds]
<infinity0> ah that was pretty easy, just had to re-write it as type (_, _) t = X : ('a, 'b) x -> ('a, 'b) t | Y : ('a, 'b, 'c) y1 * 'c y2 -> ('a, 'b) t
xavierm02 has quit [Ping timeout: 252 seconds]
<mrvn> But then you have no way to access the 'c parts
<mrvn> infinity0: if the 'c doesn't matter then just have the consumer polymorphic in 'c. If it does matter than you need a witness for it.
<mrvn> you need a GADT when you want different kinds of t in a list for example.
rvp has joined #ocaml
<infinity0> mrvn: yeah it's ok 'c doesn't matter here, it only matters inside y1 and y2
<infinity0> i can pattern-match on t and get y1 and y2, then they just play with each other and i don't need to know about how they do that
<ggole> mrvn: you don't need witnesses for a relation between two types to be useful
thomasga has joined #ocaml
sillyotter has joined #ocaml
mysiticity has joined #ocaml
jgjl has joined #ocaml
sillyotter has quit [Client Quit]
yomimono has quit [Read error: Connection reset by peer]
yomimono has joined #ocaml
mysiticity has quit [Ping timeout: 244 seconds]
oxcsh has quit [Remote host closed the connection]
oxcsh has joined #ocaml
rvp has quit [Ping timeout: 244 seconds]
<mrvn> I think I'm done telling ocaml about C++ types. Now if only I were done telling c++ about the ocaml types...
struk|desk|away is now known as struk|desk
larhat has quit [Quit: Leaving.]
Vintila has quit [Ping timeout: 248 seconds]
sz0 has quit [Quit: Bye.]
sz0 has joined #ocaml
<flux> mrvn, I first thought app.native didn't open a window..
<flux> mrvn, but it turned out to be behind a pile of papers
<mrvn> flux: papers on your monitor?
<flux> in front of my monitor
<flux> so two things come to me when looking at app.ml: nice, clea, understandable example. and one instance of Obj.magic.. ;)
<mrvn> flux: yeah. have to figure out how to downcast the proxy object type when deriving from a class.
martintrojer has quit [Ping timeout: 252 seconds]
<mrvn> flux: or make a class that creates the c++ side internally for inheriting by the user
mettekou has quit [Ping timeout: 252 seconds]
infinity0 has quit [Ping timeout: 252 seconds]
struk|desk has quit [Ping timeout: 252 seconds]
def` has quit [Ping timeout: 252 seconds]
struk|desk2 has joined #ocaml
def` has joined #ocaml
rvp has joined #ocaml
mettekou has joined #ocaml
infinity0 has joined #ocaml
dhil has quit [Ping timeout: 268 seconds]
thomasga has quit [Ping timeout: 248 seconds]
martintrojer has joined #ocaml
yomimono has quit [Ping timeout: 246 seconds]
struk|desk2 is now known as struk|desk|away
jgjl has quit [Ping timeout: 260 seconds]
BitPuffin|osx has joined #ocaml
struk|desk|away is now known as struk|desk2
yomimono has joined #ocaml
bbc has quit [Read error: Connection reset by peer]
bbc_ has joined #ocaml
bbc_ is now known as bbc
dhil has joined #ocaml
oxcsh has quit [Remote host closed the connection]
jgjl has joined #ocaml
<Harzilein> had cake and pizza meanwhile
<Harzilein> now at next hurdle, still in fast-wrapper.ml above
<Harzilein> it implements its own module StringSet = Set.Make(String), apparently a common idiom
struktured has quit [Quit: Konversation terminated!]
mettekou has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Harzilein> ocaml-core docs say "val of_list : comparator:('a, 'cmp) Comparator.t -> 'a list -> ('a, 'cmp) t"
oxcsh has joined #ocaml
d0nn1e has quit [Ping timeout: 244 seconds]
pierpa has joined #ocaml
d0nn1e has joined #ocaml
hxegon has joined #ocaml
yegods has quit [Remote host closed the connection]
<Harzilein> argh, wtf...
reynir1 has joined #ocaml
mettekou has joined #ocaml
Sim_n has joined #ocaml
myst|fon_ has joined #ocaml
Khady_ has joined #ocaml
alpen- has joined #ocaml
john51_ has joined #ocaml
Druup has joined #ocaml
cross_ has joined #ocaml
rvp has quit [Ping timeout: 248 seconds]
jeroud_ has joined #ocaml
trix has joined #ocaml
mietek_ has joined #ocaml
igitoor_ has joined #ocaml
myst|fon has quit [Ping timeout: 246 seconds]
cross has quit [Ping timeout: 246 seconds]
reynir has quit [Ping timeout: 246 seconds]
igitoor has quit [Ping timeout: 246 seconds]
wolfcore has quit [Ping timeout: 246 seconds]
alpen has quit [Ping timeout: 246 seconds]
mietek has quit [Ping timeout: 246 seconds]
jeroud has quit [Ping timeout: 246 seconds]
Simn has quit [Ping timeout: 246 seconds]
fraggle_ has quit [Ping timeout: 246 seconds]
Drup has quit [Ping timeout: 246 seconds]
mietek_ is now known as mietek
Khady has quit [Ping timeout: 246 seconds]
emmanueloga has quit [Ping timeout: 246 seconds]
yminsky has quit [Ping timeout: 246 seconds]
bbc has quit [Ping timeout: 246 seconds]
Nazral has quit [Ping timeout: 246 seconds]
myst|fon_ is now known as myst|fon
bbc has joined #ocaml
<companion_cube> aww
john51 has quit [Ping timeout: 246 seconds]
jbrown has joined #ocaml
jeroud_ is now known as jeroud
fraggle_ has joined #ocaml
Nazral has joined #ocaml
struk|desk2 is now known as struk|desk|away
emmanueloga has joined #ocaml
igitoor_ has joined #ocaml
igitoor_ has quit [Changing host]
igitoor_ is now known as igitoor
deko-pyon has quit [Quit: cleanup]
yminsky has joined #ocaml
sfri has quit [Remote host closed the connection]
idegen has joined #ocaml
sz0 has quit [Quit: Bye.]
deko-pyon has joined #ocaml
<mrvn> I have a type 'a t that is abstract (a c++ class). Can I make ocaml understand that in a function 'b t is also acceptable as long as 'b :> 'a?
yegods has joined #ocaml
bobry has joined #ocaml
<Druup> mrvn: just make the type covariant ..
<ggole> For abstract types the type variable is nonvariant iirc, unless you specify otherwise
sh0t has joined #ocaml
<mrvn> yeah, ocaml drops the +
ygrek has joined #ocaml
sfri has joined #ocaml
<ggole> What do you mean, drops?
<mrvn> ggole: # type +'a t type +'a s = 'a t;;
<mrvn> type +'a t
<mrvn> type 'a s = 'a t
<Druup> it doesn't drop anything, the fact that s is covariant is infered, since it's not abstract
<ggole> mrvn: if you have type +'a t = ..., and the ... isn't compatible with 'a being covariant, you will get an error message
<mrvn> anyway, covariant isn't the right thing I think.
<mrvn> It has a 'oPushButton oClass.t' but needs a 'button oClass.t' to match the self type.
deko-pyon is now known as pyon-kan
<mrvn> I have the change the class or the external_make or something to make derived classes accept the base type. But also oPushButton should not accept an oObject c++ object.
<mrvn> s/the/to/
copy` has joined #ocaml
d0nn1e has quit [Ping timeout: 260 seconds]
oxcsh has quit [Ping timeout: 246 seconds]
d0nn1e has joined #ocaml
jgjl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jgjl has joined #ocaml
sh0t has quit [Quit: Leaving]
thomasga has joined #ocaml
pierpa has quit [Ping timeout: 244 seconds]
<mrvn> Ok, here is a small test case. I need class bar to work in some form: https://gist.github.com/mrvn/0dd6cf6b59fb480b4c77
thomasga1 has joined #ocaml
yomimono_ has joined #ocaml
jgjl_ has joined #ocaml
thomasga has quit [Ping timeout: 276 seconds]
yomimono has quit [Ping timeout: 250 seconds]
jgjl has quit [Ping timeout: 240 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
Algebr` has joined #ocaml
Algebr`` has joined #ocaml
dothraki__ has joined #ocaml
mettekou has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
thomasga has joined #ocaml
thomasga1 has quit [Ping timeout: 248 seconds]
thomasga1 has joined #ocaml
yomimono_ has quit [Ping timeout: 246 seconds]
Algebr` has quit [Ping timeout: 244 seconds]
jgjl_ has quit [Ping timeout: 246 seconds]
dothraki__ has quit [Ping timeout: 260 seconds]
thomasga has quit [Ping timeout: 248 seconds]
Algebr`` has quit [Ping timeout: 276 seconds]
jgjl has joined #ocaml
jgjl has quit [Read error: Connection reset by peer]
thomasga1 has quit [Read error: Connection reset by peer]
thomasga has joined #ocaml
jgjl has joined #ocaml
larhat has joined #ocaml
jgjl_ has joined #ocaml
DanielRi1hman is now known as DanielRichman
thomasga1 has joined #ocaml
abbiya has joined #ocaml
thomasga has quit [Ping timeout: 276 seconds]
Intensity has quit [Ping timeout: 240 seconds]
cross_ has quit [Ping timeout: 276 seconds]
jgjl has quit [Ping timeout: 276 seconds]
abbiya has quit [Remote host closed the connection]
cross has joined #ocaml
Intensity has joined #ocaml
yegods has quit [Remote host closed the connection]
tane has joined #ocaml
yegods has joined #ocaml
mettekou has joined #ocaml
jgjl has joined #ocaml
thomasga has joined #ocaml
thomasga1 has quit [Ping timeout: 248 seconds]
jgjl_ has quit [Ping timeout: 260 seconds]
jgjl has quit [Ping timeout: 260 seconds]
jgjl has joined #ocaml
yegods has quit [Remote host closed the connection]
cat5e has quit [Quit: Leaving]
oxcsh has joined #ocaml
yegods has joined #ocaml
tennix has quit [Ping timeout: 244 seconds]
Kakadu has joined #ocaml
oxcsh has quit [Ping timeout: 244 seconds]
seangrove has quit [Remote host closed the connection]
seangrove has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
seangrove has quit [Remote host closed the connection]
seangrov` has joined #ocaml
seangrov` has quit [Ping timeout: 244 seconds]
silver has quit [Quit: rakede]
larhat has quit [Quit: Leaving.]
thomasga has quit [Quit: Leaving.]
thomasga has joined #ocaml
silver has joined #ocaml
Soni has joined #ocaml
ygrek has quit [Ping timeout: 252 seconds]
data_hope has joined #ocaml
Soni is now known as cat5e
<seliopou> so it looks like there is no way to reliably figure out if a Lwt_stream.t is closed
<seliopou> No guarantee that you call on_terminate before the stream has been closed
tennix has joined #ocaml
therac25 has joined #ocaml
jgjl has quit [Ping timeout: 240 seconds]
oxcsh has joined #ocaml
darkf has joined #ocaml
oxcsh_ has joined #ocaml
oxcsh has quit [Ping timeout: 252 seconds]
data_hope has quit [Ping timeout: 260 seconds]
seangrove has joined #ocaml
struk|desk|away is now known as struk|desk2
data_hope has joined #ocaml
Mirry has joined #ocaml
Mirry has left #ocaml [#ocaml]
AlexRussia has quit [Ping timeout: 240 seconds]
thomasga has quit [Quit: Leaving.]
<mrvn> How do I write " ... : MODULE_NAME with type 'a t = unit -> (#foo as 'a) t" correctly?
<aantron> you are trying to say that 'a has a constraint?
<mrvn> aantron: no, I specify the type of a first class module, how the internal type relates to the outside world.
<mrvn> let module E = (val (module struct type t = string -> oPushButton OClass.t end) : External with type t = string -> oPushButton Class.t) in ... but now with a polymorphic type.
<mrvn> Without polymorphic I get: In type string -> (#oPushButton as 'a) OClass.t the variable 'a is unbound
<aantron> your type needs to be parametric in order for you to be able to write that type constraint on the signature
<aantron> but i think you arleady know that..
<mrvn> yes, I made PolymorphicExternal for that with type 'a t
<mrvn> "PolymorphicExternal with type e = string -> #oPushButton OClass.t" ==> In this `with' constraint, the new definition of e does not match its original definition in the constrained signature: Type declarations do not match: type e is not included in type 'a e
<mrvn> and "with type 'a e = ..." Error: Syntax error: ')' expected
<mrvn> on the '
<mrvn> Is there somethin like "let module ['a] E = ..."?
<aantron> can you show the actual complete example with PolymorphicExternal (the structure) and the type constraint?
<aantron> at least the type inside the structure
<aantron> sorry i mean signature*
<aantron> and what is the compiler complaining about? that the type variable introduced by #oPushButton is unbound?
Anarchos has quit [Disconnected by services]
Anarchos_ is now known as Anarchos
<mrvn> "Error: Syntax error: ')' expected" on the ' of "with type 'a e"
<aantron> hmm.
<ggole> with doesn't support that iirc
<aantron> ggole: what exactly? it supports type families
<ggole> Er, what?
<aantron> module type Foo = sig type 'a t end with type 'a t = int <-- works fine
<ggole> Yeah, but there are places where you can't do that
<mrvn> updated the gist so it can be compiled on its own
<ggole> (The details escape me for the moment.)
<ggole> eg, let test (module M : M with type 'a t = int) = ()
AlexRussia has joined #ocaml
<aantron> ah true
struk|desk2 is now known as struk|desk|away
Stany has joined #ocaml
thomasga has joined #ocaml
Tamae has quit [Ping timeout: 276 seconds]
<mrvn> can I do MODULE with class type a = base?
<ggole> I don't think so
<ggole> I think you can do with type a = #base though
<mrvn> type a type 'a t = (#a as 'a) OClass.t doesn't work, unknown class a
<mrvn> type a = #base would also have an unbound 'a
mettekou has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
struk|desk|away is now known as struk|desk2
lokien_ has joined #ocaml
Anarchos has quit [Ping timeout: 240 seconds]
<aantron> mrvn: what are you using this type e/'a e for?
<mrvn> aantron: for the type of a c++ object
dhil has quit [Ping timeout: 260 seconds]
ggole has quit []
<aantron> thats not what i mean. i mean where in your gist are you using it, besides the signature declaration at the top?
<mrvn> aantron: nowhere. It's only there to declare the stub
<aantron> ok
<aantron> i doubt this could work that way, i think there is some kind of mixing of parameters and unification variables going on here
<aantron> you want to be able to get a variation on PolymorphicExternal for different base classes, yes?
<mrvn> I have "class base (obj : 'a t) = object(self:'a) ... end" and I need to declare the external stub to return that 'a t.
<aantron> im not seeing the reason, in this so far, for why stub in the signature is a value of abstract type
<aantron> besides the declaration order you showed
<mrvn> reason for what?
dothraki__ has joined #ocaml
data_hope has quit [Quit: Lost terminal]
therac25 has quit [Quit: therac25]
mettekou has joined #ocaml
yegods has quit [Remote host closed the connection]
therac25 has joined #ocaml
dothraki__ is now known as yomimono
icicled has left #ocaml ["WeeChat 1.4"]
pyon-kan is now known as deko-pyon
<mrvn> aantron: (updated gist) I want to avoid the Obj.magic in magic.ml or the type unsafety in unsafe.ml
Haudegen has quit [Ping timeout: 260 seconds]
<aantron> its hard to say what to do. why isnt PolymorphicExternal declared after class base, so you could do val stub : unit -> #base t?
<mrvn> I have about 200 classes that would all use PolymorphicExternal with their clase being base
<mrvn> also: unbount 'a
<mrvn> unbound
<aantron> thats what i was asking before, and it wouldnt be unbound in that case. thats a value declaration
<mrvn> lets try
<mrvn> aantron: updated, base.ml
<mrvn> Values do not match: external stub : unit -> #base t = "stub" is not included in val stub : string -> #base t
<mrvn> that is an odd one
<mrvn> args, unit != string
sh0t has joined #ocaml
<mrvn> aantron: updated. That works. But now I have to write down a module type for every use.
<aantron> right, for everything you want to replace #base with?
Stany has quit [Read error: Connection reset by peer]
<mrvn> it's too bad I can't use 'self in the module definition even if I move it inside the object.
<mrvn> and yes, for everything I want to replace #base with: namely: http://doc.qt.io/qt-5/classes.html
<aantron> i dont know if you can eliminate the #base and make that depend on a variable. i had huge trouble with this (but with polymorphic variants) about a year ago. i dont remember exactly what i learned, but the takeaway was it's hard (impossible)? to get the bound in a constraint to itself be a variable
apluke has joined #ocaml
<mrvn> 99.999% of the time you get problems because you can't close the class type or self escapes the class.
<mrvn> But I realy realy realy need to close the class type in respect to the (obj : 'a t) parameter.
struk|desk2 is now known as struk|desk|away
<mrvn> an idea why I have to declare a module type and then use it as in the module definition instead of speficying the type right there on the fly?
apluke has quit [Ping timeout: 268 seconds]
<infinity0> is there a standard name for this operator: let (xx) f g = \ (x, y) -> (f x, g y)
<infinity0> er, this: let (@*@) f g = fun (s0, s1) -> (f s0, g s1)
<companion_cube> I don't think so
<mrvn> doubtfull since it's limited in the arity.
<companion_cube> it looks like an Arrow thing
<mrvn> do you have @*@*@ and @*@*@*@ and so on too?
thomasga has quit [Quit: Leaving.]
<aantron> mrvn: can you declare a constrained signature standalone (and not just express it in the ascription of your first-class module)?
<aantron> signatures*
<mrvn> aantron: not constraint to 'self
Algebr` has joined #ocaml
<infinity0> well, you could chain it like "f (?) g (?) h" :p
therac25 has quit [Quit: therac25]
apluke has joined #ocaml
<infinity0> no, but one could chain it like f @*@ g @*@ h
<mrvn> infinity0: that wouldn't work for (1,2,3) and (1,2,3,4)
AlexRussia has quit [Ping timeout: 240 seconds]
<mrvn> let ( ? ) f g h = fun (s0, s1, s2) -> (f s0, g s1, h s2) f ? g : h (1, 2, 3) :)
seangrove has quit [Ping timeout: 248 seconds]
<companion_cube> hmmmmm weird, I can't install the 4.03 beta anymore...
<mrvn> aantron: Interestingly enough that local module with #base works only in classes with arguments.
yomimono has quit [Ping timeout: 250 seconds]
Haudegen has joined #ocaml
<infinity0> argh irc lag sorry :/
Mirry has joined #ocaml
Mirry has left #ocaml [#ocaml]
<infinity0> mrvn: yeah but you could write it as (1,(2,3)) etc
<mrvn> different type.
<infinity0> i was trying to avoid needing to define many versions of basically the same idea
<mrvn> infinity0: yeah. unfortunately one can't define a function for n-tuples. Only for known sizes.
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
<mrvn> aantron: uploaded to https://github.com/mrvn/ocaml-qt5/ now. Wrapping the make function is often much longer than the actuall class itself so far. (e.g. https://github.com/mrvn/ocaml-qt5/blob/master/src/qt5/src/OPushButton.ml )
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
apluke has quit [Ping timeout: 276 seconds]
wiredsister has joined #ocaml
wiredsister has left #ocaml [#ocaml]
Algebr`` has joined #ocaml
yunxing has joined #ocaml
Algebr` has quit [Ping timeout: 244 seconds]
thomasga has joined #ocaml
<companion_cube> "recipe for target 'read_cmt' failed" wtf
Sim_n has quit [Quit: Leaving]
seangrove has joined #ocaml
seangrove has quit [Ping timeout: 240 seconds]
lokien_ has quit [Quit: Connection closed for inactivity]
AlexRussia has joined #ocaml
silver has quit [Quit: rakede]
Kakadu has quit [Remote host closed the connection]
badon has quit [Disconnected by services]
badon_ has joined #ocaml
badon_ is now known as badon
tane has quit [Quit: Verlassend]
hxegon has quit [Quit: BRB]
hxegon has joined #ocaml
<seliopou> Druup i may have a pr for lwt
ygrek has joined #ocaml
seangrove has joined #ocaml
seangrove has quit [Ping timeout: 246 seconds]