omarramo has quit [Read error: Connection reset by peer]
omarramo has joined #ocaml
silver has quit [Read error: Connection reset by peer]
nomicflux has joined #ocaml
cpdean has joined #ocaml
rcabaco has joined #ocaml
rcabaco has quit [Ping timeout: 252 seconds]
omarramo has quit [Ping timeout: 240 seconds]
AlfredENeuman has quit [Ping timeout: 260 seconds]
AlfredENeuman has joined #ocaml
two_wheels has joined #ocaml
jao has quit [Ping timeout: 240 seconds]
snhmib has quit [Ping timeout: 255 seconds]
cpdean has quit [Quit: Leaving.]
xorpse has quit [Ping timeout: 240 seconds]
calculemus has quit [Ping timeout: 240 seconds]
calculemus has joined #ocaml
strmpnk has quit []
strmpnk has joined #ocaml
mfp has quit [Ping timeout: 256 seconds]
mfp has joined #ocaml
mfp has quit [Ping timeout: 256 seconds]
ryanartecona has joined #ocaml
wtetzner has joined #ocaml
wtetzner has quit [Remote host closed the connection]
cpdean has joined #ocaml
groovy2shoes has joined #ocaml
wtetzner has joined #ocaml
wtetzner has quit [Remote host closed the connection]
cpdean has quit [Quit: Leaving.]
Algebr`` has quit [Ping timeout: 240 seconds]
rgrinberg has quit [Remote host closed the connection]
MercurialAlchemi has joined #ocaml
nomicflux has quit [Quit: nomicflux]
FreeBirdLjj has joined #ocaml
pierpa has quit [Ping timeout: 240 seconds]
<flux>
leonidas, btw, I'm working on RTM for slacko.. I hope nobody hasn't yet implemented it?-)
trepta has quit [Ping timeout: 252 seconds]
MercurialAlchemi has quit [Ping timeout: 252 seconds]
roberto_ has quit [Quit: Leaving]
Guest82 has joined #ocaml
Guest82 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
MercurialAlchemi has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
fre has joined #ocaml
antkong has quit [Quit: antkong]
govg has quit [Quit: leaving]
govg has joined #ocaml
alfredo has joined #ocaml
Simn has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
fre has quit [Ping timeout: 255 seconds]
govg has quit [Ping timeout: 240 seconds]
FreeBirdLjj has joined #ocaml
jnavila has joined #ocaml
rcabaco has joined #ocaml
AltGr has joined #ocaml
rcabaco has quit [Ping timeout: 260 seconds]
sh0t has joined #ocaml
smondet has quit [Ping timeout: 256 seconds]
larhat has joined #ocaml
snhmib has joined #ocaml
zpe has joined #ocaml
fre has joined #ocaml
ocp has joined #ocaml
orbifx has joined #ocaml
rcabaco has joined #ocaml
rcabaco has quit [Ping timeout: 252 seconds]
kakadu has joined #ocaml
orbifx has quit [Ping timeout: 240 seconds]
kakadu has quit [Quit: Konversation terminated!]
FreeBirdLjj has quit [Remote host closed the connection]
<Leonidas>
flux: I don't think so. Thanks, looking forward to it. I should really get to fix the existing endpoints, but I'm currently rather busy moving and wrapping my things up :|
orbifx has joined #ocaml
Algebr`` has joined #ocaml
rcabaco has joined #ocaml
ocp has quit [Ping timeout: 245 seconds]
ygrek has quit [Ping timeout: 240 seconds]
ocp has joined #ocaml
ocp has quit [Ping timeout: 240 seconds]
ocp has joined #ocaml
FreeBirdLjj has joined #ocaml
<Leonidas>
flux: but I guess I'll have more time in April, and also more reason to use Slacko :)
orbifx has quit [Ping timeout: 245 seconds]
ltadeu has joined #ocaml
steve_gh has joined #ocaml
kakadu has joined #ocaml
mfp has joined #ocaml
silver has joined #ocaml
ohama has quit [Ping timeout: 240 seconds]
ohama has joined #ocaml
xorpse has joined #ocaml
<steve_gh>
Hi, I have a query about type signatures: I define a module type interface containing
<steve_gh>
type t = element list
<steve_gh>
type v
<steve_gh>
val lift : (v -> v) -> t -> t
infinity0 has quit [Ping timeout: 240 seconds]
<steve_gh>
when I instantiate the lift function I get a type mismatch error
infinity0 has joined #ocaml
<steve_gh>
Values do not match: val lift : ff:(v -> v) -> element list -> element list is not included in val lift : (v -> v)
<steve_gh>
-> t -> t
<theblatte>
your implementation has a named argument, the interface doesn't
<theblatte>
"ff:(v -> v)" vs "(v -> v)"
<steve_gh>
I'm not sure what the problem is - my understanding is that the signature defines a t as being an element list
<steve_gh>
but the compiler thinks that a t and an eleemnt list are different in tis context
<theblatte>
I think "t" vs "element list" is a red herring
<steve_gh>
ahh - so I need to name the argument in the signature
<theblatte>
the compiler probably knows they are the same and it's complaining about the named argument
<theblatte>
yes
<steve_gh>
thanks <theblatte> - seems to do the trick
infinity0 has quit [Remote host closed the connection]
<theblatte>
why ocaml shows you "element list" on one side and "t" on the other I don't know, sigh...
infinity0 has joined #ocaml
snhmib has quit [Read error: Connection reset by peer]
<reynir>
Elaborate prank
<reynir>
(hopefully not)
infinity0 has quit [Remote host closed the connection]
snhmib has joined #ocaml
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
_andre has joined #ocaml
relrod has quit [Ping timeout: 240 seconds]
snhmib has quit [Read error: Connection reset by peer]
steve_gh has quit [Ping timeout: 260 seconds]
dhil has joined #ocaml
relrod_ has joined #ocaml
relrod_ has quit [Changing host]
relrod_ has joined #ocaml
_steve__ has joined #ocaml
snhmib has joined #ocaml
_steve__ has quit [Remote host closed the connection]
ziyourenxiang has joined #ocaml
<companion_cube>
it would still be nice to have proper type diffs
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
fre has quit [Ping timeout: 240 seconds]
kakadu has left #ocaml ["Konversation terminated!"]
kakadu has joined #ocaml
<jerith>
Leonidas, flux: I'm going to try take a stab at writing some tests for slacko.
<jerith>
So far I've managed to get "assert_equal 1 1" (and "assert_equal 1 2" which fails) working with a little lwt test wrapper thing.
<Leonidas>
jerith: qcheck! :)
<jerith>
Leonidas: My little wrapper thing can probably go inside qcheck properties as easily as at ounit2 tests.
antkong_ has joined #ocaml
<Leonidas>
jerith: yes, I would expect it should work just fine :-)
<flux>
jerith, cool! I suppose the tests would mainly test if it can parse whatever the slack server throws it?
<jerith>
I want to start by figuring out how to talk to slack (preferably a fake slack) in tests.
<flux>
yes, start the project by writing a slack server clone ;-)
<Leonidas>
i wonder whether it is possible to call Travis CI every couple of weeks to make sure the interface did not break
<flux>
remember to take flooding limits into account when testing against real server.
<jerith>
And probably have a way to run against a real slack server for a subset of the tests to make sure the fake slack works for the things we don't need to control the server side for.
<Leonidas>
jerith: you can talk to real slack, the token can be supplied as secret env var
* Leonidas
can put in his own token, no problem
<jerith>
I've done this kind of thing a lot in Python.
<jerith>
Leonidas: For certain kinds of tests, it's really nice to control what the server does.
<jerith>
Also, talking to the public internet in your CI environment makes for flakey tests.
<jerith>
At least slack is likely to be less awful to test that twitter.
<jerith>
*than
<Leonidas>
jerith: yeah, it'd then be an integration-y test. Which is fine.
<jerith>
Yeah. The plan is to have both.
<Leonidas>
Since well there is just one Slack and if slacko doesn't work against it, then there is not much point :)
<jerith>
A pattern I've found very useful for this stuff is to put an abstraction boundary between the tests and the thing the tests talk to.
<Leonidas>
jerith: sure, I'm not aguing against this :)
<Leonidas>
I also have abstractions which replace e.g. a database
<Leonidas>
but then, the surface is also smaller and I control both sides
<jerith>
Then run against a fake (fast, controllable, etc.) for everything and occasionally run against the real service for the subset that it's feasible for to make sure the API hasn't changed underneath us.
fre has joined #ocaml
<jerith>
For my own services, I usually build a "verified fake" which is a lightweight in-memory version that clients can pull into their tests.
FreeBirdLjj has quit [Remote host closed the connection]
<Leonidas>
the problem is that you have to make sure the fake works as the original which can be tough
<jerith>
The "verified" bit is that I run the same tests against the real thing and the fake during builds of the real thing.
<jerith>
That obviously only works if you're the person building the real thing. :-)
FreeBirdLjj has joined #ocaml
<Leonidas>
maybe I should reach out to Slack whether they want to employ me :D
<jerith>
But building a fake that looks right and then running against the real service occasionally to verify it is better than nothing.
<jerith>
(It helps that when I build services at work I also usually build a client at the same time and everything's in the same language.)
<jerith>
Anyway, all of this is subject to actually having some free time to work on it.
<Leonidas>
Tell me about it :-/
<jerith>
Also, my cunning plan is to expose some kind of test API to programs that use slacko and want to test it.
Algebr`` has quit [Ping timeout: 258 seconds]
<jerith>
That want to test their use of slacko, that is. They shouldn't have to test slacko itself. :-)
_andre has quit [Ping timeout: 240 seconds]
<Leonidas>
I sometimes think of slacko as a tool to test slack itself :p
FreeBirdLjj has quit [Remote host closed the connection]
nomicflux has joined #ocaml
antkong_ has quit [Quit: antkong_]
omarramo has joined #ocaml
omarramo has quit [Read error: Connection reset by peer]
Sorella has joined #ocaml
omarramo has joined #ocaml
<flux>
I understand the problem is that the specification of slacko isn't complete, and perhaps not even correct from all the parts that are provided
<jerith>
I think the problem is that the slack API has changed since slacko was written.
<flux>
wouldn't you have the exact same problem with a dummy server?
omarramo has quit [Read error: Connection reset by peer]
<jerith>
Yes, which is why we need some integration tests that hit the real thing as well.
xorpse has quit [Ping timeout: 240 seconds]
omarramo has joined #ocaml
omar__ has joined #ocaml
ryanartecona has joined #ocaml
omarramo has quit [Ping timeout: 240 seconds]
srenatus[m] has quit [Remote host closed the connection]
M-jimt has quit [Remote host closed the connection]
timclassic has quit [Remote host closed the connection]
dfeldman[m] has quit [Remote host closed the connection]
M-Illandan has quit [Remote host closed the connection]
Bluddy[m] has quit [Read error: Connection reset by peer]
M-ErkkiSeppl has quit [Read error: Connection reset by peer]
aspiwack[m] has quit [Write error: Connection reset by peer]
ktosiek[m] has quit [Write error: Connection reset by peer]
na9da[m] has quit [Write error: Connection reset by peer]
barkmadley[m] has quit [Write error: Connection reset by peer]
regnat[m] has quit [Write error: Connection reset by peer]
M-martinklepsch has quit [Write error: Connection reset by peer]
omar__ has quit [Ping timeout: 252 seconds]
MercurialAlchemi has quit [Ping timeout: 258 seconds]
omar__ has joined #ocaml
cpdean has joined #ocaml
wtetzner has joined #ocaml
MercurialAlchemi has joined #ocaml
omarramo has joined #ocaml
omar__ has quit [Ping timeout: 240 seconds]
copy` has joined #ocaml
omarramo has quit [Ping timeout: 240 seconds]
n342 has joined #ocaml
n342 has left #ocaml [#ocaml]
wtetzner has quit [Remote host closed the connection]
n342 has joined #ocaml
<n342>
?
<n342>
hi, i was looking for a multidimensional optimization library in ocaml
<n342>
i found Gsl_multimin in gsl-ocaml
<n342>
is this the best one? are there other options?
trepta has joined #ocaml
dfeldman[m] has joined #ocaml
pierpa has joined #ocaml
omarramo has joined #ocaml
_andre has joined #ocaml
pierpa` has joined #ocaml
rossberg has quit [Remote host closed the connection]
fre has quit [Quit: WeeChat 1.6]
fre has joined #ocaml
rossberg has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 245 seconds]
omarramo has quit [Ping timeout: 248 seconds]
wtetzner has joined #ocaml
wtetzner has quit [Remote host closed the connection]
shinnya has joined #ocaml
trepta has quit [Ping timeout: 252 seconds]
lfish has joined #ocaml
fre has quit [Quit: WeeChat 1.6]
cpdean has quit [Quit: Leaving.]
sz0 has joined #ocaml
<lfish>
I have a little snippet of code I'm not quite sure of... are there any sites where I can upload it to get a review?
<twold>
To explain what I'm trying to achieve, I want to create a graphics app with multiple (lightweight) threads. In Haskell it's trivial, so I hoped I'd find a way to do it in Ocaml too :)
trevorriles has quit [Quit: ZNC 1.6.4 - http://znc.in]
<twold>
I'll check out lwt.wrap.
<_y>
(companion_cube, are you using some kind of bot or script or something?)
<orbifx>
Algebr``: do you know if `wrap` can cope with blocking code?
<Algebr``>
should be a bot
<Algebr``>
orbifx: I thought that was the right way to do it
trevorriles has joined #ocaml
<Algebr``>
Oh blocking code
<orbifx>
Algebr``: I think it wraps the value, but doens't mean it will yield if the code is blocking
<companion_cube>
_y: yes
<orbifx>
twold: what is important to understand about lwt (in my brief experience thus far) is that they are cooperative threads
<twold>
yes, I know that. that's why it's impossible to use blocking calls from the outside (unless I'm missing something). but there still should be a way to add them internally (although that might be way too difficult a task for what I want to achieve)
<twold>
yes, that's the idea but you still need some internal support, like here from lwt_engine
<Drup>
twold: I missed the beginning, what are you trying to do ?
<orbifx>
granted that there would be merit for the core language to multicore support, what are you wanting to achieve in this case _whitelogger ?
<orbifx>
oops, meant to write twold
<twold>
Drup: oh, just write an interactive graphics app with several threads: one for processing input, one for updating state, one for rendering, ...you get the idea
<Drup>
twold: to turn a blocking call into an lwt thread, use Lwt_preemptive
<twold>
and I'd like to use lightweight threads if at all possible. if not, I'll fall back to OS threads, I suppose
<Drup>
it'll spawn an OS thread and wrap it inside an lwt promise to make it interact with the rest of lwt cleanly
<twold>
orbifx: oh, I just wanted the threads, no matter the cost :) I know multicore is overkill. still, the effects there are beautiful and I'd definitely use those too
<orbifx>
twold: Drup is right about using preemptive
<twold>
Drup: thanks, sounds like exactly what I need
<orbifx>
twold: also it will be most likely system calls that block, in which case lwt_unix might have most of the wrapped. But where not, use preemptive as Drup suggested.
<orbifx>
Go for it :D
<companion_cube>
with effects, will there be no need for lwt anymore? :p
<Drup>
If you want to interact with an existing event look, look at Lwt_glib for an example on how to do it
<Drup>
event loop*
<twold>
great hints everyone, I think I can play with this stuff for couple more hours before hitting another wall. many thanks :)
<orbifx>
:)
<orbifx>
new to ocaml twold ?
yomimono has quit [Ping timeout: 256 seconds]
<twold>
yeah, only started a week ago or so
<orbifx>
welcome
<companion_cube>
welcome indeed!
<twold>
but I'm familiar with Haskell and Standard ML, so it's the ecosystem I'm getting stuck at mostly
<twold>
thank you :)
<orbifx>
you aren't alone
<orbifx>
the ecosystem if daunting at first
<orbifx>
if not downright irritating
<Drup>
twold: Lwt_react (and react itself) might be of interest too
<mengu>
twold: core is an awesome library, opam is working, tuareg & merlin is good
<twold>
yeah, it makes me wanna quit roughly every five minutes :D I'm glad I haven't yet, I think I'm beginning to see the light at the end of the tunnel :)
trevorriles has quit [Quit: ZNC 1.6.4 - http://znc.in]
<mengu>
the only thing lacking is docs but when we're stuck, nice fellas here is always giving a hand
trevorriles has joined #ocaml
<orbifx>
twold: don't quit for 3-6 months, then decide :P
<twold>
Drup: thanks, I'll keep Lwt_react in mind, although I played with reactive stuff enough to know it's usually more pain than gain
trevorriles has quit [Client Quit]
trevorriles has joined #ocaml
<twold>
well, #ocaml definitely saved the day for me today :)
<orbifx>
I worked with Haskell for year before moving on to OCaml, because of haskells compilers and tools. I liked that with OCaml seems to care about lower level more
<Drup>
FRP+haskell is a bit annoying because of lazyness and space leaks, it's less disastrous in OCaml, although it's indeed an acquired taste
<companion_cube>
merlin is definitely better than anything similar in haskell
<mengu>
tuareg is also superior
<mengu>
emacs & haskell don't go hand in hand
<mengu>
vim's haskell support is superior
<Armael>
what's the complexity of set intersection? (using Set from the stdlib)
<Drup>
Armael: pretty sure you can't do better than n² with comparison-based approached, no ?
<twold>
mengu: not true anymore, intero is a great mode for emacs
<twold>
I'd say better than tuareg, but I'm not that familiar with tuareg yet
<mengu>
twold: i have intero
<twold>
oh, so if you think tuareg is better then I'm looking forward to learning more :)
<mengu>
and haskell-mode
<Armael>
Drup: yea I guess
<companion_cube>
Drup: I'd bet it's lower
<companion_cube>
Set.union is definitely less than n²
<companion_cube>
(thanks to the recursive split)
<Drup>
hum, right
<companion_cube>
I think it's something like O(n log(n)), where n is the size of the intersection
<twold>
O(m*log(nm + 1)), m <= n for sets of different size
<twold>
I mean, I'm not sure Ocaml's implementation is this fast, just that there is an algorithm
relrod_ is now known as relrod
<companion_cube>
possibly
<companion_cube>
the sets are pretty fast
Flerex has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
nightmared has quit [Remote host closed the connection]
yomimono has joined #ocaml
nightmared has joined #ocaml
moei has joined #ocaml
jao has quit [Ping timeout: 245 seconds]
Muzer has quit [Ping timeout: 256 seconds]
sh0t has quit [Remote host closed the connection]
yomimono has quit [Ping timeout: 255 seconds]
kakadu has quit [Remote host closed the connection]
yomimono has joined #ocaml
<orbifx>
is it possibly to apply? a `try ... with ...` expression
<orbifx>
is it possibly to apply a `try ... with ...` expression
<companion_cube>
(try f with _ -> g) x
<companion_cube>
you mean that?
<orbifx>
yeah
<companion_cube>
sure
Simon` has joined #ocaml
<orbifx>
even with a partially applied function?
<orbifx>
let f x y z = ... in (try f x y with ...) z
<orbifx>
?
Muzer has joined #ocaml
jao has joined #ocaml
<companion_cube>
well, it's an expression like any other
<orbifx>
if I move the `try selector ...` out of the chain and apply the argument normally, it works
<orbifx>
but when I have it as a partially applied function in the chain, compilation fails with: Error: This expression has type 'a option
<orbifx>
but an expression was expected of type string -> 'b
<companion_cube>
just a normal type error
<companion_cube>
can't help you with just that :p
<companion_cube>
remember that `selector repo` should have the type option
<companion_cube>
clearly it is partially applied
<orbifx>
I think it's not possible to have a partially applied function inside a try .. with
<companion_cube>
it is
<companion_cube>
but you return `None` in the `with` branch
<orbifx>
come to think about it, the application is not being tried, it would mean that I am asking it to try the partially applied function, not the evaluation of it
<companion_cube>
which is clearly not a function :p
<companion_cube>
partially applied functions can sometimes raise :p
<companion_cube>
let f x = if x=0 then raise Exit; fun y -> y/x
<orbifx>
right, so I would need to return (fun _ -> None)
<orbifx>
I don't think that makes sense :P
<companion_cube>
why not?
<companion_cube>
(well, it's a bit odd, but it's valid)
<orbifx>
it "tries" something (i.e. after it has applied the argument) and then if that fails it return a function to be applied to what?
<companion_cube>
to the remaining arguments?
<orbifx>
the argument was already used.
<companion_cube>
then it's not partially applied -_-
<orbifx>
what if the argument has mutability ? the exception handler and normally expression would be applied to different values
<companion_cube>
I really don't get what you're trying to do, honestly
<companion_cube>
try any expression, it works
<companion_cube>
you just have to put the same type in `try` and `with`
<orbifx>
I'm trying it.. and it would be kinda cool if it reused the same value (i.e. it trys to apply it to one and if not it applied it to the exception handler)
<companion_cube>
it would be kinda inconsistent, you mean :p
<orbifx>
yes
Simon` has quit [Remote host closed the connection]
<orbifx>
wait no :P
mengu has quit [Ping timeout: 256 seconds]
<orbifx>
was trying it now, it compiles
<shon>
Heya.
mengu has joined #ocaml
<orbifx>
this is pretty cool. So it applies to the value, and it that application raises, then it applies the value to the exception handler?
<shon>
What's the standard practice for using utop with a project involving many modules etc?
<shon>
Does one just build an intracte init, or build a custom utop?
<shon>
*intricate
cpdean has quit [Quit: Leaving.]
<companion_cube>
orbifx: it evaluates the usual way `try with` works
<companion_cube>
nothing is different, (partially applied) functions are like any other values
<companion_cube>
shon: I tend to write a .ocamlinit
<shon>
Thank companion_cube. That makes for a lot of duplicate entries when you add a package, right? Add once to your .merlin, once to your _oasis (or whatever) and once to your .ocamlinit
<companion_cube>
yeah, agreed
<shon>
Seems that's laborious enough someone must have a more elegant approach by now?
<companion_cube>
this is annoying, but I don't know of a really better approach yet
<shon>
Or is that the state of the art?
<companion_cube>
the clean solution would be for oasis to generate a .merlin, for a start
<companion_cube>
I just don't have the motivation to do it myself
<companion_cube>
(same for .ocamlinit, in theory oasis has every information needed)
<shon>
Well, cool. I like a language with low-hanging tooling fruit :) (Not that I'm tall enough to reach even the low fruit yet!)
<shon>
Yeah, that sounds right.
<companion_cube>
:D
<companion_cube>
well if you feel like contributing this to oasis, it would be very nice
<companion_cube>
there's a gitter channel if you want to ask @gildor questions
<companion_cube>
anyway, my bed awaits
<shon>
Sounds like a fun project, only I wonder if it's over my head?
<shon>
Good night!
<companion_cube>
write a bit of OCaml first :p
<companion_cube>
(something simple that you can write from scratch)
<orbifx>
companion_cube: thanks, couldn't use it anyway, because it was in lwt, so I had to not return a function but a value (Even though functions are values.. blah blah)
cpdean has joined #ocaml
Simn has quit [Quit: Leaving]
octachron has quit [Quit: Leaving]
<orbifx>
but first time I've come to think about partially applied exception blocks in functional terms, that is ccool :)