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/
pi3ce has joined #ocaml
Everything has quit [Quit: leaving]
rgrinberg has quit [Quit: My Unrecognized Mac has gone to sleep. ZZZzzz…]
<discocaml> <deepspacejohn> are locally abstract types (type a.) always suitable for universal quantification ('a.)? I've found that they give much better error messages compared to just universally quantified variables, and I haven't run into downsides yet.
<discocaml> <deepspacejohn> This would be for cases where I don't necessarily need a locally abstract type, but I do need universal quantification.
Haudegen has quit [Quit: Bin weg.]
pi3ce has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
pi3ce has joined #ocaml
<discocaml> <._null._> I think there was something about polymorphic variants where locally abstract types can't work, but generally it's not an issue to always go for both
pi3ce has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
<discocaml> <barconstruction> @deepspacejohn this is just a restatement of what null said but somebody pointed out on reddit that when a function is supposed to be both recursive and polymorphic and the child function is called at a different type than the parent (I thiink like, traversing a heterogenous list or recursive evaluation of an expression in a language with multiple types) then you will have to explicitly annotate the function as polymorphic, if it's loc
<discocaml> <deepspacejohn> interesting and good to know. thank you both.
pi3ce has joined #ocaml
Tuplanolla has quit [Ping timeout: 255 seconds]
<discocaml> <._null._> The explicit universal quantification is usually the thing you want, because it forces polymorphism. Adding the locally abstract type can be useful for error messages and is not recommended against, except if you work with polymorphic variants. To be clear, `type a. _` is already sugar for the combination of explicit polymorphism (`'a. _`) and locally abstract types `(type a)`; it sounds like you take it as being separate from explicit polymo
<discocaml> <deepspacejohn> I’m mainly coming from experience working with mutually recursive functions where some need to be universally quantified, and it seems like locally abstract types are better at “forcing” it to be polymorphic. With just a universally quantified variable, a type error usually causes the compiler to infer it as not polymorphic and then raises the error message at the universally quantified variable. With a locally abstract type, the c
<discocaml> <deepspacejohn> With just a universally quantified variable, type errors turn into “this function is less general than…” messages which means I have to figure out why the compiler is inferring it differently than how I annotated it. Locally abstract types have errors that agree with the annotations
chiselfuse has quit [Ping timeout: 260 seconds]
chiselfuse has joined #ocaml
nirvdrum has joined #ocaml
troydm has quit [Ping timeout: 265 seconds]
bartholin has joined #ocaml
germ has quit [Quit: ZNC 1.8.2 - https://znc.in]
bartholin has quit [Ping timeout: 252 seconds]
mbuf has joined #ocaml
germ has joined #ocaml
Serpent7776 has joined #ocaml
ski has quit [Read error: Connection reset by peer]
Haudegen has joined #ocaml
olle has joined #ocaml
sroso has joined #ocaml
mange has quit [Quit: Zzz...]
Haudegen has quit [Quit: Bin weg.]
sroso has quit [Quit: Leaving :)]
chiselfuse has quit [Remote host closed the connection]
chiselfuse has joined #ocaml
alexherbo2 has joined #ocaml
Haudegen has joined #ocaml
f[x] has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
toastal has quit [Quit: Gateway shutdown]
contificate has joined #ocaml
olle has quit [Ping timeout: 264 seconds]
m5zs7k has quit [Read error: Connection reset by peer]
m5zs7k has joined #ocaml
Serpent7776 has quit [Ping timeout: 276 seconds]
contificate has quit [Quit: Client closed]
zenes has joined #ocaml
zenes has quit [Changing host]
zenes has joined #ocaml
gentauro has quit [Read error: Connection reset by peer]
gentauro has joined #ocaml
toastal has joined #ocaml
toastal has quit [Client Quit]
toastal has joined #ocaml
kurfen has quit [Ping timeout: 248 seconds]
mbuf has quit [Quit: Leaving]
ski has joined #ocaml
pi3ce has quit [Read error: Connection reset by peer]
pi3ce_ has joined #ocaml
cedb has quit [Quit: WeeChat 4.3.1]
myrkraverk has quit [Ping timeout: 252 seconds]
casastorta has quit [Quit: ZNC 1.9.1 - https://znc.in]
casastorta has joined #ocaml
semarie has quit [Quit: quit]
semarie has joined #ocaml
Serpent7776 has joined #ocaml
bartholin has joined #ocaml
kurfen has joined #ocaml
Anarchos has joined #ocaml
<discocaml> <doraent> Hey, has anyone here tried to read the ocaml version CTFP ? I am trying to read it to get some applications of CT, and I find it a bit confusing : ocaml snippets look super verbose/heavy (and could be way smaller), and some parts of the book are just missing ocamlness (every explanation is still haskell-focused, only ocaml code snippets are added). So I thought some parts of the book could be rewrited, and code snippets modified to make a tru
<discocaml> <doraent>
<discocaml> <doraent> PS : sorry for the terrible english
pie_ has quit [Ping timeout: 252 seconds]
pie_ has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
rgrinberg has joined #ocaml
bartholin has quit [Quit: Leaving]
rgrinberg has quit [Quit: My Unrecognized Mac has gone to sleep. ZZZzzz…]
Everything has joined #ocaml
rgrinberg has joined #ocaml
Serpent7776 has quit [Ping timeout: 260 seconds]
Haudegen has quit [Quit: Bin weg.]
mange has joined #ocaml
<masterbuilder> doraent: hmm, skimming through some examples now, I think you are right. I have only read the first few chapters of the original book so I'm not super familiar but these examples seem ridiculous to me. I wonder why it's written like this
<masterbuilder> it might be because in later chapters you need to use the module system more heavily to model the concepts the book talks about (which would be more straightforward in Haskell) and they just deciced to make the style homogenous right from the start? possibly
Tuplanolla has joined #ocaml
<masterbuilder> some of the examples are totally fine, there's just a few at the beginning that really stuck out as being overly complicated to me, there might be a specific reason, I guess you could open an issue on github and ask. and it might be a good idea to just work through the original in haskell/c++, I think ocaml will probably get in the way here honestly
rgrinberg has quit [Quit: My Unrecognized Mac has gone to sleep. ZZZzzz…]
remexre has quit [Ping timeout: 252 seconds]
rgrinberg has joined #ocaml
remexre has joined #ocaml
mange has quit [Remote host closed the connection]
Haudegen has joined #ocaml