failproofshark has quit [Ping timeout: 246 seconds]
orbifx has quit [Ping timeout: 240 seconds]
spew has quit [Quit: Leaving]
FreeBirdLjj has joined #ocaml
isd has quit [Ping timeout: 240 seconds]
jao has quit [Ping timeout: 240 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 256 seconds]
cobreadmonster has joined #ocaml
jeffmo has quit [Quit: Connection closed for inactivity]
zolk3ri has quit [Remote host closed the connection]
cbot_ has joined #ocaml
dtornabene has joined #ocaml
mfp has quit [Ping timeout: 276 seconds]
jimmyrcom has quit [Ping timeout: 260 seconds]
jimmyrcom has joined #ocaml
jimmyrcom has quit [Ping timeout: 246 seconds]
mbuf has joined #ocaml
jimmyrcom has joined #ocaml
gentauro has quit [Ping timeout: 264 seconds]
<_xvilka_>
hi! If I have a C structure with a member like "anotherstructuretype *ptr;" where ptr is in fact dynamic array [], how I can convert it to the usual OCaml list? Using Ctypes
<companion_cube>
OCaml lists really are not like arrays
gentauro has joined #ocaml
<companion_cube>
so afaik there is no direct conversion
<companion_cube>
you might want to expose a function for getting the length (as an int)
<companion_cube>
and a function for accessing elements in the range [0,…len-1]
<_xvilka_>
companion_cube: well, I don't really care about the order, so converting to the usual list is perfectly fine
<companion_cube>
no but I mean, there is not direct conversion, the array style is the easiest
<companion_cube>
then on OCaml side you can build whatever you want (list, array, whatever) using the C functions
<companion_cube>
anyway, gn
<_xvilka_>
gn
<_xvilka_>
(I have no control on the C side of the code, so can't expose anything but to use just the pointer)
<companion_cube>
my point exactly, start from that
MercurialAlchemi has quit [Ping timeout: 240 seconds]
FreeBirdLjj has joined #ocaml
mk9 has joined #ocaml
jeffmo has joined #ocaml
tarptaeya has joined #ocaml
jao has joined #ocaml
zlsyx has joined #ocaml
hdon_ has joined #ocaml
zolk3ri has quit [Ping timeout: 256 seconds]
andreas_ has quit [Quit: Connection closed for inactivity]
<hdon_>
hi all :) i'm learning some functional languages and i wanted to ask some questions about the paradigm in general, and specifically how i/o tends to be modeled. i have some familiarity with oz/mozart where variables can be resolved asynchronously. i'd sort of imagined that in some functional languages, i/o would be done this way: maybe a queue that is not fully determined represents input and output streams,
<hdon_>
or more generally, all input and all output, thus making the program's evaluation in real time a purely functional mapping between an ordered collection of input and output events. how far off the mark am i? :)
<hdon_>
s/asynchronously/asynchronously and gradually
zolk3ri has joined #ocaml
<def`>
While there is no mechanism built into the language (as in Oz), some libraries offer that kind of abstraction and it is quite popular in OCaml to do that way.
<def`>
For instance, `'a Lwt.t` represents such a value: an 'a that might not be determined yet.
<def`>
The two main libraries for that are Async and Lwt, with the Async_io and Lwt_io modules to deal with i/o.
<hdon_>
thanks def` :) without support from the language and runtime, how can a function know to be re-evaluated once a value transitions to fully-determined value?
<def`>
The function doesn't know, but it is wrapped in some abstract data that carries everything that is needed to know.
<def`>
function is the basic abstraction for computation, and libraries build upon that. The notion of monad capture the minimal interface to make that well-behaved...
<def`>
It is a bit abstract when said that way, but looking at these libraries will help.
<def`>
(however the code is a bit out of date, the library changed a lot and the chapter hasn't been updated, though people are working on that)
* hdon_
clicks
pistachio2 has quit [Quit: WeeChat 1.9]
mk9 has quit [Quit: mk9]
hdon_ has quit [Ping timeout: 240 seconds]
mk9 has joined #ocaml
ollehar has quit [Ping timeout: 248 seconds]
zlsyx has quit [Read error: Connection reset by peer]
jao has quit [Ping timeout: 246 seconds]
mk9 has quit [Quit: mk9]
cbot has joined #ocaml
silver has joined #ocaml
silver has quit [Remote host closed the connection]
hdon_ has joined #ocaml
silver has joined #ocaml
<hdon_>
thanks def` :)
<companion_cube>
I'd kill for implicits right now
hdon_ has quit [Changing host]
hdon_ has joined #ocaml
shinnya has quit [Ping timeout: 265 seconds]
Bronsa has joined #ocaml
failproofshark has joined #ocaml
hdon_ has quit [Ping timeout: 240 seconds]
ziyourenxiang has quit [Ping timeout: 240 seconds]
butterthebuddha has quit [Max SendQ exceeded]
butterthebuddha has joined #ocaml
Haudegen has quit [Remote host closed the connection]
gtrak has quit [Ping timeout: 256 seconds]
gtrak has joined #ocaml
ygrek has quit [Ping timeout: 256 seconds]
hdon_ has joined #ocaml
AltGr has left #ocaml [#ocaml]
gtrak has quit [Ping timeout: 246 seconds]
gtrak has joined #ocaml
tane has joined #ocaml
kakadu has quit [Quit: Konversation terminated!]
butterthebuddha has quit [Max SendQ exceeded]
butterthebuddha has joined #ocaml
Haudegen has joined #ocaml
unyu has joined #ocaml
mk9 has joined #ocaml
kakadu has joined #ocaml
jao has joined #ocaml
kolko has joined #ocaml
kolko has quit [Ping timeout: 256 seconds]
<hannes>
in opam, is there a way to show all transitive dependencies for a given package? bonus point for only runtime-dependencies
<kit_ty_kate>
hannes: runtime is complicated but otherwise « opam list --recursive » is probably what you looking for
<hannes>
kit_ty_kate: thanks, so far "opam info -f depends tcpip" gives me a list, but that's both runtime and buildtime, and also doesn't include the transitive deps
<hannes>
"opam list --recursive" doesn't do what i'd like it to do (opam 1.2.2 here)
Bronsa` has joined #ocaml
slash^ has joined #ocaml
magicbit has joined #ocaml
gtrak has quit [Ping timeout: 240 seconds]
<kit_ty_kate>
hannes: sorry I didn't give you the full command: opam list --recursive --resolve=tcpip
<kit_ty_kate>
this works with opam1
gtrak has joined #ocaml
zlsyx has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
<magicbit>
When writing OCaml I very often find myself using the @@ application operator, even chaining several of them. Is there a general guideline or consensus as to whether its use is a good practice? Is limiting the amount of parens its only use?
<companion_cube>
it's designed to limit the number of ( ), yes
<magicbit>
Okay, and on its use with `ignore', I’ve sometimes seen `ignore @@ …', `… |> ignore' and `ignore (…)'. Is one of them more idiomatic or is it just a matter of taste?
letoh_ has joined #ocaml
letoh has quit [Ping timeout: 265 seconds]
letoh_ is now known as letoh
isd has joined #ocaml
zpe has quit [Remote host closed the connection]
<companion_cube>
same thing, I think
<magicbit>
Okay, thanks!
tarptaeya has quit [Quit: Byeeeeeee!]
m4lvin has joined #ocaml
<m4lvin>
Hello, complete ocaml noob here ;-) Can someone tell me what "name.syntax" package dependencies should do?
<companion_cube>
it's old camlp4 stuff, for extending the syntax
<m4lvin>
my problem is>: ocamlfind: Package `cstruct.syntax' not found
<companion_cube>
nowadays you should probably look for "name.ppx"
<m4lvin>
ah
<companion_cube>
although for cstruct I'm not sure what the current state of things is