adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.09 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.09/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
zolk3ri has quit [Ping timeout: 240 seconds]
zolk3ri has joined #ocaml
kleisli has joined #ocaml
ollehar has quit [Ping timeout: 264 seconds]
ollehar has joined #ocaml
dhil has quit [Ping timeout: 240 seconds]
Guest86335 has joined #ocaml
reynir has quit [Ping timeout: 240 seconds]
reynir has joined #ocaml
amiloradovsky has quit [Ping timeout: 260 seconds]
mfp has quit [Ping timeout: 240 seconds]
motherfsck has joined #ocaml
waleee-cl has quit [Quit: Connection closed for inactivity]
nullcone has quit [Quit: Connection closed for inactivity]
Guest86335 has quit [Ping timeout: 260 seconds]
unihernandez22 has joined #ocaml
Guest86335 has joined #ocaml
unihernandez22 has quit [Ping timeout: 264 seconds]
unihernandez22 has joined #ocaml
unihernandez22 has quit [Ping timeout: 264 seconds]
froostles has joined #ocaml
<froostles> Is there a ppx based library that can generate a unique ID for a given type based on its field names / field types? I want to cache some data using Marshal, but during development my types are changing relatively frequently and I'd like to tag the cached data with a unique ID to ensure that I don't load anything mismatched
osa1 has joined #ocaml
zolk3ri has quit [Remote host closed the connection]
froostles has quit [Ping timeout: 245 seconds]
osa1_ has joined #ocaml
Haudegen has joined #ocaml
nkly_ has joined #ocaml
osa1 has quit [Quit: osa1]
osa1_ has quit [Quit: osa1_]
osa1 has joined #ocaml
craigfe has joined #ocaml
<hannes> haesbaert: it should not. may it be that you use an old version of the "result" (not rresult) package (< 1.5) which shadows the Stdlib.Result? can you refer to Stdlib.Result.get_ok?
mcc has quit [Quit: Connection closed for inactivity]
monad_cat has joined #ocaml
jmorris has joined #ocaml
adrianbrink has quit [Read error: Connection reset by peer]
SrPx has quit [Read error: Connection reset by peer]
banjiewen has quit [Read error: Connection reset by peer]
cemerick has quit [Ping timeout: 240 seconds]
rdivyanshu_ has quit [Ping timeout: 246 seconds]
cemerick has joined #ocaml
banjiewen has joined #ocaml
rdivyanshu_ has joined #ocaml
SrPx has joined #ocaml
adrianbrink has joined #ocaml
mfp has joined #ocaml
jbrown has joined #ocaml
dhil has joined #ocaml
jmorris has quit [Quit: Leaving]
jmorris has joined #ocaml
jmorris has quit [Client Quit]
<haesbaert> hannes: I think that was the case, I switched to a new compiler anyway
osa1 has quit [Quit: osa1]
osa1 has joined #ocaml
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
reynir has quit [Ping timeout: 256 seconds]
reynir has joined #ocaml
monad_cat has quit [Quit: Connection closed for inactivity]
malc_ has joined #ocaml
jbrown has quit [Ping timeout: 272 seconds]
kleisli has quit [Ping timeout: 265 seconds]
jbrown has joined #ocaml
kleisli has joined #ocaml
ggole has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
dhil has quit [Ping timeout: 240 seconds]
craigfe has quit [Ping timeout: 264 seconds]
craigfe has joined #ocaml
waleee-cl has joined #ocaml
dhil has joined #ocaml
olle has joined #ocaml
<olle> the comments on my "functional core, imperative shell" on reddit was weak, man.
<olle> my disappointment is immesurable and my day is ruined
bronsen has quit [Quit: WeeChat 2.8]
<companion_cube> I'd go with functional shell, imperative core :p
bronsen has joined #ocaml
<olle> huh?
<olle> why?
<olle> the point was to make business logic pure so it's easier to test :)
<companion_cube> you can make it pure from the outside, while using tons of delicious imperative code ♥
<olle> I don't see how
<olle> imperative = has side-effects (in this context)
<companion_cube> ah, ok
<companion_cube> for me imperative=I have Hashtbl \o/
malc_ has left #ocaml ["ERC (IRC client for Emacs 28.0.50)"]
<olle> Well, writing to hash table is a side-effect, I guess.
<olle> or reading
<def> If someone else can write to it :P
<def> But that's not necessarily observable from the outside
<olle> def: yes, it can be like this
<olle> or, if a function does not always return the same result
<olle> what's the word
<olle> transparent? transcluent?
<olle> blabla
<theblatte> functional? :)
<olle> no, there's a mathy word for it
<olle> hm, only find "pure"
<olle> I guess you can add "pure from the outside"?
<def> functional :P
mbuf has joined #ocaml
jbrown has quit [Ping timeout: 272 seconds]
<companion_cube> referentially transparent?
jbrown has joined #ocaml
<olle> companion_cube: that's the one :)
dckc has quit [Ping timeout: 265 seconds]
dckc has joined #ocaml
Haudegen has joined #ocaml
mbuf has quit [Quit: Leaving]
dhil has quit [Ping timeout: 246 seconds]
dhil has joined #ocaml
nkly_ has quit [Ping timeout: 272 seconds]
kleisli has quit [Ping timeout: 260 seconds]
<zozozo> olle: you can have structures that behave functionally from an external point of view, but may use mutation under the hood for some optimization (the typical example I can think of is path short-cutting for union-find algorithms)
dhil has quit [Ping timeout: 256 seconds]
dhil has joined #ocaml
<olle> zozozo: sure
<olle> zozozo: still doesn't solve the architectural problem
<olle> concerning business logic
<olle> memoization (fibonacci e.g.) is another example
osa1 has quit [Ping timeout: 256 seconds]
<companion_cube> of hidden imperative code? sure
<companion_cube> and hashconsing ♥
<olle> not necessarily "hidden", but e.g. only doing database access from the "top"
<olle> there's no idiomatic way in OCaml to bubble around side-effects, is what I'm saying :d
<zozozo> hm.. from what I remember, one proposal for effects included having one effects that represent all current mutations that can be performed in ocaml (io, refs, ..), and since functions would be annotated with their effects, this would let you track mutability (or maybe I don't understand what you mean by "bubble arond side-effects", :p )
<olle> zozozo: yeah, not sure what the final proposal landed
<olle> if it was connected to multicore?
<zozozo> although in that case, such externally functional but internally using mutation data structures, would have to be marked as having effects, even if these are not intended to be observable
<companion_cube> and it's all speculation for now
<olle> zozozo: true
<olle> companion_cube: what is speculation?
<zozozo> olle: it was part of the user-facing part of multicore, but has been separated from it, so that the backend part of mulcitocre (gc, and runtime support) could be mùerged without waiting for the years (decades ?) of bikeshedding around that
<companion_cube> the effect system
<companion_cube> olle: maybe you should use haskell
nullcone has joined #ocaml
<olle> companion_cube: or PHP! Because you can use yield with promises ;D
<zebrag> Is "bubble around" "hoisting"? Probably not.
<olle> what's hoisting?
<olle> companion_cube: no one knows how the effect system will look like? it's not an open process?
<companion_cube> it's a research process
<olle> cool
<companion_cube> it can land in 2 years or 10 years for all I know
<companion_cube> so, until then, I try to stick with non scifi OCaml
<olle> ^^
<olle> I'm reading about mocking strategies in Haskell, it's pretty cool what they come up with
<zebrag> What is the "effect system"?
<companion_cube> zebrag: annotating function types with the possible effects that they can do
<zebrag> Haskell code is very clean and organized (just saying)
<olle> zebrag: no
<olle> you put IO monad everywhere, you have the same problem as any other language
<companion_cube> or, don't put IO everywhere, you know?
<olle> no = not automagically
<olle> companion_cube: sure, but it's the same as in PHP: don't mix business logic with side-effects
Haudegen has quit [Quit: Bin weg.]
<olle> the language does nothing, it's up to the discipline of the programmer
<zebrag> Yes, I know the argument about IO everywhere; not sure I agree with it
<olle> zebrag: how come?
<companion_cube> olle: if you're looking for a language that magically writes code for you, you might have to wait a while.
<olle> companion_cube: hehe, no, I want a framework that makes sure business logic contains no IO
<olle> or, language + framework
<olle> not sure either is enough in itself
<companion_cube> olle: in haskell, make sure business logic is not in IO
<companion_cube> problem solved
<companion_cube> 🤷
<companion_cube> even better, make a `BusinessLogic` monad that doesn't encompass IO, and provides just the right primitives
<companion_cube> problem solved
<olle> companion_cube: meh
<olle> not really
<companion_cube> yes really
<zebrag> olle: just as companion_cube said. You don't have to put it every where; And when you are writing your code you have an accurate feeling of what you're doing when using monads, you really feel in control (again it's only my opinion)
<olle> business logic still has to interact with IO
<companion_cube> so business logic is not pure?
<companion_cube> I mean, that's not what you said earlier
<olle> this guy has an interesting approach: https://degoes.net/articles/modern-fp
<olle> but maybe too elaborate
<companion_cube> ah, the free monad? sure, go for it
<companion_cube> but still, you didn't respond
<Armael> maybe you should try to actually write some prototye and see how it fits together, rather than trying to shop around for "the perfect magical solution"?
<olle> companion_cube: respond to what? if business logic is pure?
<olle> Armael: yes, doing it, but in PHP
<companion_cube> yeah, you contradict yourself
<companion_cube> you said you want to isolate the business logic, and then you say it has to do IOs
<olle> https://amphp.org/ <-- Example of wrapping IO in promises in PHP
<olle> gotta go, sorry
<Armael> maybe do that in not-PHP instead?
<companion_cube> how are promises related to the whole discussion
<olle> companion_cube: could be any object
<Armael> IMO the best way to understand how one would do X in {OCaml, Haskell, ...} is to try to do it yourself
<olle> just how they chose to do it
<Armael> (in the corresponding language)
<companion_cube> I seriously doubt you can do anything in php's type system that you couldn't do in OCaml
<companion_cube> (in haskell, sure, it's more advanced in some respects)
<zebrag> When writing ocaml code, I sometimes have the feeling there are uncontrolled side effects peppered everywhere. I'm telling to myself, if it keeps going this way, it'll end up being a glorified php.
<olle> companion_cube: you can't do coroutines in OCaml...?
<companion_cube> lwt?
<olle> companion_cube: with let% ?
<olle> true, that's very similar to yield
<theblatte> everything is a glorified php
<Drup> olle: the last version of lwt has those
<olle> yep, think I saw that
<Drup> theblatte: you spent too much time at facebook
* olle signing off
<companion_cube> with let, bind, whatever
mbuf has joined #ocaml
<theblatte> Drup: we don't do php here :p (that line is how you know I've spent too much time at fb ;) )
olle has quit [Ping timeout: 240 seconds]
remexre has joined #ocaml
jbrown has quit [Ping timeout: 272 seconds]
vicfred has joined #ocaml
sagax has quit [Ping timeout: 240 seconds]
mbuf has quit [Quit: Leaving]
jbrown has joined #ocaml
Haudegen has joined #ocaml
Tsukimaru has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 240 seconds]
Guest86335 has quit [Ping timeout: 246 seconds]
Guest86335 has joined #ocaml
<d_bot> <kanishka> olle: Matt Parsons has some blog articles in Haskell about functional core... I have done some Haskell, but I haven't tried all the various approaches to effects and layering. Generally, you can start by laying out the core pure functions that will return Result or Option, and then start to think about the imperative parts later.
sagax has joined #ocaml
osa1 has joined #ocaml
Hrundi_V_Bakshi has joined #ocaml
craigfe has quit [Quit: WeeChat 2.9]
<ollehar> hm
<ollehar> link?
ggole has quit [Quit: Leaving]
inkbottle has joined #ocaml
zebrag has quit [Ping timeout: 246 seconds]
osa1 has quit [Ping timeout: 240 seconds]
inkbottle has quit [Quit: Konversation terminated!]
<d_bot> <kanishka> https://www.reddit.com/r/haskell/comments/8693m0/three_layer_haskell_cake/ . I read it a while ago. I haven't kept up on what people are interested in lately. John De Goes, mentioned above, is worth reading as well.
inkbottle has joined #ocaml
amiloradovsky has joined #ocaml
reynir has quit [Ping timeout: 256 seconds]
reynir has joined #ocaml
<ollehar> thanks!
<ollehar> pretty interesting that even such an academic language as haskell has buckets of caveats. "don't use this!"
<ollehar> how much did you win if it's still possible to write aweful code?
<ollehar> or is it harder to write bad haskell code than to write bad php or java code?
<companion_cube> probably?
<ollehar> yes, probably :)
<companion_cube> languages matter, but they're not the ultimate tool that makes everything perfect
<ollehar> T_T
Serpent7776 has quit [Quit: leaving]
<ollehar> This guy even stopped recommending his own stuff: https://www.parsonsmatt.org/2016/07/14/rank_n_classy_limited_effects.html
<companion_cube> well, sometimes people change their mind
vicfred has quit [Quit: Leaving]
* ollehar nods
<ollehar> usually that's on community level, not single-person level, haha
<ollehar> ah well
<ollehar> but I'll save it for /r/programmingcirclejerk
<waleee-cl> ollehar: you also have the polysemy-author in the same vein, https://reasonablypolymorphic.com/blog/mea-culpa/
<ollehar> hm
<ollehar> I was hoping to inject side-effect discipline on the framework level in PHP, by injecting only IO promise factories, without the possibility to fire those promises by the client code. but it's just a thought so far.
<ollehar> but that's pretty much what amphp.org is already doing.
<ollehar> when I suggested the mocking strategy to them, they said "no sane person would do that" xD
craigfe has joined #ocaml
<ollehar> waleee-cl: that's a pretty sad story :|
<companion_cube> someone makes a public post acknowledging they were wrong? I think it's nice
<waleee-cl> he admitted a negative research result, had it been academia it'd have been a pretty gutsty move
<ollehar> companion_cube: sad from his point of view, I mean.
kleisli has joined #ocaml
<companion_cube> ah, I see
Tsukimaru has quit [Quit: Leaving]
amiloradovsky has quit [Ping timeout: 260 seconds]
jbrown has quit [Ping timeout: 272 seconds]
kleisli_ has joined #ocaml
kleisli has quit [Ping timeout: 260 seconds]
amiloradovsky has joined #ocaml
Hrundi_V_Bakshi has quit [Ping timeout: 264 seconds]
Haudegen has quit [Ping timeout: 240 seconds]
vicfred has joined #ocaml
jbrown has joined #ocaml
_ks has joined #ocaml
amiloradovsky has quit [Ping timeout: 260 seconds]
mangoicedtea has joined #ocaml
kleisli_ has quit [Remote host closed the connection]
kleisli_ has joined #ocaml
nullcone has quit [Quit: Connection closed for inactivity]
dhil has quit [Ping timeout: 264 seconds]