<thelema>
joelr: That's not so bad. For command line processing, I have a (switch * spec list * (spec * (unit -> unit)) list * string) list
<joelr>
:D
<thelema>
joelr: well, it might help you to modularize a bit more
<thelema>
type item = string option
<joelr>
right
<thelema>
type reply = item list option
<thelema>
and then your final type is reply list
<joelr>
I was thinking that it may be a good idea to shield the users of the redis api from the redis internal types
<joelr>
thus no aliasing
<thelema>
back to the original question, collate takes a list with 2*n elements and turns it into a list of pairs?
<joelr>
i could easily do type bulk = string option and type multibulk = bulk list option
<thelema>
(maybe with some mapping along the way?)
<joelr>
correct
<joelr>
i solved the original collate issue in my 2nd paste
<thelema>
1871865?
<joelr>
1871899
<thelema>
okay then. Time for me to transport myself.
<joelr>
thelema: thanks!
ankit9 has joined #ocaml
avsm has quit [Ping timeout: 240 seconds]
avsm has joined #ocaml
larhat has quit [Quit: Leaving.]
ikaros has quit [Quit: Leave the magic to Houdini]
ocp has left #ocaml []
lopex has quit []
jonafan has quit [Quit: leaving]
jonafan has joined #ocaml
ymasory has quit [Quit: Leaving]
Yoric has quit [Quit: Yoric]
jld has joined #ocaml
avsm has quit [Ping timeout: 240 seconds]
avsm has joined #ocaml
eikke has quit [Ping timeout: 252 seconds]
ankit9 has quit [Quit: Leaving]
ftrvxmtrx has quit [Quit: Leaving]
boscop_ has joined #ocaml
<hnrgrgr>
whois thelema
<hnrgrgr>
whois flux
<hnrgrgr>
oups
boscop has quit [Ping timeout: 248 seconds]
boscop__ has joined #ocaml
<thelema>
hnrgrgr: hi
boscop_ has quit [Ping timeout: 240 seconds]
boscop__ has quit [Ping timeout: 240 seconds]
Associat0r has quit [Quit: Associat0r]
jderque has joined #ocaml
jamii has joined #ocaml
ulfdoz has joined #ocaml
avsm has quit [Quit: Leaving.]
Yoric has joined #ocaml
ftrvxmtrx has joined #ocaml
eikke has joined #ocaml
Associat0r has joined #ocaml
groovy2shoes has quit [Quit: It is now safe to turn off your groovebot.]
groovy2shoes has joined #ocaml
groovy2shoes has quit [Read error: Connection reset by peer]
groovy2shoes has joined #ocaml
sgnb` is now known as sgnb
joelr has quit [Quit: joelr]
Yoric has quit [Quit: Yoric]
groovy2shoes has quit [Read error: Connection reset by peer]
groovy2shoes has joined #ocaml
ankit9 has joined #ocaml
lopex has joined #ocaml
bzzbzz has quit [Quit: leaving]
Associat0r has quit [Quit: Associat0r]
lopex has quit [Ping timeout: 276 seconds]
lopex has joined #ocaml
groovy2shoes has quit [Read error: Connection reset by peer]
groovy2shoes has joined #ocaml
lpereira has joined #ocaml
_habnabit has joined #ocaml
<_habnabit>
If I'm writing a .mli for a module, and I want to make my own module-instance of Set.Make, how can I specify "I want this module signature to be the same as this other module signature"
<_habnabit>
i.e. I won't have to write out `module ColorSet: sig val empty; ... end`
<sheets>
_habnabit: include Set.Make?
<_habnabit>
sheets, so, `module ColorSet: sig include Set.Make end` ?
<sheets>
i believe Set.Make is a functor so you will probably have to apply it
<thelema>
_habnabit: module ColorSet : Set.S with elt = color
<_habnabit>
thelema, aha
<_habnabit>
thelema, out of cuiosity, where is this documented?
<thelema>
the return type of Set is already given as a module type
<thelema>
the with part or the "module ColoSet : Set.S"?
<_habnabit>
thelema, the with part
<_habnabit>
oh, ah, that's giving me a syntax error on 2.10. Is this a 2.12 thing?
<thelema>
no, it should work in 2.10
<thelema>
maybe I mess something up...
<thelema>
module ColorSet : Set.S with *type* elt = color
<thelema>
"To overcome this difficulty, Objective Caml provides a with type construct over signatures that allows to enrich a signature with extra type equalities:"
<_habnabit>
Oh, heh. I was reading that page, but skimmed over that bit
<_habnabit>
thanks, though
<thelema>
the manual is information-dense
<_habnabit>
hm, so, what's the difference between Set.Make and Set.S
<sheets>
Set.S is the signature of the set modules that Set.Make produces when applied
groovy2shoes has quit [Remote host closed the connection]
<thelema>
_habnabit: one is a type, the other is a functor
<_habnabit>
there's no .mli file for it, or a 'sig' for the module
<_habnabit>
This is a functor, right?
<thelema>
yes, it's a functor.
<thelema>
if that's not the whole file, it doesn't get a .mli file
<_habnabit>
And is there any easy way to get the returned module type out of the functor?
<thelema>
in 3.12 is, but not in 3.10
tildedave has quit [Quit: Leaving]
<_habnabit>
I'm trying to make a ColorSetFuns module
<_habnabit>
ah, okay.
<thelema>
s/is/there is/
jamii has quit [Ping timeout: 240 seconds]
<_habnabit>
so, since it's a functor without a module type, there's no way in 3.10?
<thelema>
it looks like the returned type is just "sig include Set.S val of_list : ... val map : ... val ppr : ... end
<thelema>
"
<thelema>
there's no way to automatically derive the returned type - you can still specify it by hand, even including Set.S so you don't have to repeat what comes out of Set.Make
<_habnabit>
hmm, okay
<thelema>
and if you're really lazy, ocamlc -i will generate the whole module type for you
<_habnabit>
and so is there a way to say 'this functor produces a module of this type', so I don't have to define the module type twice?
<_habnabit>
It looks like I can use -> for that as well
<thelema>
only the way that Set does, by explicitly declaring a module type for the output of the functor and using that type where you need it.
<_habnabit>
right, okay
<_habnabit>
functors are something I've basically never had to deal with before.
<thelema>
they're a bit intimidating at times
<thelema>
you'll become immune with repeated exposure. :)
<_habnabit>
hmm, okay, I think I'm getting it now.
<thelema>
there's no declaration of a type elt in SetFuns
<_habnabit>
Well. I should reword my question.
<thelema>
just remove line 2
<_habnabit>
Oh, I see.
Yoric has joined #ocaml
<_habnabit>
Well, now it's saying "Unbound type constructor elt"
<thelema>
yes, L3 doesn't have an elt type. just drop the "with ..."
<_habnabit>
ahh
<_habnabit>
Okay neat that did it.
<thelema>
*after* applying the functor, you can use 'with' to specify the type of elt
<thelema>
which is what you have on line 9 (except there's no type elt, you'll have to "with type S.elt = OT.elt" (I think that should work)
<_habnabit>
Okay double sweet now that I have `module type SF` my .mli file can do `module ColorSetFuns: MapsSets.SF`
<thelema>
you'll want a "with" there.
<_habnabit>
I'll try that with.
<thelema>
If it causes you trouble, you can put the 'type elt' back in and link everything in the signature back through it, although you'll have to put a 'type elt = OT.t' in your SetFuns body.
<_habnabit>
It was fine when I did `with type S.elt = O.t`
<_habnabit>
er, OT.T
<_habnabit>
t
<thelema>
great.
<_habnabit>
(since OT is the ordered type, not the set type.)
<_habnabit>
And I understand why it works! that's the most important part.
<_habnabit>
Anyway, lunchtime.
ymasory has joined #ocaml
sheets has quit [Ping timeout: 252 seconds]
groovy2shoes has quit [Read error: Connection reset by peer]
groovy2shoes has joined #ocaml
fraggle_ has quit [Ping timeout: 276 seconds]
groovy2shoes has quit [Read error: Connection reset by peer]
groovy2shoes has joined #ocaml
ankit9 has quit [Ping timeout: 252 seconds]
jderque has quit [Quit: leaving]
fraggle_ has joined #ocaml
eikke has quit [Read error: Operation timed out]
joelr has joined #ocaml
joelr has quit [Client Quit]
lpereira has quit [Quit: Leaving.]
groovy2shoes has quit [Quit: It is now safe to turn off your groovebot.]
ikaros has joined #ocaml
_andre has quit [Ping timeout: 258 seconds]
pdhborges has joined #ocaml
avsm has joined #ocaml
bzzbzz has joined #ocaml
avsm has quit [Client Quit]
tautologico has joined #ocaml
ymasory has quit [Read error: Operation timed out]
pdhborges has quit [Quit: Leaving.]
edwin has quit [Quit: Leaving.]
elehack has quit [Quit: Headed out, possibly to home]
ikaros has quit [Quit: Leave the magic to Houdini]
pdhborges has joined #ocaml
pdhborges has quit [Client Quit]
Yoric has quit [Quit: Yoric]
ymasory has joined #ocaml
lamawithonel has quit [Remote host closed the connection]
Modius has quit [Ping timeout: 248 seconds]
Modius_ has joined #ocaml
Amorphous has quit [Ping timeout: 240 seconds]
dnolen has joined #ocaml
Modius has joined #ocaml
Modius_ has quit [Ping timeout: 240 seconds]
Amorphous has joined #ocaml
fraggle_ has quit [Read error: Connection reset by peer]
fraggle_ has joined #ocaml
<_habnabit>
'when' has to apply to everything that's being matched?
<_habnabit>
I was trying to do `| None, None | Some x, Some y when x = y -> foo`
<_habnabit>
Too clever for my own good, I guess. ;<