madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
john51_ has quit [Ping timeout: 264 seconds]
seangrove has quit [Ping timeout: 246 seconds]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
kratos has joined #ocaml
<kratos>
Anyone can help me to find a functoin that sum first member of two coupleif their second member are equal ? for exemple sum [(a,1);(b,2);(c,3);(d,1);] will return [(a+d,1);(b,2);(c,3)]
orbifx has quit [Ping timeout: 244 seconds]
john51 has joined #ocaml
<kratos>
I started to match the two first couple, match p with [] -> acc ... | (a,d)::(c,d)::ll when a = d -> ... I have a problem her how to compar compar (a+c,d) with ll ?
madroach has joined #ocaml
<kratos>
correct **when d = d - > ...
<tobast>
kratos: I suppose the easiest way would be to use a map, and then convert it back to a list if you need a list.
<mrvn>
or hashtbl or sort the list by the second member first
<tobast>
Yeah, sorting would work great too
picolino has quit [Ping timeout: 244 seconds]
<mrvn>
Hashtbl would be O(n), sorting and map O(n * log n)
madroach has joined #ocaml
<tobast>
Yeah, but a hashtable is less OCaml-ish :) (Though it is indeed more efficient)
madroach has quit [Read error: Connection reset by peer]
<mrvn>
or: let rec loop = function [] -> [] | (a, b)::zs -> let (xs, ys) = ( List.filter (fun (c, d) -> b = d) zs in (List.fold_left (fun acc (e, f) -> acc + e) a xs, b) :: (loop ys)
<mrvn>
O(n^2)
<mrvn>
and not tail recursive but you can fix that
madroach has joined #ocaml
mistermetaphor has quit [Remote host closed the connection]
mistermetaphor has joined #ocaml
mistermetaphor has quit [Remote host closed the connection]
silver has quit [Quit: rakede]
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
octachron has quit [Quit: Leaving]
madroach has quit [Read error: Connection reset by peer]
ygrek has quit [Ping timeout: 244 seconds]
yunxing has quit [Read error: Connection reset by peer]
yunxing has joined #ocaml
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
funkatronixxx has joined #ocaml
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
funkatronixxx has quit [Ping timeout: 276 seconds]
badon has joined #ocaml
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
lokien_ has quit [Quit: Connection closed for inactivity]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
libbro has quit [Quit: leaving]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
yunxing has quit [Remote host closed the connection]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
Haudegen has quit [Ping timeout: 252 seconds]
madroach has quit [Read error: Connection reset by peer]
snhmib has quit [Quit: WeeChat 1.3]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
Haudegen has joined #ocaml
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
<Drup>
"Where rectypes matter for performance reasons" ♥
madroach has joined #ocaml
mistermetaphor has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
noddy has joined #ocaml
madroach has joined #ocaml
<def`>
If you are using custom_ops, I don't see why you need modular implicits... you already have adhoc comparator
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
yunxing has joined #ocaml
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
mistermetaphor has quit [Remote host closed the connection]
kratos has quit [Ping timeout: 250 seconds]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
funkatronixxx has joined #ocaml
noddy has quit [Ping timeout: 250 seconds]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
funkatronixxx has quit [Ping timeout: 248 seconds]
pierpa has quit [Ping timeout: 248 seconds]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
darkf has quit [Read error: Connection reset by peer]
darkf has joined #ocaml
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
Madars has quit [Ping timeout: 260 seconds]
madroach has quit [Read error: Connection reset by peer]
JacobEdelman_ has joined #ocaml
madroach has joined #ocaml
Sorella has quit [Quit: Connection closed for inactivity]
Madars has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
demonimin has quit [Ping timeout: 276 seconds]
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
d0nn1e has quit [Ping timeout: 244 seconds]
d0nn1e has joined #ocaml
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
ousado has quit [Ping timeout: 260 seconds]
madroach has joined #ocaml
copy` has quit [Quit: Connection closed for inactivity]
madroach has quit [Read error: Connection reset by peer]
funkatronixxx has joined #ocaml
madroach has joined #ocaml
funkatronixxx has quit [Ping timeout: 264 seconds]
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
madroach has joined #ocaml
kushal has quit [Ping timeout: 260 seconds]
madroach has quit [Read error: Connection reset by peer]
aantron has quit [Remote host closed the connection]
mistermetaphor has joined #ocaml
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
slash^ has joined #ocaml
kushal has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
Vintila has joined #ocaml
JacobEdelman_ has quit [Quit: Connection closed for inactivity]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
struk|desk|away is now known as struk|desk
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
MercurialAlchemi has joined #ocaml
madroach has joined #ocaml
badon has quit [Disconnected by services]
badon_ has joined #ocaml
badon_ is now known as badon
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
funkatronixxx has joined #ocaml
A1977494 has joined #ocaml
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
struk|desk is now known as struk|desk|away
funkatronixxx has quit [Ping timeout: 276 seconds]
badon has quit [Disconnected by services]
badon_ has joined #ocaml
badon_ is now known as badon
matason has joined #ocaml
madroach has joined #ocaml
toolslive has quit [Remote host closed the connection]
madroach has quit [Read error: Connection reset by peer]
matason has quit [Ping timeout: 250 seconds]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
orbifx has joined #ocaml
cdidd has quit [Remote host closed the connection]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
cdidd has joined #ocaml
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
matason has joined #ocaml
madroach has joined #ocaml
madroach has joined #ocaml
mistermetaphor has quit [Remote host closed the connection]
madroach has quit [Read error: Connection reset by peer]
funkatronixxx has joined #ocaml
Vintila has quit [Ping timeout: 244 seconds]
FreeBirdLjj has joined #ocaml
madroach has joined #ocaml
funkatronixxx has quit [Ping timeout: 252 seconds]
madroach has quit [Read error: Connection reset by peer]
FreeBird_ has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 260 seconds]
struk|desk|away is now known as struk|desk
madroach has joined #ocaml
FreeBird_ has quit [Remote host closed the connection]
madroach has quit [Read error: Connection reset by peer]
tane has joined #ocaml
matason has quit [Ping timeout: 248 seconds]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
funkatronixxx has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
yunxing has quit [Remote host closed the connection]
matason has joined #ocaml
madroach has joined #ocaml
leyyin has joined #ocaml
matason has quit [Ping timeout: 276 seconds]
larhat has joined #ocaml
Kakadu has joined #ocaml
Haudegen has quit [Ping timeout: 260 seconds]
picolino has joined #ocaml
funkatronixxx has quit [Quit: leaving]
silver has joined #ocaml
Simn has joined #ocaml
solrize has quit [Ping timeout: 268 seconds]
DanielRichman has quit [Quit: leaving]
DanielRichman has joined #ocaml
haesbaert has joined #ocaml
tane has quit [Quit: Verlassend]
butts_butts has joined #ocaml
Haudegen has joined #ocaml
infinity0 has quit [Ping timeout: 268 seconds]
infinity0 has joined #ocaml
solrize has joined #ocaml
struktured has joined #ocaml
Vintila has joined #ocaml
struktured has quit [Ping timeout: 244 seconds]
matason has joined #ocaml
meteo has joined #ocaml
<meteo>
Hi All,
<meteo>
what's the latest stable release I should be installing with opam?
<flux>
not all the packets build with 4.03 though, so perhaps not the best idea to start with that ;)
<flux>
why do people define this super-strict dependencies?-( [ERROR] ocamlorg is not available because your system doesn't comply with ocaml-version = "4.01.0".
<flux>
though it's easy to switch, it just take time..
malc_ has joined #ocaml
sz0 has quit [Quit: Connection closed for inactivity]
Vintila has quit [Ping timeout: 248 seconds]
<listing>
how to add a couple in list of couple ?
<flux>
well, lists are immutable, so the best you can do is to create a list built out of the new element and the old list
<flux>
by couple you mean 2-tuple, ie, (4, 2)?
<listing>
like (a,b)
<flux>
(new, element)::list gives you a list where the (new, element) is at the beginning
<flux>
so you want to go from [(x, a), (y, b), (z, a)] to [(x + z, a), (y, b)]
<flux>
seems a lot like homework, btw :P
<listing>
yes
<flux>
what's the problem? there is no method for doing that out-of-the-box.
<flux>
I mean, what's the problem you're facing first when solving it that is :)
<listing>
I have an acc, match if (x,a) appear in, if not add (x,a) into acc => [ (x,a) ]
<listing>
for each coupl check if (_,k) appear in the acc
<flux>
do you know how to use Map or Hashtbl?
<listing>
so my first problem is how to add a coupl into a list of couple
<listing>
no
<listing>
It's possibl to do a simple function that can do what I want
<listing>
?
<flux>
it's possible but I think it would be a bit complicated, not simple
<listing>
Ok so I was not so noob
<flux>
basically the way I view the problem is that you want to find the sum of the x/y/z grouped by the "variable" on a/b on the right side
<listing>
yes
<flux>
so I would go through the list and keep track of the sum for each right-side variable; if there is no such variable, add it, otherwise use the previous value as the base for summing it
<listing>
tha'ts what I want to do
<flux>
and then just once again iterate the list and replace the left-side value with the sum _and_ remove the variable; and if there's no match for the variable in our data structure, remove it altogether while iterating
larhat has quit [Quit: Leaving.]
<listing>
p : [(x, a), (y, b), (z, a)] and acc : [ ] , append (x,a) acc -> [(x,a)] , for the rest of p , check if (_,a) in general if (_,k) appears in the acc
<listing>
if not append (y,b) into acc or group by a , tha'ts what you want to do no ?
<flux>
seems like that's the beginning of the solution
<listing>
but first how to add a coupl into list of coupl
<flux>
let list_with_new_elements (a, b) old_list = (a, b)::old_list
<flux>
if you want to do it with mutation, you can use 'ref' to do it. however, if you haven't been taught about ref, then perhaps you shouldn't use it.
<mrvn>
note that that is O(n^2)
<flux>
yeah I think they are not yet worrying about algorithmic complexity if they don't know abuot Map or Hashtbl..
<mrvn>
Ok, lets keep it simple then. :)
<listing>
flux how ocanl know that old:list is a list
<listing>
ocaml*
<flux>
listing, because it's used in a list-context
<flux>
listing, or in other words: by cause on type inference
<mrvn>
First thing I would do is to reverse the tuples: ('a * 'b) list -> ('b * 'a) list. That way you can use the "Association lists" part of the Lists module.
<mrvn>
listing: "::" is an operator: 'a -> 'a list -> 'a list.
<listing>
ok ok
orbifx has quit [Ping timeout: 268 seconds]
matason has quit [Ping timeout: 276 seconds]
<listing>
thought that I must writ []
<mrvn>
listing: just like "+" makes ocaml infere that the arguments must be in the "::" makes it infere that the second argument must be a list.
<listing>
nice
<listing>
thanks
<mrvn>
s/must be in/must be int/
<mrvn>
And since the first argument is a tuple it inferes that the seconds must be a list of tuples and so on.
<listing>
What do you mean by Association lists ? do you have an example ?
<flux>
association lists are pairs of lists just like yours, except they are used for finding the second pair given the first pair
<flux>
no doubt in your assignment the pairs have been switched around to make it more annoying to solve ;)
<mrvn>
let x = [(1, "foo"); (2, "bar"); (3, "baz")] List.assoc 2 x;;
<mrvn>
val x : (int * string) list = [(1, "foo"); (2, "bar"); (3, "baz")]
<mrvn>
- : string = "bar"
<mrvn>
listing: did you learn about exceptions yet?
matason has joined #ocaml
<mrvn>
flux: too bad there isn't a List.assoc_all : 'a -> ('a * 'b) list -> 'b list
<flux>
well it's not too bad, I doubt I have ever had a use for it :)
<listing>
mrvn yes
Simn has quit [Quit: Leaving]
orbifx has joined #ocaml
octachron has joined #ocaml
<mrvn>
let sum = List.fold_left (fun res (a, b) -> (function ([(c, _)], xs) -> (a + c, b) :: xs | (_, xs) -> (a, b) :: xs) (List.partition (fun (_, d) -> b = d) res)) []
<mrvn>
sum [(1, 1); (2, 2); (3, 1); (4, 2)];;
<mrvn>
- : (int * int) list = [(6, 2); (4, 1)]
<mrvn>
val sum : (int * '_a) list -> (int * '_a) list = <fun>
<mrvn>
listing: That's what you want, right?
dhil has joined #ocaml
matason has quit [Ping timeout: 240 seconds]
<mrvn>
let sum = List.fold_left (fun res (a, b) -> match List.partition (fun (_, d) -> b = d) res with ([(c, _)], xs) -> (a + c, b) :: xs | (_, xs) -> (a, b) :: xs) [];;
<mrvn>
probably the shortest you can do with lists.
ggole has joined #ocaml
octachron_ has joined #ocaml
<listing>
thanks mrvn I'll give you what iv done
octachron has quit [Ping timeout: 260 seconds]
octachron_ has quit [Read error: Connection reset by peer]
<Drup>
Yes, and you can then use Ctypes.coerce to turn (a'->'b) static_funptr into a ('a -> 'b)
<Drup>
Maelan: it's in the include
<Maelan>
oh, right
A1977494 has joined #ocaml
pierpa has joined #ocaml
<Maelan>
okay, i did not think it was so straightforward
<Drup>
me neither, I had to ask yallop to understand about the coerce
<flux>
yeah, when I find a function called "coerce" it sounds like "I can call it but it doesn't mean it will work" :-).
<Drup>
Same
<Maelan>
it is not documented in the description of coerce
<Drup>
Maelan: there is ticket about it
<Maelan>
okay
<Maelan>
still, how do i build a value of type “(a -> b) typ”, to feed it to coerce?
<Drup>
Foreign.funptr
<Maelan>
ah, oh
AlexRussia has joined #ocaml
picolino has quit [Ping timeout: 268 seconds]
TheLemon1an has joined #ocaml
TheLemon1an has quit [Client Quit]
picolino has joined #ocaml
<flux>
"OCaml release 4.03.0 will arrive in about 2 weeks. We have created a second beta version for your testing pleasure."
<flux>
yesterday's news, but I guess it's not an april fools ;)
<flux>
there is no 4.03.0+beta2+flambda in opam yet, though there was one for beta1
<flux>
hmm, I guses 4.03.0+trunk+flambda is sufficient
sfri has quit [Remote host closed the connection]
sfri has joined #ocaml
aantron has joined #ocaml
tane has joined #ocaml
dsheets has quit [Remote host closed the connection]
matason has joined #ocaml
dhil has quit [Ping timeout: 244 seconds]
FreeBirdLjj has joined #ocaml
leyyin has quit [Remote host closed the connection]
sh0t has joined #ocaml
dsheets has joined #ocaml
yunxing has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
shinnya has joined #ocaml
octachron__ has joined #ocaml
tane has quit [Quit: Verlassend]
noddy has joined #ocaml
octachron_ has quit [Ping timeout: 244 seconds]
Simn has joined #ocaml
Sorella has joined #ocaml
orbifx has quit [Ping timeout: 250 seconds]
struk|desk|away is now known as struk|desk
yunxing has quit [Remote host closed the connection]
sh0t has quit [Ping timeout: 248 seconds]
sh0t has joined #ocaml
butts_butts has joined #ocaml
matason has quit [Ping timeout: 244 seconds]
matason has joined #ocaml
vpm has quit [Quit: co'o]
vpm has joined #ocaml
sh0t has quit [Ping timeout: 248 seconds]
<butts_butts>
Hi all. I'm fairly new to Ocaml, and currently am trying use the Websocket_lwt lib. There aren't many examples of its usage that I can find, but one I did find uses Conduit to create some of the required stuff for creating a basic server.
sh0t has joined #ocaml
<butts_butts>
However, I can't get Conduit stuff to compile. Specifically calls to Resolver_lwt_unix
<butts_butts>
Keeps telling me that Resolver_lwt_unix is an undefined global.
<butts_butts>
I've opam installed conduit (which seems to also contain all this Resolver stuff). I've tried doing open Resolver, open Resolver_lwt_unix, open Conduit_lwt_unix
<butts_butts>
In the source file where I'm calling the function
<butts_butts>
No joy.
<butts_butts>
I'm.. completely out of ideas.
<malc_>
butts_butts: erm.. are you compiling it or trying in the repl?
<butts_butts>
I added lwt and mirage as last-resort attempts to solve it, but yeah
<butts_butts>
Didn't help]
<malc_>
butts_butts: not familiar with ocamlbuild, nor lwt/etc to be honest, you better wait for someone more intimate with those things to appear here...
<malc_>
that said, which library should provide the Resolver_lwt_unix symbol?
<butts_butts>
Aye ok. :)
<butts_butts>
Well it seems to be inside the ocaml_conduit library
<octachron__>
have you tried "ocamlbuild -use-ocamlfind ... " ?
<butts_butts>
In what way is it different to C's header/implementation seperation?
<butts_butts>
separation*
<octachron__>
briefly, OCaml has a proper module system, where module are a first class language construct, with for instance functor i.e function from module to module
<malc_>
butts_butts: basically, what octachron__ said (and then some)
<butts_butts>
OK
<butts_butts>
So if the Conduit package has some sub-module(?) called Resolver_lwt_unix
<butts_butts>
If you are correctly linking to the Conduit package, is there some way that you would then normally access Conduit's sub-modules (again, not sure if sub-module is the right term)
<butts_butts>
Conduit.Resolver_lwt_unix blah or something?
jknick has quit [Ping timeout: 260 seconds]
jknick has joined #ocaml
<octachron__>
butts_butts, ok I have found the problem, you need to use the conduit.lwt-unix subpackage: "ocamlbuild -use-ocamlfind -package conduit.lwt-unix yourfile.native"
tane has joined #ocaml
shinnya has quit [Ping timeout: 264 seconds]
mistermetaphor has joined #ocaml
orbifx has joined #ocaml
dsheets has quit [Remote host closed the connection]
d0nn1e has quit [Ping timeout: 244 seconds]
d0nn1e has joined #ocaml
struk|desk is now known as struk|desk|away
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
<flux>
cool, I had missed this: - PR#6468: toplevel now supports backtraces if invoked with OCAMLRUNPARAM=b (whitequark and Jake Donham, review by Gabriel Scherer and Jacques-Henri Jourdan)
Algebr` has joined #ocaml
<companion_cube>
nice
sh0t has quit [Ping timeout: 268 seconds]
dsheets has joined #ocaml
<Drup>
I'm both impressed and depressed. tyxml manage to make the compiler loose track of covarianace.
<Drup>
# Html5.Xml.W.nil () ;;
<Drup>
- : '_a list = []
<companion_cube>
ôO
<companion_cube>
wait, it's normal, isn't it? due to the ()
mistermetaphor has quit [Remote host closed the connection]
<Drup>
No, it's not normal
dsheets has quit [Remote host closed the connection]
<Drup>
# let x : _ list = Html5.Xml.W.nil () ;;
<Drup>
val x : 'a list = []
ril has joined #ocaml
<flux>
..did you find a bug in ocaml?
<Algebr`>
Drup -- Compiler buster.
<Drup>
That happens often, it's not a soudness bug, so it's not terrible
sh0t has joined #ocaml
butts_butts has quit [Ping timeout: 244 seconds]
noddy has joined #ocaml
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
yegods has joined #ocaml
noddy has quit [Ping timeout: 276 seconds]
dsheets has joined #ocaml
dsheets has quit [Remote host closed the connection]
hydan has quit [Quit: hydan]
<Algebr`>
has anyone released a opam created binary on homebrew ?
<flux>
opam was supposed to be the system that picks&builds the packages for us.. :)
copy` has joined #ocaml
<flux>
I guess the reality isn't that grim, I imagine many of the packages depend on host libraries that aren't properly indicated in the dependencies..
<octachron>
Algebr`, yes, these attributes are for versions ≥4.03
<Algebr`>
it seriously takes so much time so actually learn a language.
<Algebr`>
to*
<Algebr`>
octachron: thanks for link
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 250 seconds]
foocraft has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
malc_ has quit [Quit: ERC (IRC client for Emacs 25.0.50.2)]
mistermetaphor has joined #ocaml
butts_butts has quit [Ping timeout: 268 seconds]
MercurialAlchemi has quit [Ping timeout: 250 seconds]
mistermetaphor has quit [Remote host closed the connection]
kolko has quit [Read error: Connection reset by peer]
mistermetaphor has joined #ocaml
silver has quit [Quit: rakede]
darkf has joined #ocaml
<Algebr`>
Drup: postgresql author doesn't want to provide lwt layer, promptly closed any discussion of it, looks like I will change my tune to pgocaml
swistak35 has quit [Ping timeout: 260 seconds]
<Algebr`>
one thing is that it looks like it does queries at compile time?
Drup has quit [Ping timeout: 260 seconds]
Drup has joined #ocaml
swistak35 has joined #ocaml
<Algebr`>
and no ppx, which would make merlin usage better, might be good excuse for me to get hands dirty with ppx
octachron has quit [Quit: Leaving]
leyyin has quit [Quit: So Long, and Thanks for All the Fish]
t4nk569 has quit [Ping timeout: 250 seconds]
<def`>
Algebr`: from what I remembee pgocaml was easy to parametrize by any monad
snhmib has quit [Quit: WeeChat 1.3]
ril has joined #ocaml
d0nn1e has quit [Ping timeout: 260 seconds]
d0nn1e has joined #ocaml
sh0t has joined #ocaml
gpietro_ has joined #ocaml
sh0t has quit [Ping timeout: 268 seconds]
Simn has quit [Quit: Leaving]
Kakadu has quit [Remote host closed the connection]
noddy has quit [Ping timeout: 244 seconds]
AJavaIdiot has joined #ocaml
infinity0 has quit [Ping timeout: 244 seconds]
<AJavaIdiot>
Hi everyone! I ran into a problem with a function and was wondering if anyone could help me with it (or just point me towards what to search to find an answer)
<AJavaIdiot>
This function blows my stack. I tried sticking a print_string ; before the cons, and it seems as if it first tries to evaluate (loadList ci) before (loadCache ci)
<AJavaIdiot>
So far so good, but my question is: Is there a specified evaluation order for expressions (that do not involve ; obviously), or is it completely implementation-defined?
<copy`>
It seems that you have an infinite loop because you call loadList with its original input
<AJavaIdiot>
Meaning that on some implementations this functions could behave properly (if the head got evaluated first, raising an exception) and badly on others
<AJavaIdiot>
Ah, sorry, I should've specified: ci is an input channel (stream? I'm not sure of the word to use), and loadCache consumes elements from it
<AJavaIdiot>
Basically, I think I understand why it's blowing up, but I wanted to know if it's due to *ocaml* or due to *my implementation of the ocaml language*
<AJavaIdiot>
Also, sorry for all the spam haha :P
infinity0 has joined #ocaml
<copy`>
I'm actually not sure about evaluation order in this case, if you want a well-defined evaluation order you can use let bindings
<Drup>
usually, it's right to left
<Drup>
which would trigger an infinite loop here.
<Drup>
you shouldn't rely on it anyway
<AJavaIdiot>
I'll mess around a bit with lets and see what it gets me. It doesn't matter much anyway, since I already have another version of this function that works
<AJavaIdiot>
Also, in the interest of full disclosure: This is part of a project for university
<Drup>
AJavaIdiot: This version is very bad for multiple reasons
<Drup>
the reason above is one
<AJavaIdiot>
Drup: By "usually" you mean that it's implementation-defined, right?
<Drup>
the second reason is that it creates a new handler a each stage,
<Drup>
evaluation order is unspecified
<AJavaIdiot>
I'm not familiarised with that term
<Drup>
Which one ? :)
<AJavaIdiot>
Alright, that was the crux of my problem :)
<AJavaIdiot>
"handler"
<Drup>
exception handler
<Drup>
the try with ...
<AJavaIdiot>
Ah
madroach has quit [Ping timeout: 252 seconds]
<AJavaIdiot>
There's no way to avoid creating a new handle at each recursive call if I need the exception to be caught inside the function though, right?
tani has joined #ocaml
<AJavaIdiot>
I mean, in an hypothetical world where the left-side of the cons were getting evaluated first, I'd need to catch the End_of_file from loadCache to have a base case
<AJavaIdiot>
And there'd be no way around that, would there?
madroach has joined #ocaml
<Drup>
there are, but I'll let you think about it :)
<AJavaIdiot>
Could you give me a keyword or something to point me in the right direction though? I really have no clue :p
tane has quit [Ping timeout: 244 seconds]
twobitsprite has quit [Quit: Lost terminal]
tani has quit [Quit: Verlassend]
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
raxello has joined #ocaml
<raxello>
hi all. I am a beginner in OCaml world. Do I understand correctly that oasis is a recommended way to configure my project ?