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]