companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 5.2.0 released: https://ocaml.org/releases/5.2.0 | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
Frostillicus has quit [Ping timeout: 252 seconds]
pi3ce has quit [Quit: No Ping reply in 180 seconds.]
pi3ce has joined #ocaml
wbooze has joined #ocaml
pi3ce has quit [Ping timeout: 272 seconds]
pi3ce has joined #ocaml
toastal has quit [Ping timeout: 276 seconds]
inline has joined #ocaml
Tuplanolla has quit [Quit: Leaving.]
humasect has joined #ocaml
pi3ce has quit [Ping timeout: 260 seconds]
pi3ce has joined #ocaml
humasect has quit [Remote host closed the connection]
toastal has joined #ocaml
humasect has joined #ocaml
humasect has quit [Ping timeout: 260 seconds]
toastal has quit [Ping timeout: 276 seconds]
toastal has joined #ocaml
YuGiOhJCJ has quit [Quit: YuGiOhJCJ]
toastal has quit [Ping timeout: 268 seconds]
toastal has joined #ocaml
inline has quit [Read error: Connection reset by peer]
wbooze has quit [Remote host closed the connection]
humasect has joined #ocaml
humasect has quit [Ping timeout: 252 seconds]
toastal has quit [Ping timeout: 245 seconds]
Serpent7776 has joined #ocaml
deavmi has quit [Remote host closed the connection]
deavmi has joined #ocaml
toastal has joined #ocaml
chiselfuse has quit [Remote host closed the connection]
chiselfuse has joined #ocaml
bartholin has joined #ocaml
myrkraverk_ has quit [Quit: Leaving]
myrkraverk has joined #ocaml
bartholin has quit [Quit: Leaving]
Haudegen has joined #ocaml
Everything has joined #ocaml
toastal has left #ocaml [#ocaml]
toastal has joined #ocaml
humasect has joined #ocaml
humasect has quit [Ping timeout: 244 seconds]
hsw has quit [Remote host closed the connection]
hsw has joined #ocaml
toastal has quit [Ping timeout: 260 seconds]
wbooze has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
toastal has joined #ocaml
pi3ce has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
humasect has joined #ocaml
humasect has quit [Ping timeout: 260 seconds]
toastal has left #ocaml [#ocaml]
toastal has joined #ocaml
humasect has joined #ocaml
Haudegen has joined #ocaml
johnridesabike has joined #ocaml
johnridesabike has quit [Client Quit]
johnridesabike has joined #ocaml
toastal has quit [Ping timeout: 252 seconds]
grobe0ba has quit [Remote host closed the connection]
<discocaml> <shadowkestrel> i love gadts.
<discocaml> <shadowkestrel> i do not love when i forget "it doesn't matter if these things are the same type" and spend 3 hours trying to fix the existential type errors.
<discocaml> <shadowkestrel> definitely not speaking from experience or anything :3
grobe0ba has joined #ocaml
grobe0ba has quit [Remote host closed the connection]
grobe0ba has joined #ocaml
toastal has joined #ocaml
humasect has quit [Remote host closed the connection]
humasect has joined #ocaml
bibi_ has quit [Quit: Konversation terminated!]
bibi_ has joined #ocaml
trillion_exabyte has quit [Ping timeout: 268 seconds]
trillion_exabyte has joined #ocaml
LainIwakura has joined #ocaml
LainIwakura has quit [Quit: Client closed]
wbooze has quit [Ping timeout: 260 seconds]
inline has joined #ocaml
LainIwakura has joined #ocaml
wbooze has joined #ocaml
humasect has quit [Remote host closed the connection]
<hanker> Is there an equivalent of `@@deriving show` the other way around?
<hanker> Like, if you do `type whatever = ABC | DEF | GHI` you have `show_whatever` to go from ABC to "ABC"
<hanker> Is there something similar for reading "ABC" into an ABC ?
<discocaml> <cod1r> you mean like serialization?
<discocaml> <cod1r> i dont think so
<discocaml> <cod1r> "ABC" is not specific
<discocaml> <cod1r> like ABC could be anything
<discocaml> <yawaramin> the closest is a JSON deriver
<discocaml> <yawaramin> or other similar derivers
bartholin has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
<hanker> cod1r, yeah
<hanker> > like ABC could be anything
<hanker> yeah but specifically "ABC" to the thing named ABC
<hanker> like the exact opposite function of `@@deriving show`
<discocaml> <deepspacejohn> it seems like the _exact_ opposite to `@@deriving show` would be a challenge because deriving show produces OCaml syntax, so the opposite would basically have to be an OCaml compiler.
<hanker> hmm yeah
<hanker> i think i misworded my question
Serpent7776 has quit [Quit: leaving]
<hanker> it's basically just a very simple enum type, no `of <type>` or anything
<hanker> so it would probably be trivial to write `match thing with "ABC -> ABC` and so on
<hanker> but is there an automatic way to write this?
<discocaml> <deepspacejohn> the closest I can think of also is using a format-specific deriver like JSON. (Besides just writing it manually.)
<discocaml> <yawaramin> yup
<discocaml> <yawaramin> ```let read s = of_yojson (`List [`String s]);;
<discocaml> <yawaramin> read "A";; (* Ok A *)
<discocaml> <yawaramin> ```
<hanker> i see, interesting
<hanker> thank you
Everything has quit [Quit: leaving]
wbooze has quit [Quit: Leaving]
euphores has quit [Quit: Leaving.]
wbooze has joined #ocaml
euphores has joined #ocaml
ridcully has quit [Ping timeout: 252 seconds]
Tuplanolla has joined #ocaml
euphores has quit [Ping timeout: 244 seconds]
Haudegen has joined #ocaml
euphores has joined #ocaml
ridcully has joined #ocaml
Anarchos has joined #ocaml
humasect has joined #ocaml
LainIwakura has quit [Ping timeout: 272 seconds]
humasect has quit [Quit: Leaving...]
Everything has joined #ocaml
Everything has quit [Quit: leaving]
YuGiOhJCJ has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
humasect has joined #ocaml
johnridesabike has quit [Quit: johnridesabike]
bartholin has quit [Remote host closed the connection]
humasect has quit [Quit: Leaving...]
toastal has quit [Ping timeout: 252 seconds]
toastal has joined #ocaml
Tuplanolla has quit [Quit: Leaving.]
infinity0 has quit [Quit: WeeChat 4.6.1]
infinity0 has joined #ocaml
Haudegen has quit [Quit: Bin weg.]