adrien changed the topic of #ocaml to: Channel available on irc.libera.chat | Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 4.12 released: https://ocaml.org/releases/4.12.0.html | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://irclog.whitequark.org/ocaml
zebrag has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
dhil has quit [Ping timeout: 240 seconds]
Haudegen has quit [Ping timeout: 240 seconds]
wingsorc has quit [Remote host closed the connection]
wingsorc has joined #ocaml
motherfsck has quit [Ping timeout: 268 seconds]
zebrag has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
zebrag has quit [Remote host closed the connection]
wingsorc_ has joined #ocaml
wingsorc has quit [Ping timeout: 245 seconds]
mbuf has joined #ocaml
wingsorc_ has quit [Remote host closed the connection]
wingsorc_ has joined #ocaml
wingsorc_ has quit [Client Quit]
Boarders has left #ocaml [#ocaml]
wingsorc has joined #ocaml
<d_bot> <dj charlie> @adrien#0000 no dice if i wanna reuse stdin tho 😔
vicfred has quit [Ping timeout: 260 seconds]
wingsorc has quit [Remote host closed the connection]
wingsorc has joined #ocaml
waleee-cl has quit [Quit: Connection closed for inactivity]
wingsorc has quit [Read error: Connection reset by peer]
Geekingfrog has quit [Quit: ZNC 1.8.2 - https://znc.in]
Haudegen has joined #ocaml
Jesin has quit [Ping timeout: 265 seconds]
dhil has joined #ocaml
bartholin has joined #ocaml
wildsebastian has quit [*.net *.split]
jeroud has quit [*.net *.split]
thizanne has quit [*.net *.split]
adi__________ has quit [*.net *.split]
b20n has quit [*.net *.split]
mrallen1 has quit [*.net *.split]
notnotdan_ has quit [*.net *.split]
artart78 has quit [*.net *.split]
adi__________ has joined #ocaml
artart78 has joined #ocaml
wildsebastian has joined #ocaml
thizanne has joined #ocaml
mrallen1 has joined #ocaml
b20n has joined #ocaml
jeroud has joined #ocaml
notnotdan_ has joined #ocaml
higherorder__ has quit [Ping timeout: 265 seconds]
labor[m] has quit [Ping timeout: 245 seconds]
dash has quit [Ping timeout: 246 seconds]
radiopotin[m] has quit [Ping timeout: 246 seconds]
Sumera[m] has quit [Ping timeout: 258 seconds]
avsm[m] has quit [Ping timeout: 245 seconds]
jimt[m] has quit [Ping timeout: 246 seconds]
smondet[m] has quit [Ping timeout: 246 seconds]
BitPuffin has quit [Ping timeout: 245 seconds]
aspiwack[m] has quit [Ping timeout: 258 seconds]
inkbottle[m] has quit [Ping timeout: 258 seconds]
dieggsy has quit [Ping timeout: 246 seconds]
higherorder__ has joined #ocaml
peddie has quit [Ping timeout: 276 seconds]
pqwy[m] has quit [Ping timeout: 245 seconds]
lnxw37d4 has quit [Ping timeout: 276 seconds]
Tardigreat[m] has quit [Ping timeout: 276 seconds]
flux has quit [Ping timeout: 276 seconds]
dash has joined #ocaml
jimt[m] has joined #ocaml
radiopotin[m] has joined #ocaml
labor[m] has joined #ocaml
inkbottle[m] has joined #ocaml
BitPuffin has joined #ocaml
dieggsy has joined #ocaml
Sumera[m] has joined #ocaml
aspiwack[m] has joined #ocaml
smondet[m] has joined #ocaml
avsm[m] has joined #ocaml
peddie has joined #ocaml
lnxw37d4 has joined #ocaml
Tardigreat[m] has joined #ocaml
pqwy[m] has joined #ocaml
Jesin has joined #ocaml
flux has joined #ocaml
mbuf has quit [Quit: Leaving]
bartholin has quit [Ping timeout: 240 seconds]
bartholin has joined #ocaml
olle has joined #ocaml
zebrag has joined #ocaml
gareppa has joined #ocaml
bartholin has quit [Ping timeout: 240 seconds]
<d_bot> <undu> I'm progressing with the new vim filetypes for mli, mll and mly files, I'd like to know which vim plugins I'm missing that you'r using, so I can adapt them to the change. the list of plugins can be seen at https://github.com/ocaml/vim-ocaml/pull/61
bartholin has joined #ocaml
bartholin has quit [Ping timeout: 240 seconds]
gareppa has quit [Quit: Leaving]
bartholin has joined #ocaml
bartholin has quit [Ping timeout: 265 seconds]
gareppa has joined #ocaml
bartholin has joined #ocaml
beajeanm has quit [Quit: The Lounge - https://thelounge.chat]
beajeanm has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
sagax has quit [Quit: Konversation terminated!]
sagax has joined #ocaml
gareppa has quit [Quit: Leaving]
zebrag has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
gareppa has joined #ocaml
bartholin has quit [Ping timeout: 265 seconds]
bjorkintosh has joined #ocaml
gareppa has quit [Quit: Leaving]
gareppa has joined #ocaml
User4321 has joined #ocaml
bartholin has joined #ocaml
<User4321> Hi could someone help me define a custom sum type? Thank you
<Tardigreat[m]> what do you mean by a custom sum type, just a variant?
<Tardigreat[m]> as in, type foo = ... | ... | ...?
<User4321> I have defined a Command sum type that represents some commands of a imperative language: Affectation, Sequence, Condition, Loop, Skip
<User4321> I have defined how to evaluate an expression with these commands.
<User4321> When I want to create a new expression (program) to evaluate, I need to use a lot of Sequence (binary operator)
<User4321> I want to be able to define an expression as a List of commands. Hence I need to change my Command type.
<User4321> Here are my currently defined types: https://pastebin.com/FYxL1p9j
nullcone has joined #ocaml
bartholin has quit [Ping timeout: 260 seconds]
bartholin has joined #ocaml
<d_bot> <bnguyenvanyen> I'm not sure to understand, but you can have `Sequence of command list` as a constructor, or whatever you need.
<User4321> @d_bot Thanks for your help
<User4321> I don't really understand what you are saying.
<User4321> My goal is to get rid of Sequence and to have the ability to use a List of Commands for the arguments of Condition and Loop (not the first boolean of course)
mxns has quit [Quit: ZNC 1.8.2 - https://znc.in]
mxns has joined #ocaml
<d_bot> <octachron> It sounds simpler to have `Sequence of command list`.
mxns has quit [Ping timeout: 240 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 250 seconds]
waleee-cl has joined #ocaml
mxns has joined #ocaml
bartholin has quit [Ping timeout: 265 seconds]
mxns has quit [Ping timeout: 250 seconds]
gareppa has quit [Quit: Leaving]
mxns has joined #ocaml
gareppa has joined #ocaml
schlaftier has quit [Quit: The Lounge - https://thelounge.chat]
bartholin has joined #ocaml
schlaftier has joined #ocaml
mxns has quit [Ping timeout: 258 seconds]
tane has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
jbrown has quit [Ping timeout: 245 seconds]
jbrown has joined #ocaml
bartholin has quit [Ping timeout: 240 seconds]
bartholin has joined #ocaml
<d_bot> <stab> Is there something like this for https://docs.rs/typenum/1.13.0/typenum/ ocaml? It's basically a set of generics to sorta get integer generic types for things like making things typesafe and generic over array bounds
<d_bot> <stab> It's no longer required in rust due to const generics but i dont think there is anything like const generics in ocaml
<d_bot> <stab> i dont think it would really be possible in ocaml i guess since typenum really depends on the trait system to work
<d_bot> <stab> just basically trying to make sure users of my library dont pass me two vectors of different bitwidths
<d_bot> <stab> and cant think of a way to do it besides runtime exceptions
<zozozo> ah, I misread slightly, it doesn't seem to be exactly what you wanted
<d_bot> <octachron> Generically, it is partially possible but the complexity explode quite quickly with the number of features. See http://akabe.github.io/slap/ or https://github.com/Octachron/tensority for the explosion part.
<d_bot> <stab> yeah i want to include like a type representing a length in the type
<d_bot> <stab> gotcha ill check out how they are doing it
<d_bot> <stab> i dont think it should be so bad since the only type requirement is that we can only operate over vectors of the same bitwidth
<d_bot> <stab> guess this is the core of it
<d_bot> <octachron> If you only need to compare size equality, you can use a binary encoding of natural at the type level + a ppx for helping users define the type.
<d_bot> <octachron> Or you can use a functor to define a fresh "one int" type with few runtime conversion functions
<d_bot> <stab> yeah so i thought about using a functor but im not clear what type the functor would be over
<d_bot> <stab> it would have to be like an encoding of integers no?
bartholin has quit [Ping timeout: 265 seconds]
gareppa has quit [Quit: Leaving]
<d_bot> <octachron> You can do something like `F(struct val value:int end): sig type size type 'a array ... end`
<d_bot> <octachron> where the type `size` is morally equal to `value` but no one can know it.
<d_bot> <stab> gotcha
<d_bot> <stab> but that doe require them to only call the functor once
<d_bot> <stab> for each bitwidth they want
<d_bot> <stab> which is fine i suppose
<d_bot> <octachron> Of probably better `module Int :sig type 'a t module F(X:sig val value end): sig type n type nat = n t) end`
<d_bot> <octachron> Since functors are applicative in OCaml, the users would only need to define the size module once.
zebrag has quit [Quit: Konversation terminated!]
<d_bot> <octachron> Then various application of the functor with the same `Size` module as input will yield compatible types.
zebrag has joined #ocaml
<olle> phantom types?
hackinghorn has quit [Quit: Leaving]
<octachron> types that are not associated to a value. For instance: `'a nat` in `sig type 'a nat val zero: unit nat end : struct type 'a nat = int let zero = 0 end`
bartholin has joined #ocaml
<d_bot> <stab> idk why ccube is hosting zarith docs but i appreciate it greatly lol,
<olle> octachron: yes. :) It was a suggestion.
<d_bot> <stab> yeah i mean phantom types are part of the possible solution but like a direct application of phantom types without anything else would require like a function per size for creating an object of that type, as well as a type per size you want
<d_bot> <stab> typenum leverages traits to define a successor operation at the type level so you can actually have the naturals in the type system fully
<d_bot> <stab> which allows the phantom type solution to just work tm, little harder in ocaml imo
<d_bot> <stab> const generics ocaml when lol?
olle has quit [Ping timeout: 260 seconds]
Anarchos has joined #ocaml
bartholin has quit [Ping timeout: 260 seconds]
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
Anarchos has joined #ocaml
bartholin has joined #ocaml
mxns has joined #ocaml
mxns has quit [Ping timeout: 250 seconds]
zebrag has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
bartholin has quit [Ping timeout: 260 seconds]
landonf has quit [Excess Flood]
landonf has joined #ocaml
arecaceae has quit [Remote host closed the connection]
arecaceae has joined #ocaml
bartholin has joined #ocaml
webshinra has quit [Quit: Leaving]
jbrown has quit [Quit: Leaving]
zebrag has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
olle has joined #ocaml
mxns has joined #ocaml
olle has quit [Remote host closed the connection]
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
mxns has quit [Ping timeout: 258 seconds]
Anarchos has joined #ocaml
bartholin has quit [Ping timeout: 260 seconds]
visage_ has joined #ocaml
bartholin has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
User4321 has quit [Quit: Connection closed]
zebrag has quit [Read error: Connection reset by peer]
mxns has joined #ocaml
mxns has quit [Ping timeout: 245 seconds]
mxns has joined #ocaml
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
bartholin has quit [Ping timeout: 246 seconds]
tane has quit [Quit: Leaving]
mxns has quit [Ping timeout: 240 seconds]