ansiwen has quit [Read error: Connection reset by peer]
ansiwen has joined #ocaml
narimiran has joined #ocaml
outerpassage has joined #ocaml
waleee-cl has quit [Quit: Connection closed for inactivity]
wonko7 has joined #ocaml
bjorkintosh has quit [Ping timeout: 250 seconds]
Jesin has quit [Ping timeout: 252 seconds]
vsiles_ is now known as vsiles
olle has joined #ocaml
olle has quit [Ping timeout: 252 seconds]
<d_bot>
<darrenldl> astronavt: was crystal lang and pendulum time api satisfactory to you in terms of UX?
<d_bot>
<darrenldl>
<d_bot>
<darrenldl> context: im gesturing if "date" and "time" should be available as separate things. some libraries do that, and defining date time as tuple of the two (with time zone attached to "time"). i have reservations about usefulness of said representation, but figured i should get some second opinions
<d_bot>
<darrenldl> companion_cube: unfortunately i have yet to use anything in Hash
olle has joined #ocaml
kunalprakash1309 has joined #ocaml
kunalprakash1309 has quit [Client Quit]
kunalprakash1309 has joined #ocaml
kunalprakash1309 has quit [Client Quit]
kunalprakash1309 has joined #ocaml
kunalprakash1309 has quit [Client Quit]
nullcone has quit [Quit: Connection closed for inactivity]
<olle>
Hi ho people
<olle>
Is there an alternative to the word "total function", which does not require the function to *return*, only to *handle* all incoming input?
<olle>
Like traversing an AST, but throwing an exception on some case.
<d_bot>
<darrenldl> exception for still accepted ast? or rejected ast?
Haudegen has joined #ocaml
bjorkintosh has joined #ocaml
<d_bot>
<darrenldl> i mean you can just say it has well-defined behaviour in any case?
<olle>
darren, for rejected, maybe. Just an example
<olle>
What's well-defined behaviour...?
<olle>
Pre- and post-conditions?
<d_bot>
<darrenldl> i mean that is still total? you give an answer for all inputs?
<olle>
It must return for all values
<olle>
No exceptions or errors
jon9000 has joined #ocaml
<d_bot>
<darrenldl> well-defined in the sense that you have no ambiguity as to what happens in a rejected case, instead of, say, indulging in undefined behaviours like some C functions
<olle>
Hm
<d_bot>
<darrenldl> also i dont know if im fully sold on result/error type = not total argument in the general case, but i digress
<olle>
Exhaustiveness, is the word
<olle>
Probably
jon9000 has quit []
kini has quit [Ping timeout: 258 seconds]
<d_bot>
<mattjbray> ```
<d_bot>
<mattjbray> utop # let f = function | true -> "ok";;
<d_bot>
<mattjbray> Line 1, characters 8-31:
<d_bot>
<mattjbray> Warning 8: this pattern-matching is not exhaustive.
<d_bot>
<mattjbray> Here is an example of a case that is not matched:
<d_bot>
<mattjbray> false
<d_bot>
<mattjbray> val f : bool -> string = <fun>
<d_bot>
<mattjbray> ```
<d_bot>
<mattjbray> OCaml agrees with "exhaustive", at least in the context of pattern-matching 🙂
<d_bot>
<darrenldl> i mean you can still make an "exhaustive" and partial function, so the word by itself doesnt seem descriptive enough
<d_bot>
<darrenldl> or maybe it is for the use case, idk
kini has joined #ocaml
bjorkintosh has quit [Remote host closed the connection]
bjorkintosh has joined #ocaml
bjorkintosh has quit [Ping timeout: 245 seconds]
bartholin has joined #ocaml
jimt[m] has quit [Quit: Bridge terminating on SIGTERM]
aspiwack[m] has quit [Quit: Bridge terminating on SIGTERM]
dash1 has quit [Quit: Bridge terminating on SIGTERM]
flux has quit [Quit: Bridge terminating on SIGTERM]
smondet[m] has quit [Quit: Bridge terminating on SIGTERM]
radiopotin[m] has quit [Quit: Bridge terminating on SIGTERM]
aditi314 has quit [Quit: Bridge terminating on SIGTERM]
avsm[m] has quit [Quit: Bridge terminating on SIGTERM]
serif[m] has quit [Quit: Bridge terminating on SIGTERM]
BitPuffin has quit [Quit: Bridge terminating on SIGTERM]
Tardigreat[m] has quit [Quit: Bridge terminating on SIGTERM]
dieggsy has quit [Quit: Bridge terminating on SIGTERM]
lnxw37d4 has quit [Quit: Bridge terminating on SIGTERM]
peddie has quit [Quit: Bridge terminating on SIGTERM]
Coldfusion[m] has quit [Quit: Bridge terminating on SIGTERM]
pqwy[m] has quit [Quit: Bridge terminating on SIGTERM]
labor[m] has quit [Quit: Bridge terminating on SIGTERM]
anton_5[m] has quit [Quit: Bridge terminating on SIGTERM]
Sumera[m] has quit [Quit: Bridge terminating on SIGTERM]
smondet[m] has joined #ocaml
<dmbaturin>
companion_cube: I'm using CCHashtbl.keys_list and CCHashtbl.of_list in the tsort library.
labor[m] has joined #ocaml
dash has joined #ocaml
Tardigreat[m] has joined #ocaml
pqwy[m] has joined #ocaml
aditi314 has joined #ocaml
dieggsy has joined #ocaml
flux has joined #ocaml
lnxw37d4 has joined #ocaml
jimt[m] has joined #ocaml
aspiwack[m] has joined #ocaml
BitPuffin has joined #ocaml
avsm[m] has joined #ocaml
radiopotin[m] has joined #ocaml
Sumera[m] has joined #ocaml
peddie has joined #ocaml
anton_5[m] has joined #ocaml
Coldfusion[m] has joined #ocaml
serif[m] has joined #ocaml
mbuf has quit [Remote host closed the connection]
mbuf has joined #ocaml
bjorkintosh has joined #ocaml
richbridger has quit [Remote host closed the connection]
richbridger has joined #ocaml
Serpent7776 has quit [Read error: Connection reset by peer]
Serpent7776 has joined #ocaml
mfp has joined #ocaml
vicfred has quit [Quit: Leaving]
Haudegen has quit [Quit: Bin weg.]
<companion_cube>
Right, but that's with the normal polymorphic hash. :)
Haudegen has joined #ocaml
<dmbaturin>
companion_cube: Hhm, which functions you mean then? I may not even know they exist it seems. :)
st8less has joined #ocaml
<takside>
heya, i'm getting told that Unix.inet_addr_loopback and _any are unbound values, but other bindings under Unix like Unix.O_RDWR can be accessed fine. Anybody know what could be up? I've got `unix` in my `libraries` stanza in dune
<takside>
fwiw, `dune build` is telling me this, merlin/tuareg in emacs autocompletes them fine
<dmbaturin>
takside: Interesting. What's the OS?
<takside>
Linux/Fedora 33
<takside>
ocaml version 4.11.1
<dmbaturin>
Strange... that's pretty much my setup and I had no problem with it. Could you paste the dune file?
<takside>
sure thing, shall i put it on pastebin or something?
<d_bot>
<zozozo> @BigOof @mattjbray note that in the case of partial functions, ocaml actually has a defined behavior which is to raise the `Match_failure` when a pattern match "fails" because it's not exhaustive
tane has joined #ocaml
<astronavt>
@darrenldl yeah the ux was fine for me. i don't mind if a "time" has an arbitrary date attached to it, especially because it avoids problems with overflow/underflow when doing "time math"
<astronavt>
and if you care about getting time zones etc. right then you should use a proper datetime
<astronavt>
and if you don't care, maybe just work in seconds or unix timestamps anyway
<dmbaturin>
takside: My guess is that Core shadows the Unix library bindings in an incompatible way.
<dmbaturin>
When you do "open Core", it's not the stdlib Unix module that you have in your namespace, it's Core's Unix.
<takside>
oh right, thanks. Sorry - i've got the Core docs now so I'll look through these in future. Tyvm
<dmbaturin>
Sometimes I feel like Cato the Elder who ended all his speeches with "and I want to add that Carthage has to be destroyed".
<dmbaturin>
I want to add that unless you work at JaneStreet, replacing the standard library with Core is entirely optional. If you like Core, there's nothing wrong with it, but the way it's intended to be used, by shadowing the stdlib, is problematic. There are much less intrusive options like Containers. Core's backward compatibility record is not flawless either, a lot of Real World OCaml v1 examples no longer
<takside>
out of interest btw, I'm very new to OCaml - is it advisable to be using Core & Lwt or should I avoid Core and/or Lwt (instead using async?)
<dmbaturin>
build.
<takside>
okay ty. I'm mostly using it cause i'm learning from a hodgepodge of different guides/docs and some of them use Core and some not iirc
<dmbaturin>
It's Core that forces (or used to force) you to use async instead of lwt. I think they might have had removed that limitation, but I'm not sure, I'm not a Core user. Either way, Lwt doesn't influence your choice of other libraries.
nullcone has joined #ocaml
<dmbaturin>
Also, RWO makes Core look more popular than it is. In reality it doesn't have so many reverse dependencies: https://opam.ocaml.org/packages/core/
<takside>
oh right, i'll try just avoiding it for now. At the very least it'll make my life easier not having stuff shadowed by it
<d_bot>
<darrenldl> @guigui well i was thinking partial in the sense of non-termination, in which case "exhaustiveness" doesn't give a very good description of what to anticipate from a function without more elaboration
<d_bot>
<darrenldl> astronavt: thanks!
vicfred has joined #ocaml
waleee-cl has joined #ocaml
<st8less>
Is it possible in Menhir to represent a space-separated list without emiting tokens for whitespace? separated_list(' ', element) raises and error, which makes sense. I just don't know if there is a better way.
<st8less>
It's not a big problem to emit tokens, but I have to account for all the possibilities of beginning and trailing whitespace around objects.
<st8less>
Oh, I think I figured it out. option(WSP) lets me throw those away where I don't need them. Rubber ducky ftw.
<d_bot>
<froyo> probably because it's b l o a t
<octachron>
st8less, if you don't have white space token, you cannot have a space-separated list, but you you may have a list of elements (depending on the definition of elements).
olle has left #ocaml [#ocaml]
<st8less>
octachron, thanks! I figured it out. I'm trying to learn parsing, and it's been a heck of a rabbit hole. Really interesting, though.
neiluj has joined #ocaml
neiluj has quit [Changing host]
neiluj has joined #ocaml
<d_bot>
<darrenldl> if it's easier to navigate it might still be tolerable in more cases
mbuf has quit [Quit: Leaving]
wonko7 has quit [Quit: See You Space Cowboy..]
wonko7 has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
wonko7 has quit [Quit: See You Space Cowboy..]
wonko7 has joined #ocaml
bartholin has quit [Quit: Leaving]
aditi314 has left #ocaml ["User left"]
<d_bot>
<RegularSpatula> As a fairly new ocaml person, it seems to me that people have strong (generally negative) feelings on Core. Is that the case and if so why? Just curious as I enjoy using core and friends
<d_bot>
<score> do the irc users see who those replies are for or are they just left disorientated
st8less has quit [Ping timeout: 276 seconds]
st8less has joined #ocaml
<d_bot>
<Anurag> dmbaturin: Core doesn't force using async. Async makes use of Core.
<d_bot>
<Anurag> @RegularSpatula Some people might have reservations about adding core to the dependency tree as it isn't as portable as some other options (it doesn't have windows support for example). The real-world-ocaml book has also switched to using `base` for most of the examples which has a much smaller footprint and is portable. You can read more details about the relationship between base, core_kernel and core at https://ocaml.janestreet
Tuplanolla has joined #ocaml
<d_bot>
<froyo> RegularSpatula: i wouldnt add more to Anurag's excellent reply
Haudegen has joined #ocaml
<d_bot>
<froyo> ..unless you also care about aesthetics.
<d_bot>
<froyo> core/base's api is label-heavy and doesn't encourage pipelast by default (labels do alleviate this though)
<d_bot>
<froyo> but it's mainly just the fact that it's a heavy less-portable dependency yes, like Anurag said
<d_bot>
<rgrinberg> base is about as portable as anything else
<d_bot>
<Anurag> my portability comment was more for Core. base works everywhere OCaml does.
<d_bot>
<rgrinberg> such a silly thing to say
<d_bot>
<froyo> base is smaller too yee
<d_bot>
<froyo> > such a silly thing to say
<d_bot>
<froyo> i thought the spaced out letters gave that away 😄
<d_bot>
<rgrinberg> glad to hear it was sarcasm
<d_bot>
<Anurag> something that won't show up in opam rev-deps is also that core/async etc are used by quite a few commercial companies, that don't have things published on opam.
<d_bot>
<rgrinberg> yes, opam is mostly a collection of small libraries written by individuals. not even close to representative of the kind of software that needs core
<d_bot>
<RegularSpatula> Yeah good point about the heavy use of labels. I could see it being an annoyance if you don’t like the labels. Personally, I like the label usage so for me that’s a point in its favor