<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...
<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`