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/
YuGiOhJCJ has joined #ocaml
Tuplanolla has quit [Quit: Leaving.]
<discocaml> <qrpnxz> > a bind and return function in the monadic interface part of the interface is not harder to discover than an instance of the monad type class.
<discocaml> <qrpnxz> Sometimes there is no instance, but you need it, except it isn't "your" type. Then what? You can fork the library, πŸ˜” or you can make an orphan instance, 🀒 or you have to make a wrapper type and duplicate pre-existing API 😩 (only partly alleviated by deriving).
<discocaml> <qrpnxz> Sometimes a 20 line example is worth a hundred words πŸ™
<discocaml> <qrpnxz> eio is pretty straight forward and explicit. It's not aimed at concurrency alone, but what I would call IO resource management in general. It has a wide variety of capabilities and a structure to pass them aroudn and track them: domains, processes, time, buffers, file system, byte streams, networking, etc.
<discocaml> <qrpnxz> And it's a mature library.
<discocaml> <qrpnxz> Some other mentioned I think still need work, and need documentation.
<companion_cube> it'd be nice if it adopted picos
raskol has quit [Quit: Lost terminal]
raskol has joined #ocaml
raskol has quit [Client Quit]
raskol has joined #ocaml
kurfen has quit [Ping timeout: 265 seconds]
spew has quit [Quit: spew]
myrkraverk has quit [Ping timeout: 265 seconds]
infinity0 has quit [Ping timeout: 245 seconds]
myrkraverk has joined #ocaml
infinity0 has joined #ocaml
kurfen has joined #ocaml
raskol has quit [Ping timeout: 244 seconds]
gdiazlo has quit [Ping timeout: 265 seconds]
gdiazlo has joined #ocaml
pie_ has quit []
pie_ has joined #ocaml
toastal has joined #ocaml
Serpent7776 has joined #ocaml
bartholin has joined #ocaml
gdiazlo has quit [Ping timeout: 265 seconds]
gdiazlo has joined #ocaml
gdiazlo has quit [Ping timeout: 248 seconds]
gdiazlo has joined #ocaml
gdiazlo has quit [Ping timeout: 276 seconds]
szkl has quit [Quit: Connection closed for inactivity]
gdiazlo has joined #ocaml
bartholin has quit [Quit: Leaving]
toastal has quit [Ping timeout: 248 seconds]
Serpent7776 has quit [Quit: Lost terminal]
Serpent7776 has joined #ocaml
gdiazlo has quit [Ping timeout: 248 seconds]
gdiazlo has joined #ocaml
keyboard has joined #ocaml
<discocaml> <reynir1396> Is `type unit` defined anywhere in a file or so? Or is it built-in?
<discocaml> <._null._> It's built-in but it could be defined manually. I think it's built-in because it's used by other built-in stuff
<discocaml> <._null._> Same goes for lists I think
<discocaml> <lecondorduplateau> <https://ocaml.org/manual/5.2/api/Stdlib.Unit.html> πŸ—Ώ
<discocaml> <gooby_clown> You wish to tell me that `unit` is defined as `Unit.t` which is defined as `unit`
<discocaml> <gooby_clown> :triggered_ocaml:
<discocaml> <gooby_clown> Thought actually how should this `t = r = s` syntax be interpreted
<discocaml> <._null._> t is defined as r, but the constructors should now point to t instead of r
<discocaml> <._null._> (so unit is not defined as Unit.t)
<discocaml> <gooby_clown> Ahh
<discocaml> <gooby_clown> Then you were right, it's the same with list https://github.com/ocaml/ocaml/blob/trunk/stdlib/list.ml#L17
<discocaml> <reynir1396> Ah thanks
<discocaml> <reynir1396> I like the documentation for `Unit.to_string` btw
<discocaml> <reynir1396> well, all of the functions in `Unit`
<discocaml> <reynir1396> must have been fun to write :D
<discocaml> <gooby_clown> They should make it a functor instance
<discocaml> <gooby_clown> "`fmap f ()` is ()"
<discocaml> <reynir1396> Nice
<discocaml> <reynir1396> ```OCaml
<discocaml> <reynir1396> type t = unit = ()
<discocaml> <reynir1396>
<discocaml> <reynir1396> let equal () () = true
<discocaml> <reynir1396> let compare () () = 0
<discocaml> <reynir1396> let to_string () = "()"
<discocaml> <reynir1396> ```
<discocaml> <lecondorduplateau> why have named parameter `b` in `Unit.to_string` lmao
<discocaml> <lecondorduplateau> why have named parameter `b` in `Unit.to_string` documentation lmao
koadko has joined #ocaml
koadko has quit [Remote host closed the connection]
gdiazlo has quit [Ping timeout: 252 seconds]
gdiazlo has joined #ocaml
raskol has joined #ocaml
szkl has joined #ocaml
toastal has joined #ocaml
YuGiOhJCJ has quit [Quit: YuGiOhJCJ]
toastal has left #ocaml [Error from remote client]
deavmi has quit [Read error: Connection reset by peer]
toastal has joined #ocaml
deavmi has joined #ocaml
<discocaml> <luck33> What is the common functionality of a "Make" function? I saw a blog post alluding to there being some consensus on what Make should do.
<discocaml> <._null._> Do you mean `make` vs `create` ?
<discocaml> <deepspacejohn> for a module with type `t`, `make` or `create` is conventionally the function to construct a new value of type `t`. In the stdlib, `create` is usually used for mutable types.
<discocaml> <hockletock> capital-M Make is a functor e.g. Set.Make
<discocaml> <hockletock> it makes a useful version of a module with a supplied type
<discocaml> <._null._> Is it ? I thought the consensus was that `create` is for uninitialised stuff
<discocaml> <deepspacejohn> I suppose so, but uninitialized things need to be mutable.
<discocaml> <._null._> The nuance would be between `Array.make` and `Array.create_float`
<discocaml> <deepspacejohn> Ah, yeah I see.
<discocaml> <deepspacejohn> I guess most types, creating an initialized one would mean using a function like `of_seq`
<companion_cube> finally adding cookie support to ezcurl!
<companion_cube> πŸŽ‰
raskol has quit [Quit: Lost terminal]
<discocaml> <gooby_clown> πŸŽ‰
toastal has left #ocaml [Error from remote client]
theblatte has quit [Ping timeout: 248 seconds]
theblatte has joined #ocaml
bartholin has joined #ocaml
gdiazlo has quit [Ping timeout: 246 seconds]
gdiazlo has joined #ocaml
xgqt has quit [Quit: WeeChat 4.1.2]
xgqt has joined #ocaml
Anarchos has joined #ocaml
gdiazlo has quit [Ping timeout: 252 seconds]
raskol has joined #ocaml
gdiazlo has joined #ocaml
gdiazlo has quit [Remote host closed the connection]
euphores has quit [Ping timeout: 248 seconds]
gdiazlo has joined #ocaml
euphores has joined #ocaml
cr1901_ has joined #ocaml
cr1901 has quit [Ping timeout: 245 seconds]
pi3ce has quit [Read error: Connection reset by peer]
<Anarchos> Is this syntax legal ? (c_library_flags (:include (flags.sexp))) Error: Unexpected list
pi3ce has joined #ocaml
euphores has quit [Ping timeout: 265 seconds]
bartholin has quit [Quit: Leaving]
euphores has joined #ocaml
Serpent7776 has quit [Quit: leaving]
pi3ce has quit [Read error: Connection reset by peer]
pi3ce_ has joined #ocaml
Tuplanolla has joined #ocaml
<discocaml> <Kali> type unit is built-in, but in the sense that it is predefined rather than being anything special: `()` can be used as a constructor name in any variant type you want, it just happens to be used for unit by default
<discocaml> <Kali> for example:
<discocaml> <Kali> ```ocaml
<discocaml> <Kali> type demo = () of int
<discocaml> <Kali>
<discocaml> <Kali> let demonstration = () 5
<discocaml> <Kali> ```
<discocaml> <Kali> for example:
<discocaml> <Kali> ```ocaml
<discocaml> <Kali> type demo = () of int
<discocaml> <Kali>
<discocaml> <Kali> let demonstration : demo = () 5
<discocaml> <Kali> ```
<discocaml> <Kali> type unit is built-in, but in the sense that it is predefined rather than being anything special: `()` can be used as a constructor name in any variant type you want, it just happens to be used for unit by default (list is similar in this manner)
<discocaml> <Kali> type unit is built-in, but in the sense that it is predefined rather than being anything special: `()` can be used as a constructor name in any variant type you want, it just happens to be used for unit by default (list is similar in this manner with (::) and [])
<discocaml> <qrpnxz> lol
<discocaml> <qrpnxz> your story doesn't hold up
<discocaml> <qrpnxz> wait it does
<discocaml> <qrpnxz> i was just getting a warning
<discocaml> <qrpnxz> understandably πŸ˜†
Anarchos has quit [Quit: Vision[]: i've been blurred!]
<discocaml> <Kali> yes, you get a warning whenever you redefine the () constructor
<discocaml> <Kali> since in most cases you probably mean the type unit, not the constructor ()
<discocaml> <Kali> but it is just a warning; the above code is perfectly valid
<discocaml> <._null._> `type cursed = () of unit list | [] of unit | (::) of cursed * cursed let cursed = [] () :: () [()]`
<discocaml> <yawaramin> oh lort.
<discocaml> <Kali> ```ocaml
<discocaml> <Kali> type unit = []
<discocaml> <Kali>
<discocaml> <Kali> type 'a list = (::) | () of 'a * 'a list
<discocaml> <Kali>
<discocaml> <Kali> let ignore _ = []
<discocaml> <Kali> let a_list = () (1, () (2, () (3, (::))))
<discocaml> <Kali> ```
<companion_cube> Good god
<discocaml> <deepspacejohn> Let’s make the most cursed alternate stdlib possible