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/
_whitelogger has joined #ocaml
cross has joined #ocaml
copy has joined #ocaml
landonf has joined #ocaml
lobo has joined #ocaml
welterde has joined #ocaml
lobo has joined #ocaml
lobo has quit [Changing host]
leah2 has joined #ocaml
sparogy has joined #ocaml
Soni has joined #ocaml
nerdypepper has joined #ocaml
hackinghorn has joined #ocaml
gdd1 has joined #ocaml
ks_ has joined #ocaml
kurfen_ has quit [Quit: ZNC 1.8.2 - https://znc.in]
rgrinberg has joined #ocaml
CalimeroTeknik has joined #ocaml
kurfen has joined #ocaml
waleee has quit [Ping timeout: 255 seconds]
waleee has joined #ocaml
Soni has quit [Ping timeout: 272 seconds]
Soni has joined #ocaml
Sankalp has quit [Ping timeout: 246 seconds]
<drakonis> is metaocaml going to get bumped for 5.0 or, perhaps, merged?
greaser|q has quit [Changing host]
greaser|q has joined #ocaml
greaser|q is now known as GreaseMonkey
waleee has quit [Ping timeout: 255 seconds]
xgqt has quit [Remote host closed the connection]
xgqt has joined #ocaml
ski has quit [Remote host closed the connection]
Soni has quit [Ping timeout: 240 seconds]
Soni has joined #ocaml
raskol has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<drakonis> hmm, looks like there's a different thing that's being developed to provide staged code generation
motherfsck has quit [Ping timeout: 246 seconds]
rgrinberg has joined #ocaml
perrierjouet has quit [Quit: WeeChat 3.5]
perrierjouet has joined #ocaml
raskol has quit [Ping timeout: 255 seconds]
xgqt has quit [Ping timeout: 246 seconds]
Serpent7776 has quit [Ping timeout: 246 seconds]
genpaku has quit [Ping timeout: 246 seconds]
Serpent7776 has joined #ocaml
xgqt has joined #ocaml
genpaku has joined #ocaml
motherfsck has joined #ocaml
Serpent7776 has quit [Read error: Connection reset by peer]
Serpent7776 has joined #ocaml
mbuf has joined #ocaml
Haudegen has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<sim642> I'm not too familiar with it, but last I looked it was lagging behind 4.x versions as well
mbuf has quit [Remote host closed the connection]
mbuf has joined #ocaml
azimut has joined #ocaml
azimut has quit [Remote host closed the connection]
azimut has joined #ocaml
gopiandcode has quit [Ping timeout: 255 seconds]
gopiandcode has joined #ocaml
gopiandcode has quit [Ping timeout: 255 seconds]
gopiandcode has joined #ocaml
CalimeroTeknik has quit [Changing host]
CalimeroTeknik has joined #ocaml
Tuplanolla has joined #ocaml
h11 has quit [Quit: You have been kicked for being idle]
misterfish has joined #ocaml
leah2 has quit [Quit: trotz alledem!]
leah2 has joined #ocaml
CodeBitCookie[m] has quit [*.net *.split]
CodeBitCookie[m] has joined #ocaml
mclovin has quit [Ping timeout: 252 seconds]
CodeBitCookie[m] has quit [Ping timeout: 252 seconds]
neitsch[m] has quit [Ping timeout: 260 seconds]
neitsch[m] has joined #ocaml
gopiandcode has quit [Read error: Connection reset by peer]
gopiandcode has joined #ocaml
bartholin has joined #ocaml
neitsch[m] has quit [Quit: Bridge terminating on SIGTERM]
mclovin has joined #ocaml
theblatte has joined #ocaml
gareppa has joined #ocaml
gareppa has quit [Client Quit]
CodeBitCookie[m] has joined #ocaml
neitsch[m] has joined #ocaml
perrierjouet has quit [Quit: WeeChat 3.5]
perrierjouet has joined #ocaml
rgrinberg has joined #ocaml
perrierjouet has quit [Quit: WeeChat 3.5]
waleee has joined #ocaml
omegatron has joined #ocaml
raskol has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nfc has joined #ocaml
meinside has quit [Quit: Connection closed for inactivity]
waleee has quit [Ping timeout: 260 seconds]
Haudegen has joined #ocaml
rgrinberg has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
<d_bot_> <Patate> How would you do something like this:
<d_bot_> <Patate> ```type geometry = 2D | 3D``` (which of course is incorrect as you cannot start with digit)
<d_bot_> <cod1r> TWOD | THREED
<d_bot_> <cod1r> 🤣
<d_bot_> <Patate> And with a growing number of cases? like:
<d_bot_> <Patate> type length = 8 | 16 | 32 | Same of length (last case is just so you don't say length = int)
<d_bot_> <Bluddy> Or add a first letter G2D | G3D
<d_bot_> <Bluddy> (geometry or something)
<d_bot_> <Bluddy> N8 | N16 | N32
<d_bot_> <Patate> yuck xD
<d_bot_> <MrPingouin> maybe using other utf8 chars ?
<d_bot_> <MrPingouin> 二 😄
<companion_cube> Geom_2D | Geom_3D I guess, indeed
<d_bot_> <Patate> This is not too bad, but not sure if it better than before...
<d_bot_> <Patate> What I have is a C enum with values that repeat the enum's name, for example
<d_bot_> <Patate> enum geometry_type { geometry_type_2D, geometry_type_3D };
<d_bot_> <Patate> And simply removing it is fine in most cases ( for example case PLANT\_TYPE\_TREE becomes Tree, wich is nicer)
<d_bot_> <Patate> except in those cases
<d_bot_> <Patate> so let it untouched in case it starts with a digit, maybe
<d_bot_> <Patate> (btw, how to properly respond to someone on IRC?)
<companion_cube> just say their name :)
<companion_cube> sometimes it's nice to have a common prefix to all the type's constructors
<companion_cube> helps with tab completion
<d_bot_> <Patate> not sure why... could you elaborate?
<companion_cube> e.g. if it all starts with `Plant_…`
<companion_cube> you can type `Pl<tab>` and see a list of constructors
<d_bot_> <Patate> Oh ok I see... I rarely do this kind of completion, as I do not see constructors with common start often...
<d_bot_> <Patate> so maybe it would be of limited use for me...
motherfsck has quit [Quit: quit]
motherfsck has joined #ocaml
<d_bot_> <Patate> It is going to be generated automatically
<d_bot_> <Patate> It's frustrating how no solution sounds right to me
<d_bot_> <Bluddy> It's not something to get hung up about
<d_bot_> <Patate> probably, but I usually have a hard time keeping going when I am not 100% sure there are no solutions that feel right to me
bartholin has quit [Quit: Leaving]
<sleepydog> if nothing feels quite right, I would favor copying the naming convention from your C enum. because why change it unless the alternative is much better?
rgrinberg has quit [Read error: Connection reset by peer]
rgrinberg has joined #ocaml
perrierjouet has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
<d_bot_> <geoff> In Scad_ml I use `D2` and `D3` for my dimensional GADT, but the type is abstracted so users don't construct them like that. `d2` and `d3` aliases are made available for nicer signatures though.
<d_bot_> <geoff> I didn't really like the names like `TwoD` that I tried at first
mbuf has quit [Quit: Leaving]
misterfish has quit [Ping timeout: 276 seconds]
<sim642> I was gonna say, you can make a ppx rewriter that converts 3d to your D3 constructor
<sim642> But apparently d is not an allowed suffix for extension literals
<sim642> I guess because it's part of hex literals
<sim642> Although could be allowed in decimal literals I suppose
<d_bot_> <Patate> sleepydog : that's it, the alternative IS much better, let apart the problematic cases (0.01% of the code, maybe?)... So I think I might use it, except for the enums that have values that cannot be shortened, and call it good enough for now...
wingsorc has quit [Quit: Leaving]
Haudegen has joined #ocaml
<d_bot_> <Patate> Yes, I don't like that either ^^ In this case I think I would have gone Two_dimensional or Dimension2
<d_bot_> <Patate> sim642 : I still have not ever used ppx xD As long as I don't need them, I think I wll avoid it as much as possible
<d_bot_> <geoff> As long as the module they live in makes sense to house the type and the usage context jives with things having dimensions, I think it's pretty obvious from context what `D2` / `d2` mean.
<d_bot_> <Patate> Sure
<d_bot_> <Patate> The problem is when I have D2 | D3 | Cube | Some_other_weird_stuff_weirdly_related_to_dimension
<d_bot_> <Patate> It's all about the problematic cases ^^
<d_bot_> <geoff> What are you modelling? Why are cube and other things that "live in" 3d be at the "same level" as D2 and D3 themselves?
<d_bot_> <Patate> I'm not. I translate a C library, in which all enum cases are prefixed as the name of the enum, so I immediately thought of stripping it away
<d_bot_> <Patate> it's in the Vulkan library, for an ImageViewType. it can be either 1, 2, or 3D, Cube, 1 or 2D array or Cube_array (don't ask me what this means, I have no clue xD)
<companion_cube> @Pataet just do Geom_2D | Geom_3D | Geom_Cube
<companion_cube> seriously :D
<sim642> After some googling, I think cube means cubemap
hackinghorn has quit [Changing host]
hackinghorn has joined #ocaml
<d_bot_> <geoff> Ah ok, well prefixing with something to keep the names otherwise the same seems appropriate then
wingsorc has joined #ocaml
<d_bot_> <Patate> companion_cube : I would, if it was hand-written code and if was about geometry, but it's none ^^
<d_bot_> <Patate> actally it's the opposite, removing prefix, only letting it as is when the shortened version starts with a digit
wingsorc has quit [Remote host closed the connection]
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gopiandcode has quit [Remote host closed the connection]
gopiandcode has joined #ocaml
gopiandcode has quit [Ping timeout: 246 seconds]
Tuplanolla has quit [*.net *.split]
nerdypepper has quit [*.net *.split]
lobo has quit [*.net *.split]
williewillus has quit [*.net *.split]
asm has quit [*.net *.split]
ralu1 has quit [*.net *.split]
Leonidas has quit [*.net *.split]
kakadu has quit [*.net *.split]
dstein64 has quit [*.net *.split]
ocabot_ has quit [*.net *.split]
CodeBitCookie[m] has quit [*.net *.split]
mclovin has quit [*.net *.split]
Serpent7776 has quit [*.net *.split]
caasih has quit [*.net *.split]
ebb has quit [*.net *.split]
Corbin has quit [*.net *.split]
pgiarrusso has quit [*.net *.split]
b0o has quit [*.net *.split]
sm2n has quit [*.net *.split]
immutable_ has quit [*.net *.split]
seeg has quit [*.net *.split]
jakzale has quit [*.net *.split]
philipwhite_ has quit [*.net *.split]
dh` has quit [*.net *.split]
sleepydog has quit [*.net *.split]
Ekho has quit [*.net *.split]
rak has quit [*.net *.split]
remexre has quit [*.net *.split]
landonf has quit [*.net *.split]
GreaseMonkey has quit [*.net *.split]
jonasbits has quit [*.net *.split]
conjunctive_ has quit [*.net *.split]
habnabit_ has quit [*.net *.split]
d_bot_ has quit [*.net *.split]
rwmjones has quit [*.net *.split]
zozozo has quit [*.net *.split]
drewolson has quit [*.net *.split]
jtm has quit [*.net *.split]
ente has quit [*.net *.split]
andreypopp has quit [*.net *.split]
jsoo has quit [*.net *.split]
tizoc has quit [*.net *.split]
reynir has quit [*.net *.split]
drakonis has quit [*.net *.split]
gopiandcode has joined #ocaml
mclovin has joined #ocaml
nerdypepper has joined #ocaml
Tuplanolla has joined #ocaml
Serpent7776 has joined #ocaml
lobo has joined #ocaml
asm has joined #ocaml
ebb has joined #ocaml
dstein64 has joined #ocaml
ocabot_ has joined #ocaml
immutable_ has joined #ocaml
b0o has joined #ocaml
sm2n has joined #ocaml
seeg has joined #ocaml
jakzale has joined #ocaml
GreaseMonkey has joined #ocaml
williewillus has joined #ocaml
sleepydog has joined #ocaml
rwmjones has joined #ocaml
ralu1 has joined #ocaml
Corbin has joined #ocaml
d_bot_ has joined #ocaml
Leonidas has joined #ocaml
pgiarrusso has joined #ocaml
kakadu has joined #ocaml
conjunctive_ has joined #ocaml
jonasbits has joined #ocaml
zozozo has joined #ocaml
habnabit_ has joined #ocaml
caasih has joined #ocaml
landonf has joined #ocaml
CodeBitCookie[m] has joined #ocaml
dh` has joined #ocaml
drewolson has joined #ocaml
rak has joined #ocaml
reynir has joined #ocaml
jtm has joined #ocaml
jsoo has joined #ocaml
Ekho has joined #ocaml
philipwhite_ has joined #ocaml
ente has joined #ocaml
tizoc has joined #ocaml
andreypopp has joined #ocaml
remexre has joined #ocaml
drakonis has joined #ocaml
d_bot_ has quit [Excess Flood]
d_bot has joined #ocaml
raskol has quit [Ping timeout: 246 seconds]
waleee has joined #ocaml
brettgilio has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
brettgilio has joined #ocaml
brettgilio has quit [Client Quit]
brettgilio has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
raskol has joined #ocaml
rgrinberg has joined #ocaml
wingsorc has joined #ocaml
raskol has quit [Ping timeout: 240 seconds]
meinside has joined #ocaml
azimut has quit [Ping timeout: 268 seconds]
sagax has joined #ocaml
Haudegen has quit [Ping timeout: 246 seconds]
Tuplanolla has quit [Quit: Leaving.]
szkl has quit [Quit: Connection closed for inactivity]
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<d_bot> <bannerets> Hi! I have a question. Why doesn't this work: `let f (type a b) (Refl : (a M.t, b M.t) eq) (x: a M.t) : b M.t = x`. Where `M.t` is an abstract type. It says a and b are incompatible. I already have a proof that `a t = b t`, why does it also check a and b when I convert `a t` to `b t`? More details: https://pastebin.com/aLYzyUFK
<companion_cube> so, I think it's because `M.t` is not injective
<companion_cube> # module M : sig type !'a t end = struct type !'a t = 'a option end;;
<companion_cube> # let f (type a b) (eq : (a M.t, b) eq) (x:a M.t) : b = match eq with Refl -> x;;
<companion_cube> this seems to work
<companion_cube> injective means `a M.t = b M.t ==> a=b`