mcclurmc has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
amirmc has joined #ocaml
<whitequark>
jpdeplaix: it's done when it is needed...
amirmc has quit [Ping timeout: 272 seconds]
nikki93 has joined #ocaml
michael_lee has joined #ocaml
milosn_ has joined #ocaml
milosn has quit [Ping timeout: 246 seconds]
tntnt has quit [Ping timeout: 245 seconds]
tntnt has joined #ocaml
ollehar has quit [Ping timeout: 245 seconds]
amirmc has joined #ocaml
kyrylo has quit [Ping timeout: 245 seconds]
amirmc has quit [Ping timeout: 245 seconds]
tntnt_ has joined #ocaml
tntnt has quit [Ping timeout: 252 seconds]
tntnt_ is now known as tntnt
nikki93 has quit [Remote host closed the connection]
pango has quit [Ping timeout: 245 seconds]
nikki93 has joined #ocaml
nikki93 has quit [Remote host closed the connection]
nikki93 has joined #ocaml
nikki93 has quit [Remote host closed the connection]
nikki93 has joined #ocaml
amirmc has joined #ocaml
amirmc has quit [Ping timeout: 272 seconds]
pango has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
tntnt_ has joined #ocaml
mcclurmc has joined #ocaml
tntnt has quit [Ping timeout: 246 seconds]
tntnt_ is now known as tntnt
Xenasis has quit [Remote host closed the connection]
mcclurmc has quit [Read error: Connection reset by peer]
mcclurmc has joined #ocaml
amirmc has joined #ocaml
amirmc has quit [Ping timeout: 272 seconds]
nikki93 has quit [Remote host closed the connection]
Neros has quit [Ping timeout: 272 seconds]
nikki93 has joined #ocaml
amirmc has joined #ocaml
amirmc has quit [Ping timeout: 260 seconds]
mcclurmc has quit [Remote host closed the connection]
tntnt has quit [Quit: tntnt]
mcclurmc has joined #ocaml
mcclurmc has quit [Ping timeout: 272 seconds]
mcclurmc has joined #ocaml
mcclurmc has quit [Ping timeout: 265 seconds]
amirmc has joined #ocaml
amirmc has quit [Ping timeout: 272 seconds]
bjorkintosh has quit [Ping timeout: 248 seconds]
nikki93 has quit [Remote host closed the connection]
w0rm_x has joined #ocaml
w0rm_x has quit [Ping timeout: 246 seconds]
amirmc has joined #ocaml
amirmc has quit [Ping timeout: 246 seconds]
ygrek has quit [Ping timeout: 265 seconds]
strobegen has joined #ocaml
amirmc has joined #ocaml
manud_ has joined #ocaml
amirmc has quit [Ping timeout: 245 seconds]
mcclurmc has joined #ocaml
mcclurmc has quit [Ping timeout: 264 seconds]
thelema has joined #ocaml
amirmc has joined #ocaml
aggelos has quit [Ping timeout: 252 seconds]
osa1 has quit [Quit: Konversation terminated!]
manud_ has quit [Ping timeout: 265 seconds]
amirmc has quit [Ping timeout: 252 seconds]
thelema has quit [Ping timeout: 264 seconds]
ygrek has joined #ocaml
manud_ has joined #ocaml
amirmc has joined #ocaml
amirmc has quit [Ping timeout: 245 seconds]
shinnya has joined #ocaml
thelema has joined #ocaml
ggole has joined #ocaml
mcclurmc has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
Yoric has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
thelema has quit [Remote host closed the connection]
thelema has joined #ocaml
thelema has quit [Ping timeout: 260 seconds]
thelema has joined #ocaml
Kakadu has joined #ocaml
wormphlegm has quit [Ping timeout: 260 seconds]
thelema has quit [Ping timeout: 245 seconds]
amirmc has joined #ocaml
amirmc has quit [Ping timeout: 246 seconds]
aggelos has joined #ocaml
Yoric has quit [Ping timeout: 252 seconds]
wormphlegm has joined #ocaml
nikki93 has joined #ocaml
nikki93 has quit [Remote host closed the connection]
nikki93 has joined #ocaml
wormphlegm has quit [Ping timeout: 272 seconds]
amirmc has joined #ocaml
Yoric has joined #ocaml
amirmc has quit [Ping timeout: 245 seconds]
Simn has joined #ocaml
zxqdms has joined #ocaml
AltGr has joined #ocaml
amirmc has joined #ocaml
<whitequark>
I've just realized that using first-class modules very much remind me using C++'s templates.
amirmc has quit [Ping timeout: 265 seconds]
<adrien>
first-class modules? why?
<whitequark>
well, it's a very common pattern to have a module with type t and a bunch of functions using it... this is equivalent to a nonvirtual class. and if you add modules to the mix... functor(M) -> ~ template<class M>
yacks has quit [Read error: Operation timed out]
yacks has joined #ocaml
amirmc has joined #ocaml
amirmc has quit [Ping timeout: 246 seconds]
kyrylo has joined #ocaml
thelema has joined #ocaml
ygrek has quit [Ping timeout: 272 seconds]
BitPuffin has joined #ocaml
wormphlegm has joined #ocaml
wormphlegm has quit [Ping timeout: 245 seconds]
mfp has quit [Ping timeout: 252 seconds]
mystica555-work has joined #ocaml
<mystica555-work>
i know nothing about this wonderful language; and am attempting to figure out why this happens:
<mystica555-work>
02:01:50 [dynamic.loader:2] Could not load plugin file /usr/local/lib/liquidsoap/scm/plugins/fdkaac_loader.cmxs: error loading shared library: /usr/local/lib/liquidsoap/scm/plugins/fdkaac_loader.cmxs: undefined symbol: camlFdkaac_dynlink.
<mystica555-work>
so its looking for the symbol "where"
<mystica555-work>
i don't understand how this links (as much as I do for example, with ld.so and linking C stuff at runtime) so i don't really know where i need to look for symbol names appearing or not appearing
<mystica555-work>
as in, where in which files on disk
mfp has joined #ocaml
<mystica555-work>
(not some api call i could do, or anything abstracted, i simply need to know what i can run 'strings' on to find a symbol name)
root_empire has joined #ocaml
<whitequark>
mystica555-work: .cmxs files are loaded more or less like dynamic libraries in C programs; think .so files
<whitequark>
symbols in them are resolved from the image of the process which loads it
<whitequark>
(again, there's the analogue of RTLD_LOCAL of dlopen)
<whitequark>
oh, nevermind the last remark, the symbol which is not found is a native symbol
michael_lee has quit [Ping timeout: 264 seconds]
<whitequark>
you can look at loaded objects in /proc/$PID/maps
nikki93 has quit [Remote host closed the connection]
jzelinskie_ has joined #ocaml
jzelinskie is now known as Jimi`
jzelinskie_ is now known as jzelinskie
<whitequark>
how can I use 'with type' construct with polymorphic types?
yacks has quit [Ping timeout: 246 seconds]
<whitequark>
"with type foo = 'a bar" barfs at "Unbound type parameter 'a"
Yoric has quit [Ping timeout: 240 seconds]
<jpdeplaix>
whitequark: AFAIK, you can't. But you can wrap the 'a with « type tmp = {bar : 'a. 'a bar} » and then « with type foo = tmp »
<adrien>
GAH
<adrien>
CAMLprim value unix_link(value path1, value path2)
<adrien>
if (! pCreateHardLink(String_val(path2), String_val(path1), NULL)) {
<jpdeplaix>
But I don't know if it feels your need
<jpdeplaix>
fills*
<adrien>
that's some of the things I hate with windows support
<whitequark>
jpdeplaix: that's an interesting construct
<whitequark>
'a. 'a bar <- is 'a existential here?
<jpdeplaix>
yep, I think
<def-lkb>
it's universal
amirmc has joined #ocaml
<def-lkb>
you can use GADT to introduce existential, eg type foo = Foo : 'a bar -> foo
jbrown has quit [Ping timeout: 252 seconds]
<whitequark>
hm
jbrown has joined #ocaml
<whitequark>
this is such a pain :/
<def-lkb>
what are you trying to do ?
amirmc has quit [Ping timeout: 260 seconds]
<whitequark>
I have a module which performs data storage, well, it's like Hashtbl
<def-lkb>
(the other ways to get existentials is encoding with universal and negations, this is pain, and packed modules)
<whitequark>
and I have a parametric type with phantom parameters
<whitequark>
and I'm trying to save the latter into the former
<whitequark>
think using 'a thisisint as keys in Hashtbl.
<def-lkb>
wrapping them is a GADT seems to be a rather lightweight encoding.
<def-lkb>
in*
<whitequark>
I don't even need to access 'a in any way inside
<whitequark>
is there no way to avoid additional indirection?
<rks`>
Obj.
<whitequark>
sigh
thomasga has joined #ocaml
<def-lkb>
if those are phantom types you control, you can manage to have your own top type to cast to
<whitequark>
but, that would break safety provided by phantom types, pretty much making them useless
<def-lkb>
you just said that you don't even need to access them, so they provide no safety in this part of your code.
<whitequark>
what I basically want is to enrich the signature of the returned storage module with those phantom types
<whitequark>
_inside_ it, they don't matter. outside, I want them to be checked
<whitequark>
does this make sense?
<def-lkb>
I think :).
<whitequark>
I'm currently trying to do it with another functor
<def-lkb>
Can't you drop the phantom parameter _inside_ ?
<whitequark>
how would I do that?
<def-lkb>
Can you show some part of your code ?
manud_ has quit [Ping timeout: 260 seconds]
<whitequark>
I'll try to write a self-contained example
<def-lkb>
(One way to do that is to keep enough knowledge on your types in the implementation, so that you can recover the fact that ('a,'b,…) t is an alias to int, but only expose t as an abstract type in the signature)
<whitequark>
also I'm now 100% confident first class modules are just like templates: you never know if you can do what you want, and if you can, too often you wish you couldn't
<ggole>
The best kind of language feature.
<whitequark>
now I wonder if I can (ab)use modules as values to regain the flexibility I lost when I added another functor and flattened apples...
rand000 has joined #ocaml
<whitequark>
Error: This expression has type Box.Data.t but an expression was expected of type Box.Data.t The type constructor Box.Data.t would escape its scope
<ggole>
If you are creating a first class module, the type constructors have to remain hidden within the scope
<ggole>
Ie, given let foo x = let module Foo = type t ... in x, you can't have a Foo.t in the expression x
<whitequark>
my brain hurts.
<ggole>
Basically Foo is supposed to be "new" each time through the function
<whitequark>
hm, I added more information, but it still fails
<whitequark>
Error: This expression has type AppleKind.t Apple.apples = int but an expression was expected of type AppleKind.t Apple.apples = int The type constructor AppleKind.t would escape its scope
thelema has joined #ocaml
<whitequark>
I guess if they both = int anyway then it shouldn't matter?
<Drup>
oh, you don't want to mix green and red apples ?
mcclurmc has joined #ocaml
nikki93 has quit [Ping timeout: 264 seconds]
<whitequark>
Drup: yep
<whitequark>
maybe I should've named them apples and oranges :]
<Drup>
I am not completly sure you are clear about what you want to do yourself :p
wormphlegm has joined #ocaml
<whitequark>
I am. there are red apples and green apples, and a set of apple operations
<whitequark>
it's fine to add red and red apples, and green and green apples, but not red and gree.
<whitequark>
module Storage represents generic serialization of a particular type
<ggole>
Is this to work around the type constructor arity thing? Where you decorate a type with a phantom 'a and then can't do something like module AppleSet = Set.Make(Apple) with t = 'a apple?
<whitequark>
in this case, since red/green apple types are phantom, serialization algorithm does not depend on the kind of apple
<whitequark>
ggole: exactly.
<ggole>
Yeah, I ran into that. Very annoying.
<whitequark>
how did you solve it?
<ggole>
Removed the phantom types.
<Drup>
whitequark: why do you need phantom types instead of simply different types ?
<whitequark>
Drup: because no apple operations are dependent on their color, it's simply there to disallow mixing them
<whitequark>
think of measurement units
<Drup>
phantom types are usually used if you need to actually compute some stuff inside the type
<Drup>
you are using a functor over apples anyway ...
<whitequark>
a functor over apples is how I'm trying to solve this.
avsm has quit [Quit: Leaving.]
wormphlegm has quit [Ping timeout: 260 seconds]
<Drup>
if you use a functor, you're better of getting rid of the phantom type anyway, since the solution is the same
<ggole>
So you have RedApple.t and GreenApple.t?
<whitequark>
ggole: yes, that is another way to look at it
<whitequark>
I think I'll just cast the phantom type away with Obj.magic.
<Drup>
whitequark: you're really better of using different types and a functor over those....
<ggole>
So you'll have module AppleSet = Set.Make(Apple) with t = any apple, and then diddle the elements into, say, green apple on the way out?
<ggole>
I considered that solution, but didn't care for the cast :/
<whitequark>
ggole: yes, that's what I'm thinking about
<ggole>
I tried polymorphic variants, too. Didn't work out.
<ggole>
Because if you do something like module AppleSet = Set.Make(Apple) with t = [< `Foo | `Bar] apple, the variant needs an (implicit) type variable and the arity is wrong again.
AltGr has left #ocaml []
<Drup>
ggole: just close the type
Neros has joined #ocaml
<whitequark>
oh wait, this could work for me
<ggole>
I don't think that works either
<Drup>
do you really need the variance annotation in this case ?
<ggole>
I think so: let me look at the original code in which I tried it
<whitequark>
yeah, without variance annotation it's similarly useless
<ggole>
Needs to be abstract: module Foo : sig val test: unit -> unit end = struct type foo = Zot | Bam exception Foo of foo let test () = raise (Foo Zot) end
<ggole>
(Because the toplevel knows about the visible parts of module signatures, I think.)