companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 4.14.0 released: https://ocaml.org/releases/4.14.0.html | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
azimut has quit [Ping timeout: 258 seconds]
nlocalhost has joined #ocaml
kurfen has quit [Ping timeout: 265 seconds]
kurfen has joined #ocaml
kurfen has quit [*.net *.split]
xd1le has quit [*.net *.split]
mal`` has quit [*.net *.split]
jtm has quit [*.net *.split]
emp has quit [*.net *.split]
ardon has quit [*.net *.split]
thizanne has quit [*.net *.split]
cross has quit [*.net *.split]
farn has quit [*.net *.split]
mg has quit [*.net *.split]
zozozo has quit [*.net *.split]
lobo has quit [*.net *.split]
deadmarshal has quit [*.net *.split]
thizanne has joined #ocaml
lobo has joined #ocaml
lobo has quit [Signing in (lobo)]
lobo has joined #ocaml
xd1le has joined #ocaml
emp has joined #ocaml
mal`` has joined #ocaml
farn has joined #ocaml
zozozo has joined #ocaml
jtm has joined #ocaml
mg has joined #ocaml
kurfen has joined #ocaml
ardon has joined #ocaml
cross has joined #ocaml
deadmarshal has joined #ocaml
SquidDev has quit [Quit: Ping timeout (120 seconds)]
xd1le has quit [Quit: xd1le]
chrisz has quit [Ping timeout: 268 seconds]
chrisz has joined #ocaml
SquidDev has joined #ocaml
waleee has quit [Ping timeout: 250 seconds]
mbuf has joined #ocaml
jao has quit [Ping timeout: 265 seconds]
mbuf has quit [Ping timeout: 264 seconds]
mbuf has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
bgs has joined #ocaml
adanwan has quit [Remote host closed the connection]
adanwan has joined #ocaml
Serpent7776 has joined #ocaml
Serpent7776 has quit [Ping timeout: 246 seconds]
genpaku has quit [*.net *.split]
Haudegen has quit [*.net *.split]
ansiwen has quit [*.net *.split]
habnabit_ has quit [*.net *.split]
m5zs7k has quit [*.net *.split]
haesbaert has quit [*.net *.split]
mg has quit [*.net *.split]
asm has quit [*.net *.split]
pippijn has quit [*.net *.split]
wagle has quit [*.net *.split]
Geekingfrog has quit [*.net *.split]
nlocalhost has quit [*.net *.split]
pippijn has joined #ocaml
haesbaert has joined #ocaml
asm has joined #ocaml
Geekingfrog has joined #ocaml
ansiwen has joined #ocaml
wagle has joined #ocaml
m5zs7k has joined #ocaml
mg has joined #ocaml
habnabit_ has joined #ocaml
Haudegen has joined #ocaml
troydm has quit [Ping timeout: 252 seconds]
genpaku has joined #ocaml
bartholin has joined #ocaml
bartholin has quit [Remote host closed the connection]
bobo_ has joined #ocaml
spip has quit [Ping timeout: 260 seconds]
azimut has joined #ocaml
Serpent7776 has joined #ocaml
asm has quit [Changing host]
asm has joined #ocaml
bartholin has joined #ocaml
olle has joined #ocaml
olle has quit [Ping timeout: 264 seconds]
wagle has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
wagle has joined #ocaml
mro has joined #ocaml
Anarchos has joined #ocaml
Anarchos has quit [Ping timeout: 248 seconds]
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Quit: Leaving...]
Putonlalla has joined #ocaml
jonasbits has quit [Ping timeout: 268 seconds]
jonasbits has joined #ocaml
olle has joined #ocaml
xd1le has joined #ocaml
troydm has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
jao has joined #ocaml
Tuplanolla has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
Haudegen has joined #ocaml
infinity0 has joined #ocaml
waleee has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
waleee has quit [Ping timeout: 248 seconds]
zebrag has joined #ocaml
rwmjones has quit [Remote host closed the connection]
rwmjones has joined #ocaml
adanwan has quit [Remote host closed the connection]
adanwan has joined #ocaml
Serpent7776 has quit [Quit: WeeChat 1.9.1]
waleee has joined #ocaml
<greenbagels> question: if i want to convert an int to char and vice-versa (basically a bijection from some set of chars to some set of ints), what would be the best way to implement this?
<greenbagels> currently i have two pattern matching functions for the char -> int function and inverse function
<hannes> greenbagels: if it is a small set of char, int - you could use an association list [ ('a', 1) ; ('b', 2) ] and do lookups / reverse lookups
<hannes> or construct maps (int -> char ; char -> int) at load time.. I guess what I'd express is: depends on your use case and performance requirements
waleee has quit [Ping timeout: 264 seconds]
<greenbagels> im just wondering if there's a way to have some kind of single interface for such a function
<greenbagels> but i think the type system would make that hard
<greenbagels> maybe wrapping the two functions in a function that takes a variant IntOrChar type and dispatches to the appropriate function on the raw data types...
Haudegen has quit [Quit: Bin weg.]
Serpent7776 has joined #ocaml
xd1le has quit [Quit: xd1le]
olle has quit [Remote host closed the connection]
<zebrag> hannes: two first functions there https://v2.ocaml.org/api/Char.html
Everything has joined #ocaml
<zebrag> Functions of_int and to_int, for unicode characters, there: https://ocaml.org/p/ocaml-base-compiler/4.14.0/doc/Stdlib/Uchar/index.html
Haudegen has joined #ocaml
mbuf has quit [Quit: Leaving]
ns12 has quit [Quit: bye]
ns12 has joined #ocaml
Anarchos has joined #ocaml
Anarchos has quit [Ping timeout: 246 seconds]
Anarchos has joined #ocaml
spip has joined #ocaml
bobo_ has quit [Read error: Connection reset by peer]
waleee has joined #ocaml
azimut has quit [Ping timeout: 258 seconds]
olle has joined #ocaml
dme2 has joined #ocaml
<ski> olle : fwiw, <http://gallium.inria.fr/%7Eprotzenk/mezzo-lang/> (from that SO answer) 403s
<ski> zebrag : 404
<ski> (also, i forgot if it was mentioned, but Rust does not have a "linear type system". iiuc, it's more about uniqueness)
wonko has joined #ocaml
<qwr> i think it was called affine types
Everything has quit [Quit: leaving]
<ski> that's also not the same thing
<ski> linear types/logic forbid contraction (using a variable/assumption more than once) and weakening (not using a variable in scope). affine types/logic only forbid contraction. there's also relevant/relevance types/logic, which forbid weakening but not contraction. and there's ordered / non-commutative logic, which forbids contraction, weakening, exchange (using variables/assumptions out of order (of
<ski> introduction))
<ski> (and when i say "forbid" i mean "forbid, generally". it's still possible to do these things, in some particular circumstances, you've opt-in. the so-called "modalities" ("of course","why not", variations))
<ski> anyway ..
<ski> with linearity/affinity, you can't duplicate (not discard, for linear case) in the future. but you might already have duplicated in the past (before deciding to opt out of that capability, for the present reference, using "dereliction", converting an unrestricted reference to a linear/affine one)
<ski> (so, you can't assume uniqueness of reference, and can't do update-in-place)
<ski> whereas, with uniqueness, you know you haven't duplicated (and obviously not discarded either, since you have a reference) in the past, but you're still allowed to duplicate in the future (unless you have to conform to an interface which requires you to return a unique reference, say ..). so you can update-in-place (arrays and other mutable structures, as well as virtual I/O token sequencing. also reusing dead
<ski> allocated nodes (possibly not having to copy over some fields), or else statically inserting calls to `free')
<ski> Clean and Mercury uses uniqueness. i haven't looked in detail at what Rust does, but afaiui, it uses at least something similar/related
<ski> Start :: *World -> *World // Clean
<ski> :- mode main(io :: di,io :: uo) is det. % Mercury
<ski> (`*' means "unique". `io' is a type, and `di' and `uo' are parameter modes, short for `unique >> dead' and `free >> unique', meaning "destructive input" (consumes unique reference) and "unique output" (produces unique reference))
nikitalocalhost has joined #ocaml
bgs has quit [Remote host closed the connection]
bartholin has quit [Quit: Leaving]
<greenbagels> ski: small world huh
<greenbagels> i was going "why are they talking about this in the math channel"
perrierjouet has quit [Quit: WeeChat 3.7]
perrierjouet has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
Serpent7776 has quit [Ping timeout: 252 seconds]
wingsorc has quit [Remote host closed the connection]
wingsorc has joined #ocaml
xd1le has joined #ocaml
Menchers has quit [Quit: Into the Void…]
Menchers has joined #ocaml
Tuplanolla has quit [Quit: Leaving.]
amk has quit [Read error: Connection reset by peer]
amk has joined #ocaml
Haudegen has quit [Ping timeout: 268 seconds]
wonko has quit [Ping timeout: 260 seconds]
Stoffel has quit [Ping timeout: 268 seconds]
perrierjouet has quit [Quit: WeeChat 3.7]