<d_bot_>
<NULL> The equality operator is `(=)`, `(==)` is for physical equality (same memory address)
<d_bot_>
<NULL> They are asking you to implement a function which takes the addition function as input and therefore doesn't impose a particular return type (`'a`)
<quartz>
'a is used for generics?
<sleepydog>
yes, it's a type variable, a placeholder for some type
adanwan has quit [Remote host closed the connection]
adanwan has joined #ocaml
<quartz>
But the name of the functio is suppose to be accum or partial?
<quartz>
The function signature is: "let rec partial accum f =" so does that mean accum accepts a variable f and partial accepts as a parameter accum?
<sleepydog>
no, it means 'partial' accepts 2 arguments, both of which are functions
<quartz>
So the question is asking to implement the partial function only?
<sleepydog>
yes
<quartz>
Or is it three functions? lol
<sleepydog>
it gives you several examples of possible `accum` and `f` implementations
<sleepydog>
they want you to define `partial`, which sould be agnostic to what types `accum` and `f` use
rgrinberg has joined #ocaml
<quartz>
sleepydog: Any hints as for how I should do that? What is the purpose of using generics here?
<quartz>
I'm assuming generics is needed here because I want the function to accept either an int or a float. If it accepts a float, it will return a float and if it accepts an int it will accept an int
<sleepydog>
quartz: your solution to the previous question requires minimal changes for this one
<d_bot_>
<leviroth> Just to sure, have you opened Core?
<d_bot_>
<leviroth> What type does your Map.merge have?
mro has quit [Remote host closed the connection]
mro has joined #ocaml
<d_bot_>
<leviroth> Oh, is it that you're not seeing `merge_skewed` in a key-specific map module like `Int.Map`?
Haudegen has quit [Quit: Bin weg.]
<d_bot_>
<leviroth> I think `merge_skewed` is in `Core.Map` but not in e.g. `Core.Int.Map`
<Anarchos>
sleepydog hello
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
gravicappa has quit [Ping timeout: 272 seconds]
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
Haudegen has joined #ocaml
waleee has joined #ocaml
mro has quit [Ping timeout: 256 seconds]
gravicappa has joined #ocaml
mro has joined #ocaml
mro has quit [Remote host closed the connection]
gravicappa has quit [Ping timeout: 256 seconds]
mro has joined #ocaml
rgrinberg has joined #ocaml
salkin has quit [Quit: salkin]
rgrinberg has quit [Client Quit]
mro has quit [Ping timeout: 250 seconds]
<sleepydog>
Anarchos: hi
rgrinberg has joined #ocaml
rgrinberg has quit [Client Quit]
<sleepydog>
Anarchos: i didn't make much progress building dune for haiku; i modified some #ifdef's but iirc i was having trouble getting the build to use `-lbsd`, which has an implementation of `wait3` that dune was trying to use
<sleepydog>
if you have a fork or instructions, i can try them when i get home tonight
rgrinberg has joined #ocaml
mro has joined #ocaml
gwizon has joined #ocaml
azimut has joined #ocaml
<Anarchos>
sleepydog i investigate and found that the two processes are waiting in condiciton variables : "tcp send", "tcp receive"..... seems a race condition in the network code
quartz has joined #ocaml
<sleepydog>
interesting. so you think it's an issue outside of ocaml, in Haiku?
bartholin has quit [Ping timeout: 272 seconds]
Tuplanolla has joined #ocaml
azimut has quit [Remote host closed the connection]
azimut has joined #ocaml
bartholin has joined #ocaml
mro has quit [Remote host closed the connection]
waleee has quit [Ping timeout: 252 seconds]
gravicappa has joined #ocaml
waleee has joined #ocaml
mro has joined #ocaml
mro has quit [Ping timeout: 256 seconds]
mbuf has quit [Quit: Leaving]
dextaa_ has joined #ocaml
<Anarchos>
sleepydog i guess.
<Anarchos>
if i suspend the client, the server is able to process all the data afterwards
<sleepydog>
that is interesting. i bet you would get a different result if you didn't communicate over localhost
<Anarchos>
yes : i intend to do a real network test between two PC
wonko has joined #ocaml
<Anarchos>
sleepydog if you want, i can recover my dune patch with -lbsd
<sleepydog>
if it's not too much trouble
mro has joined #ocaml
mro has quit [Ping timeout: 256 seconds]
<Anarchos>
sleepydog i think the wait3 with -lbsd comes from the ocaml compiler itself
<sleepydog>
i got an error about a missing reference to wait3 when building dune. i looked around and saw there is a `wait3` implementation in libbsd on haiku
<sleepydog>
but i'm not familiar enough with the process of buliding dune to add that flag. simply adding it to LDFLAGS didn't work
<Anarchos>
sleepydog let me look
<Anarchos>
sleepydog i had to stick to branch 2.9 for dune due to that.
mro has joined #ocaml
mro has quit [Ping timeout: 256 seconds]
Haudegen has quit [Quit: Bin weg.]
<quartz>
Hi. I'm trying to write a simple function that finds the largest int in a list of ints. I wrote some code, but it's giving me an error at line 10. can someone help? https://godbolt.org/z/8o7Kb4bGa
vicfred has joined #ocaml
<quartz>
BRB
quartz has quit [Quit: WeeChat 3.4]
zebrag has joined #ocaml
<sleepydog>
quartz: the `=` operator is not assignment, it's a test for equality. btw; if you have discord, there is a #beginners channel that might be more active for these types of questions
waleee has quit [Ping timeout: 245 seconds]
bartholin has quit [Ping timeout: 256 seconds]
waleee has joined #ocaml
quartz has joined #ocaml
mro has joined #ocaml
bartholin has joined #ocaml
mro has quit [Read error: Connection reset by peer]
mro_ has joined #ocaml
mro_ has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
dextaa_ has quit [Remote host closed the connection]
bartholin has quit [Ping timeout: 240 seconds]
<sleepydog>
so, i've been working on a code generator, and it involves the typical lex->parse->ast->ast transform flow. i took a break and came back to it, and i hate the code i wrote to manipulate the AST. it's in a "nanopass" style, but there are like 15 passes, the ordering is very fragile, and there's tons of indentation and nesting to walk the tree
<sleepydog>
so i've been thinking about different ways to do it
<sleepydog>
one idea i had was to load the terms into a database and manipulate them with a logic programming language like prolog or datalog
<sleepydog>
i wonder if there are other well-known techniques for manipulating ASTs, or if it's just something you get better at with practice
<Anarchos>
sleepydog that is the weirdest AST manipulation i ever heard : load them in a database and manipulate them with prolog :)
<sleepydog>
yea, it sounds weird, but i've found some precedent for it. microsoft has a paper about a tool they wrote called "astlog" that they used to query codebases
<sleepydog>
it's also really hard to search for this topic in google
szkl has quit [Quit: Connection closed for inactivity]
bartholin has joined #ocaml
<Anarchos>
sleepydog microsoft is not really the path to take...
<sleepydog>
why do you say that? they do a lot of really great research
<Anarchos>
maybe.
<Anarchos>
but i don't like them :)
olle has quit [Ping timeout: 256 seconds]
Haudegen has joined #ocaml
wonko has quit [Ping timeout: 245 seconds]
waleee has quit [Ping timeout: 240 seconds]
<d_bot_>
<glennsl> “Fear is the path to the dark side…fear leads to anger…anger leads to hate…hate leads to suffering.” - The Yodels
waleee has joined #ocaml
dextaa_ has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]