adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | Current MOOC: https://huit.re/ocamlmooc | OCaml 4.04.0 release notes: http://ocaml.org/releases/4.04.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
kassens has quit [Remote host closed the connection]
trevorriles has quit [Ping timeout: 264 seconds]
trevorriles_ has joined #ocaml
lolisa has quit [Quit: KVIrc 4.9.1 Aria http://www.kvirc.net/]
orbifx has quit [Ping timeout: 240 seconds]
richi235 has joined #ocaml
shinnya has joined #ocaml
mfp has quit [Ping timeout: 240 seconds]
ygrek_ has quit [Ping timeout: 260 seconds]
richi235 has quit [Ping timeout: 240 seconds]
silver_ has quit [Read error: Connection reset by peer]
manizzle has quit [Ping timeout: 264 seconds]
manizzle has joined #ocaml
kamog has quit [Quit: ERC (IRC client for Emacs 25.1.1)]
mengu has quit [Remote host closed the connection]
<sveit> is there any recent information or timeline on modular implicits? i remember reading in a thread about a year ago that it was supposed to be in 4.0.2/3
camelxcore has joined #ocaml
<copy`> sveit: I think you're confusing it with multicore, which was announced to be released in 4.03
<copy`> That said, I don't have any more infos about implicits, maybe you can employ the search functionality on irclog.whitequark.org/ocaml to gain some more infos
wu_ng has joined #ocaml
infinity0 has quit [Ping timeout: 240 seconds]
camelxcore has quit [Quit: Lost terminal]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
<sveit> the chat logs are pretty ambiguous. no one seems to be particularly anxious to get them though. i was under the impression implicits are a pretty important feature. do people just not care?
<sveit> i thought it was implicits. anyway we're on 4.04 now :)
<copy`> I think everybody would love to have implicits, it's just very hard to prove they preserve certain properties of the type system
Throwaway has joined #ocaml
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
<Throwaway> Any night owls willing to help me with a small code example?
infinity0 has joined #ocaml
<Throwaway> Any night owls willing to help me with a small code example?
<Throwaway> Nevermind ...
Throwaway has quit [Quit: Page closed]
nomicflux has joined #ocaml
shinnya has quit [Ping timeout: 260 seconds]
pyx has joined #ocaml
pyx has quit [Client Quit]
nomicflux has quit [Quit: nomicflux]
MercurialAlchemi has joined #ocaml
micro__ has joined #ocaml
chindy_ has joined #ocaml
micro__ is now known as Guest95992
micro_ has quit [*.net *.split]
chindy has quit [*.net *.split]
_whitelogger has joined #ocaml
moei has quit [Read error: Connection reset by peer]
jao has quit [Ping timeout: 240 seconds]
moei has joined #ocaml
newbie83 has joined #ocaml
newbie83 has quit [Client Quit]
MercurialAlchemi has quit [Ping timeout: 240 seconds]
copy` has quit [Quit: Connection closed for inactivity]
MercurialAlchemi has joined #ocaml
maattdd has joined #ocaml
jimt has quit [Ping timeout: 256 seconds]
jimt has joined #ocaml
maattdd_ has quit [Ping timeout: 240 seconds]
AlexDenisov has joined #ocaml
Simn has joined #ocaml
maattdd has quit [Read error: Connection reset by peer]
alfredo has joined #ocaml
maattdd has joined #ocaml
AlexDenisov has quit [Ping timeout: 240 seconds]
AlexDenisov has joined #ocaml
orbifx has joined #ocaml
jnavila has joined #ocaml
orbifx has quit [Ping timeout: 268 seconds]
jnavila has quit [Quit: It was time]
ia0 has quit [Quit: reboot]
jnavila has joined #ocaml
govg has quit [Ping timeout: 264 seconds]
ia0 has joined #ocaml
richi235 has joined #ocaml
jnavila has quit [Ping timeout: 240 seconds]
argent_smith has joined #ocaml
govg has joined #ocaml
<n4323> hi, does anyone know it it's possible to pass bigarrays to a ctypes foreign function?
<n4323> concretely, i have a shared fortran library and the subroutine to be called accepts a REAL array
<n4323> (actually, several)
<companion_cube> http://ocamllabs.io/ocaml-ctypes/Ctypes.html <--- I see a "bigarray" section
<companion_cube> just be careful about the layout (fortran vs C)
<n4323> ok will look into it. to me this: https://github.com/ocamllabs/ocaml-ctypes/issues/477 seemed to indicate that some functionality is missing
<companion_cube> oh :/
<companion_cube> but maybe it's for fixed size arrays
<companion_cube> surely the existing bindings to lapack, etc. use bigarrays
<n4323> actually i don't quite know how passing an array works in fortran. in c it would be a pointer to the start address but is it the same in f77?
<companion_cube> I think so, but the layout (for multi-dimensional arrays) is different
<companion_cube> column first vs row first, or the opposite
<companion_cube> something like that
<n4323> yes, that should be ok, i have a fortran-type bigarray.
<n4323> so i would use Ctypes.bigarray_start to get the start pointer i guess? the return value is a float so no problem there.
<n4323> (anyway no problem since all return values are also passed to the function as references)
govg has quit [Ping timeout: 260 seconds]
govg has joined #ocaml
<companion_cube> I don't know :-)
<n4323> thx anyway, i'm digging into it. there are bigarray objects in ctypes which also contain dimensions, trying to understand that now.
moei has quit [Read error: Connection reset by peer]
moei has joined #ocaml
johnelse has quit [Read error: Connection reset by peer]
johnelse has joined #ocaml
AlexDenisov has quit [Quit: Textual IRC Client: www.textualapp.com]
ygrek_ has joined #ocaml
govg has quit [Ping timeout: 240 seconds]
jnavila has joined #ocaml
<sspi> what's available to nicely print OCaml code on the web? preferably something that I can use from JSOO
<Drup> caml2html ?
<sspi> Drup: awesome, exactly what I was looking for :) once again: thank you
mengu has joined #ocaml
mfp has joined #ocaml
<n4323> update: it seems to work using this approach (pointers to the start). however Ctypes only contains functions that work with c_layout, so i have to convert tediously.
wu_ng has quit [Ping timeout: 264 seconds]
<n4323> actually, why does Bigarray not have functions to reinterpret a bigarray from c_layout to f_layout and vice versa?
<n4323> this seems like an ommission. it could be done without copying, if the array is effectively transposed in the reinterpretation. and for 1d-arrays its extra trivial and annoying if one has to copy for that?!
mengu_ has joined #ocaml
mengu has quit [Ping timeout: 240 seconds]
al-damiri has joined #ocaml
sepp2k has joined #ocaml
octachron has joined #ocaml
<octachron> n4323, Biggarray.Genarray.change_layout does exactly that (since 4.04)
snhmib has joined #ocaml
<n4323> oh cool! must have missed it!
<n4323> but nothing for Array{1,2,3}?
trapz has joined #ocaml
<n4323> this is probably why i did not find it. one could probably convert to genarray, do the layout change and convert back. fair enough.
<octachron> n4323, ah yes, arrayN → genarray → change_layout → arrayN is the only way to change layout for arrayN ; at least for now
<octachron> n4323, this should probably be fixed
<n4323> the conversion with the detour works for me for the moment, way better than what i had. i think i agree on adding it to the arrayN modules as well
<n4323> or maybe just mention the detour conversion in the docs of each arrayN?
trapz has quit [Quit: trapz]
<n4323> not sure about efficiency, maybe avoiding the intermediate step could be better.
zpe has joined #ocaml
lucasem has left #ocaml [#ocaml]
<octachron> since layout conversion preserves the order/dimension of the array, which is a property broken by the genarray detour; I would say it is better to add a specialized change_layout function to each ArrayN submodule
trapz has joined #ocaml
<n4323> not sure i understand: i get a genarray with dims = [|12;12|] for example when i convert from an Array2.t
<n4323> then i convert back with array2_of_genarray?
<octachron> n4323, note that the conversion function between genarray and arrayN costs nothing (the concrete type of all bigarray is the same)
taostein has joined #ocaml
<octachron> n4323, "let change_layout_2 array = array |> genarray_of_array2 |> Genarray.change_layout |> array2_of_genarray" ?
mpenet has joined #ocaml
<n4323> yes this is what i tried just now and works fine
silver has joined #ocaml
<n4323> so i'm not sure if more is required at all in Bigarray.ArrayN?
<n4323> other than convenience?
<octachron> mostly convenience, but also encoding in the type system that change_layout does not change the order of the bigarray
<n4323> i see. so would this be a polymorphic function that takes any ArrayN.t and gives the same ArrayN.t back but with changed layout?
mpenet has left #ocaml [#ocaml]
<n4323> probably that's not possible though?
trapz has quit [Quit: trapz]
<octachron> indeed, this is not possible; contrarily simply adding a change_layout function to each ArrayN submodule works
<n4323> ok. i guess what i don't see is if that function would have a more meaningful type than the chained function you wrote before...
richi235 has quit [Ping timeout: 240 seconds]
<n4323> i think i get it now. the chained function's type is exactly the same as the type of the new proposed functions. so while one can get the same functionality by writing the chained functions by hand, the provided ArrayN.change_layout would show in their type that the same rank comes out as goes in. this latter property is not true for genarray, where the rank is only known at runtime.
trapz has joined #ocaml
<leah2> does ocaml have a mechanism to compile different code according to the ocaml version?
<theblatt1> leah2: no
theblatt1 is now known as theblatte
<octachron> n4323, precisely: the functions arrayN_of_genarray can raise an Invalid_argument exception in the general case, but this exception never happens for change_layout_N
<octachron> leah2, however there are preprocessors that implements conditional compilation
<leah2> yeah, i think i dont want to complicate this more. thx :)
trapz has quit [Quit: trapz]
trapz has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Read error: Connection reset by peer]
zpe has joined #ocaml
taostein has quit [Quit: taostein]
_andre has quit [Ping timeout: 240 seconds]
_andre has joined #ocaml
Sim_n has joined #ocaml
dhil has joined #ocaml
dhil_ has joined #ocaml
dhil_ has quit [Remote host closed the connection]
Simn has quit [Ping timeout: 264 seconds]
StatelessCat has quit [Quit: WeeChat 1.7]
BitPuffin|osx has joined #ocaml
StatelessCat has joined #ocaml
jao has joined #ocaml
jnavila has quit [Quit: It was time]
sh0t has joined #ocaml
jabroney has joined #ocaml
shinnya has joined #ocaml
sz0 has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 268 seconds]
flx has joined #ocaml
mattg_ has joined #ocaml
flux has quit [Read error: Connection reset by peer]
mattg has quit [Ping timeout: 255 seconds]
lopex has quit [Ping timeout: 255 seconds]
mattg_ is now known as mattg
flx is now known as flux
jeffmo has quit [Ping timeout: 255 seconds]
stephe_ has joined #ocaml
stephe has quit [Ping timeout: 255 seconds]
stephe_ is now known as stephe
lopex has joined #ocaml
jeffmo has joined #ocaml
cheater2 has joined #ocaml
cheater2_ has quit [Ping timeout: 255 seconds]
arcetera has quit [Ping timeout: 255 seconds]
arc- has joined #ocaml
taostein has joined #ocaml
MorTal1ty has quit [Ping timeout: 255 seconds]
cartwright has quit [Ping timeout: 255 seconds]
MorTal1ty has joined #ocaml
silver has quit [Read error: Connection reset by peer]
cartwright has joined #ocaml
govg has joined #ocaml
zpe has quit [Remote host closed the connection]
ygrek_ has quit [Ping timeout: 240 seconds]
sh0t has quit [Quit: Leaving]
marsam has joined #ocaml
trapz has quit [Quit: trapz]
trapz has joined #ocaml
mengu_ has quit [Remote host closed the connection]
mengu has joined #ocaml
mengu has quit [Ping timeout: 260 seconds]
kakadu has joined #ocaml
MercurialAlchemi has joined #ocaml
BitPuffin|osx has quit [Ping timeout: 240 seconds]
BitPuffin|osx has joined #ocaml
shinnya has quit [Ping timeout: 268 seconds]
groovy3shoes has quit [Ping timeout: 246 seconds]
troydm has quit [Ping timeout: 268 seconds]
alfredo has quit [Quit: Textual IRC Client: www.textualapp.com]
richi235 has joined #ocaml
groovy3shoes has joined #ocaml
BitPuffin|osx has quit [Ping timeout: 260 seconds]
BitPuffin|osx has joined #ocaml
trapz has quit [Quit: trapz]
trapz has joined #ocaml
freechips has quit [Quit: WeeChat 1.7]
copy` has joined #ocaml
<infinity0> is there a way to have a polymorphic record type in ocaml, like polymorphic variants
freechips has joined #ocaml
<infinity0> like 'a where 'a has to have a "foo" field
<Drup> infinity0: objects
<Drup> (that is precisely what object typing is, structural subtyping for records)
<infinity0> hm well object typing also has dynamic dispatch, i don't need that
<Drup> it's pretty impossible to have both
BitPuffin|osx has quit [Remote host closed the connection]
freechips has quit [Quit: WeeChat 1.7]
freechips has joined #ocaml
<infinity0> ah, instead i managed to avoid needing this
GomJabbar has joined #ocaml
gtrak has joined #ocaml
tane has joined #ocaml
richi235 has quit [Ping timeout: 240 seconds]
taostein has quit [Quit: taostein]
spew has joined #ocaml
sz0 has quit [Quit: Connection closed for inactivity]
chindy_ has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
chindy has joined #ocaml
alienbot has joined #ocaml
frefity has quit [Ping timeout: 268 seconds]
ygrek has joined #ocaml
Anarchos has joined #ocaml
ygrek has quit [Remote host closed the connection]
frefity has joined #ocaml
ygrek has joined #ocaml
rand__ has joined #ocaml
<Sim_n> https://realworldocaml.org/v1/en/html/classes.html mentions how to use "object types as interfaces" and how flexible it ought to be, but when my actual class declares a method that is not on the "interface" type, the compiler complains. What am I missing here?
Sim_n is now known as Simn
<Drup> Simn: I'm not sure I understand, can you show an example ?
dhil has quit [Ping timeout: 256 seconds]
<Simn> Ah, it works if I make the extra methods private.
<Drup> that's because there is no subtyping here
<Simn> Right, but then the interface example is quite misleading.
<Drup> not really. If you write some function that takes something of type `< f : string -> unit ; .. >`, it will accept `new impl` just fine
<Drup> (because of the .., the type is open, and can accept bigger types)
<Drup> you can also coerce manually: `(new impl :> api)`
freechips has quit [Quit: WeeChat 1.7]
oriba has joined #ocaml
freechips has joined #ocaml
sepp2k has quit [Quit: Leaving.]
<Simn> Now that you mention it, I remember the coercion operator and that I had the exact same problem before.
ygrek has quit [Ping timeout: 260 seconds]
unbalancedparen has joined #ocaml
troydm has joined #ocaml
spew has quit [Ping timeout: 264 seconds]
octachron has quit [Quit: Leaving]
marsam has quit [Read error: Connection reset by peer]
troydm has quit [Ping timeout: 240 seconds]
marsam has joined #ocaml
troydm has joined #ocaml
marsam has quit [Remote host closed the connection]
dhil has joined #ocaml
spew has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
unbalancedparen has quit [Quit: WeeChat 1.7]
unbalancedparen has joined #ocaml
govg has quit [Ping timeout: 260 seconds]
govg has joined #ocaml
TheLemonMan has joined #ocaml
oriba has quit [Quit: WeeChat 1.7]
unbalancedparen has quit [Quit: WeeChat 1.7]
marsam has joined #ocaml
dhil has quit [Ping timeout: 240 seconds]
mengu has joined #ocaml
rand__ has quit [Quit: leaving]
<asdf0987> can someone help me with this error?: https://gist.github.com/zeldangit/da92f68cc4c9910a9e5dc03d0e330bbf
<asdf0987> It's in the first chapter of real world ocaml
trapz has quit [Quit: trapz]
<TheLemonMan> asdf0987, you probably want 'Time.to_sec_string ~zone:Core.Zone.local (time) ^ " -- " ^ message'
<TheLemonMan> Core has changed and RWO didn't catch up
<asdf0987> TheLemonMan: that was it! thank you!
asdf0987 has quit [Ping timeout: 260 seconds]
richi235 has joined #ocaml
ygrek has joined #ocaml
trapz has joined #ocaml
shinnya has joined #ocaml
CcxWrk has quit [Remote host closed the connection]
MercurialAlchemi has quit [Ping timeout: 260 seconds]
CcxWrk has joined #ocaml
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
unbalancedparen has joined #ocaml
silver has joined #ocaml
tormen has quit [Ping timeout: 264 seconds]
tormen has joined #ocaml
_andre has quit [Quit: leaving]
marsam has quit [Remote host closed the connection]
marsam has joined #ocaml
govg has quit [Ping timeout: 256 seconds]
govg has joined #ocaml
trapz has quit [Quit: trapz]
mrvn has joined #ocaml
unbalancedparen has quit [Quit: WeeChat 1.7]
vmonteco1 has joined #ocaml
<vmonteco1> Hello!
<vmonteco1> I have a little question : How can I define a variants list type? (foo | bar) list gives me a syntax error
<companion_cube> [`Foo | `Bar] list
<vmonteco1> Thank you! I'll try this :)
<vmonteco1> companion_cube: It works, thanks again!
<companion_cube> no pb :)
govg has quit [Ping timeout: 240 seconds]
<mrvn> vmonteco1: that's not a normal variant list though. For that you would first define a variant type then a list of that type.
<mrvn> type t = Foo | Bar type tlist = t list
<vmonteco1> mrvn: That's right, but in my current project I had to define a new type with only a subset of my previously defined variant :)
kakadu has quit [Remote host closed the connection]
govg has joined #ocaml
freechips has quit [Quit: WeeChat 1.7]
freechips has joined #ocaml
argent_smith has quit [Quit: Leaving.]
govg has quit [Ping timeout: 264 seconds]
lyxia has quit [Ping timeout: 240 seconds]
govg has joined #ocaml
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
lyxia has joined #ocaml
richi235 has quit [Ping timeout: 260 seconds]
thegameg has quit [Ping timeout: 260 seconds]
Simn has quit [Quit: Leaving]
orbifx has joined #ocaml
vmonteco1 has quit [Quit: leaving]
orbifx has quit [Ping timeout: 260 seconds]
orbifx has joined #ocaml
tane has quit [Quit: Leaving]
orbifx has quit [Ping timeout: 260 seconds]
rpg has joined #ocaml
gtrak has quit [Ping timeout: 260 seconds]
silver has quit [Ping timeout: 240 seconds]
eh_eff has joined #ocaml
thegameg has joined #ocaml
marsam has quit [Remote host closed the connection]
strykerkkd has joined #ocaml
jabroney has quit [Quit: Leaving.]
al-damiri has quit [Quit: Connection closed for inactivity]