zebrag has quit [Remote host closed the connection]
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
gravicappa has joined #ocaml
mro has joined #ocaml
waleee has quit [Ping timeout: 256 seconds]
hsw has quit [Quit: Leaving]
mro has quit [Remote host closed the connection]
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dextaa_ has quit [Remote host closed the connection]
mro 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]
mro has joined #ocaml
Paul has joined #ocaml
Techcable has quit [Ping timeout: 272 seconds]
Paul has quit [Quit: WeeChat 3.3]
Paul has joined #ocaml
Paul has quit [Client Quit]
benthumb2000 has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
azimut_ has quit [Remote host closed the connection]
azimut has joined #ocaml
<d_bot_>
<octachron> The indexing operators syntax was written by physicists, it would have been strange if we didn't include in-place mutation.
humasect has quit [Quit: Leaving...]
bartholin has joined #ocaml
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
kakadu has joined #ocaml
mro has quit [Remote host closed the connection]
xd1le has quit [Quit: xd1le]
mro has joined #ocaml
olle has joined #ocaml
wingsorc__ has quit [Quit: Leaving]
azimut has quit [Remote host closed the connection]
azimut has joined #ocaml
Anarchos has joined #ocaml
mro has quit [Remote host closed the connection]
<d_bot_>
<Bluddy> I actually decided to use @companion_cube 's awesome `Gen` library instead of `Seq`
<d_bot_>
<Bluddy> It's pretty close to Byte Streams
<d_bot_>
<Bluddy> and you get the advantage of functional handling, too
kaph has joined #ocaml
benthumb2000 has quit [Quit: WeeChat 3.3]
adanwan has quit [Remote host closed the connection]
adanwan has joined #ocaml
bartholin has quit [Ping timeout: 240 seconds]
bartholin has joined #ocaml
mro has joined #ocaml
mro has quit [Remote host closed the connection]
cedric has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
bartholin has quit [Ping timeout: 240 seconds]
bartholin has joined #ocaml
mro has joined #ocaml
<d_bot_>
<sarna> hey, is there any easy way to turn a string with hex into hex itself? ie turn `"0a"` into `0x0a`
<Anarchos>
int_of_string |> Printf.printf "0x%x" could do the trick ?
<d_bot_>
<sarna> ah - I thought I'd have to prepend the string with 0x or something and it felt hacky. thank you!
<d_bot_>
<Alistair> Wouldn't it be `int_of_string ("0x" ^ x)`. Presumably you want something from `string -> int`?
<d_bot_>
<sarna> yeah that's exactly how I wanted to do it initially '^ ^ it still doesn't feel right haha
Haudegen has joined #ocaml
bartholin has quit [Ping timeout: 252 seconds]
nimu has joined #ocaml
<d_bot_>
<sarna> oy actually I misread. I wanted int, not string :) so Alistair you were correct haha
<nimu>
i'm learning about phantom types and am trying this code snippet: https://pastebin.com/YtZZvg8P, any idea why this doesn't throw a type error? (from what i understand f should be a readonly 't while File.write takes in a readwrite 't)
<qwr>
Scanf.sscanf "1a" "%x" (Fun.id);; (* i'm not sure, that its better than int_of_string ("0x" ^ "1a") *)
bartholin has joined #ocaml
<d_bot_>
<bnguyenv> nimu: I think because of the apostrophe `'` before `readwrite` in the signature for write. It should be without
mro has quit [Remote host closed the connection]
mro has joined #ocaml
spip has joined #ocaml
bobo has quit [Ping timeout: 250 seconds]
<octachron>
indeed File.readwrite has type : 'a t -> ... (with 'a = 'readwrite) and thus doesn't enforce anything on its argument.
nimu has quit [Ping timeout: 256 seconds]
oriba has joined #ocaml
<d_bot_>
<Alistair> Does anyone have some good examples of semi-explicit first-class polymorphism, trying to think of examples but they all seem fairly contrived
Anarchos has quit [Ping timeout: 240 seconds]
gravicappa has quit [Ping timeout: 272 seconds]
Anarchos has joined #ocaml
waleee has joined #ocaml
mro has quit [Remote host closed the connection]
bobo has joined #ocaml
spip has quit [Ping timeout: 256 seconds]
cedric has quit [Quit: Konversation terminated!]
Anarchos has quit [Quit: Vision[]: i've been blurred!]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
wyrd has quit [Ping timeout: 240 seconds]
<d_bot_>
<EduardoRFS> What do you mean by semi-explicit?
mro has quit [Remote host closed the connection]
dextaa_ has joined #ocaml
<d_bot_>
<Alistair> e.g. ```ocaml
<d_bot_>
<Alistair> type 'a cont = { k : 'b. ('a -> 'b) -> 'b }
<d_bot_>
<Alistair> ```
gravicappa has joined #ocaml
mro has joined #ocaml
<d_bot_>
<mbacarella> oh, I thought that was your claim that I was repeating. nevermind then 🙂
rgrinberg has joined #ocaml
mro has quit [Ping timeout: 256 seconds]
<d_bot_>
<darrenldl> ohhh
mro has joined #ocaml
bartholin has quit [Ping timeout: 272 seconds]
bartholin has joined #ocaml
<d_bot_>
<darrenldl> yeah no, capability model (i think this was the topic of discussion?) definitely has limitation as you suggested even if not considering clickjacking (or bypass via human operator essentially)
mro has quit [Remote host closed the connection]
mro has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
quartz has joined #ocaml
<quartz>
Hello. Can someone explain to me how the code at line 14 is an example of "pattern matching?" https://godbolt.org/z/fhrzPKjPe
mro has quit [Remote host closed the connection]
<d_bot_>
<colin> You're doing case analysis on the list, the `[]` and `h :: t` are patterns.
<quartz>
But how is 'h :: t' a pattern? 'h :: t' is suppose to mean "append h to t" or "append the head element to the tail'
<d_bot_>
<colin> It's the syntax for the cons constructor.
mro has joined #ocaml
<d_bot_>
<colin> The `h` and `t` are pattern variables.
<d_bot_>
<colin> If it helps your understanding, you could define what it means to be a list yourself: `type 'a list = Nil | Cons of 'a * 'a list`, in which case the patterns would become `Nil` and `Cons (h, t)` respectively.
<d_bot_>
<colin> The `[]` and `_::_` syntax is just convenient since lists are ubiquitous in functional programming.
<sleepydog>
it might also help your understanding to think of these expressions not as "what it does" but "what it is"
<sleepydog>
rather than `h :: t` meaning "prepend the element h to the list t", think of it as "the list with first element `h` and the remaining elements `t`"
<sleepydog>
i like to imagine that every possible expression already exists, and i'm just temporarily giving one of them a name as a shorthand
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dextaa_ has quit [Remote host closed the connection]
mbuf has quit [Quit: Leaving]
hornhack is now known as hackinghorn
szkl has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
bartholin has quit [Quit: Leaving]
Tuplanolla has joined #ocaml
olle has quit [Ping timeout: 272 seconds]
Haudegen has joined #ocaml
zebrag has joined #ocaml
dextaa_ has joined #ocaml
quartz has quit [Quit: WeeChat 3.4]
Anarchos has joined #ocaml
rgrinberg has joined #ocaml
<d_bot_>
<VPhantom> Out of curiosity, is the "best" way to make a list of tuples into a map in one operation to use Seq as an intermediary? i.e. `my_tuples |> List.to_seq |> StringMap.of_seq` — I was expecting a non-existent `Map.S.of_list` similar to `Set.S`'.
olle has joined #ocaml
<d_bot_>
<octachron> Yes, `Seq` is used here as a good adaptator type: it doesn't build an intermediary container and it avoids the need to define n² conversion functions .
<d_bot_>
<VPhantom> Understood.
gravicappa has quit [Ping timeout: 256 seconds]
Serpent7776 has quit [Quit: leaving]
Anarchos has quit [Ping timeout: 240 seconds]
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
emad has joined #ocaml
emad has quit [Client Quit]
Anarchos has joined #ocaml
wyrd has joined #ocaml
romildo has joined #ocaml
perrierjouet has quit [Quit: WeeChat 3.4]
perrierjouet has joined #ocaml
romildo has quit [Quit: Leaving]
xgqt has quit [Remote host closed the connection]
xgqt has joined #ocaml
rgrinberg has joined #ocaml
dextaa_ has quit [Remote host closed the connection]
Haudegen has quit [Ping timeout: 240 seconds]
TheRuralJuror has joined #ocaml
olle has quit [Ping timeout: 240 seconds]
Anarchos has quit [Quit: Vision[]: i've been blurred!]