companion_cube changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.11 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.11/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
olle_ has quit [Ping timeout: 240 seconds]
<d_bot> <score> a side effect is a modification of state, and while I'm not too well-versed in the terminology (it's been some years since I took comp sci) it seems natural to me to consider appending to a file/pipe to be a modification of state, even if it is state that is ultimately outside of the program's control or often write-only from the perspective of the program
<d_bot> <score> someone correct me if i'm off the mark here please 😛
<d_bot> <TheBloodlessMan> Nah I’d say that on the mark, since reading and writing to some store/state (which includes the file system) is clearly an effect
<d_bot> <TheBloodlessMan> And since stdout implements the file abstraction, then it follows that printing (writing) to stdout is an effect
<d_bot> <TheBloodlessMan> Also printing doesn’t satisfy referential transparency, since the value of printing is typically (), but () is not semantically equivalent to print_string “Hello World”
Haudegen has quit [Ping timeout: 260 seconds]
curtosis[away] has joined #ocaml
curtosis[away] has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
waleee-cl has quit [Quit: Connection closed for inactivity]
curtosis has joined #ocaml
mxns has quit [Quit: ZNC 1.8.2 - https://znc.in]
osa1_ has joined #ocaml
osa1 has quit [Ping timeout: 252 seconds]
tpefreedom has joined #ocaml
mfp has quit [Ping timeout: 240 seconds]
mxns has joined #ocaml
curtosis has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
curtosis[away] has joined #ocaml
curtosis[away] has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
osa1_ has quit [Ping timeout: 268 seconds]
aquijoule_ has joined #ocaml
richbridger has quit [Ping timeout: 252 seconds]
vicfred_ has joined #ocaml
vicfred has quit [Ping timeout: 240 seconds]
vicfred_ has quit [Client Quit]
vicfred has joined #ocaml
Shreya has joined #ocaml
tpefreedom has left #ocaml [#ocaml]
Sonakshi has joined #ocaml
Sonakshi has quit [Client Quit]
Shreya has quit [Ping timeout: 258 seconds]
narimiran has joined #ocaml
vicfred has quit [Quit: Leaving]
mxns has quit [Ping timeout: 240 seconds]
pamee has joined #ocaml
mxns has joined #ocaml
pamee has quit [Quit: Connection closed]
mro_name has joined #ocaml
mro_name has quit [Client Quit]
Serpent7776 has joined #ocaml
mxns has quit [Ping timeout: 246 seconds]
mro_name has joined #ocaml
mro_name has quit [Quit: Leaving...]
Tuplanolla has joined #ocaml
Ankita has joined #ocaml
Ankita has quit [Quit: Connection closed]
osa1 has joined #ocaml
bartholin has joined #ocaml
ania123 has joined #ocaml
Shreya has joined #ocaml
Shreya has quit [Client Quit]
Shreya has joined #ocaml
bartholin has quit [Ping timeout: 246 seconds]
slt[m] has quit [Quit: Idle for 30+ days]
infinit_0 has joined #ocaml
waleee-cl has joined #ocaml
bartholin has joined #ocaml
bartholin has quit [Ping timeout: 265 seconds]
ania123 has quit [Quit: Connection closed]
bartholin has joined #ocaml
mxns has joined #ocaml
infinit_0 has quit [Quit: Connection closed]
mxns has quit [Ping timeout: 250 seconds]
Shreya has quit [Ping timeout: 258 seconds]
olle_ has joined #ocaml
bartholin has quit [Ping timeout: 240 seconds]
olle_ has quit [Ping timeout: 240 seconds]
bartholin has joined #ocaml
Shreya has joined #ocaml
Haudegen has joined #ocaml
mro_name has joined #ocaml
iZsh has quit [Quit: ZNC - http://znc.in]
iZsh has joined #ocaml
mfp has joined #ocaml
mro_name has quit [Remote host closed the connection]
mro_name has joined #ocaml
mro_name has quit [Remote host closed the connection]
Boarders has quit [Quit: Connection closed for inactivity]
Shreya has quit [Ping timeout: 258 seconds]
ArthurStrong has joined #ocaml
Shreya has joined #ocaml
bartholin has quit [Ping timeout: 240 seconds]
<d_bot> <EduardoRFS> Can I license my code as MIT and link it to a modified version of the OCaml compiler? The source is distributed with the code
mmohammadi9812 has joined #ocaml
bartholin has joined #ocaml
Ananya has joined #ocaml
zebrag has joined #ocaml
Shreya has quit [Ping timeout: 258 seconds]
Shreya has joined #ocaml
Ananya has quit [Ping timeout: 240 seconds]
mro_name has joined #ocaml
mxns has joined #ocaml
mro_name has quit [Ping timeout: 250 seconds]
mxns has quit [Ping timeout: 250 seconds]
olle_ has joined #ocaml
neiluj has joined #ocaml
neiluj has quit [Changing host]
neiluj has joined #ocaml
shawnw has quit [Ping timeout: 246 seconds]
IngeEmma has joined #ocaml
oriba has joined #ocaml
mxns has joined #ocaml
<d_bot> <hcarty> I looked into this a while ago - not for the compiler, but another project - and you can license your own code however you want as long as it's not derived from something with a license that prevents that.
<d_bot> <hcarty>
<d_bot> <hcarty> From a user's perspective the whole body of code may as well be under the compiler's license because the compiler's LGPL w/linking exception is more restrictive than MIT. However, it also means that if someone wants to build on your code, independent of the compiler, they can do so under the terms of the MIT license. And if the compiler license ever changed your code would continue to be MIT licensed
mxns_ has joined #ocaml
mxns has quit [Ping timeout: 245 seconds]
bartholin has quit [Ping timeout: 240 seconds]
<d_bot> <EduardoRFS> My concern is mostly if someone wants to change my code for their own use-case I don't want anyone to feel bothered to "contribute back", but of course I cannot offer the same for the compiler.
<d_bot> <EduardoRFS>
<d_bot> <EduardoRFS> So I think having MIT for my code + LGPL w linking exception will be a nice middle term
<d_bot> <hcarty> Yeah that seems reasonable
mxns_ has quit [Ping timeout: 245 seconds]
mxns has joined #ocaml
bartholin has joined #ocaml
mxns has quit [Ping timeout: 246 seconds]
IngeEmma has quit [Ping timeout: 240 seconds]
mxns has joined #ocaml
mro_name has joined #ocaml
mxns has quit [Ping timeout: 265 seconds]
olle_ has quit [Ping timeout: 240 seconds]
<d_bot> <Drup> MIT is officialy GPL-compatible, you are free to go :p
mxns has joined #ocaml
mxns has quit [Ping timeout: 260 seconds]
mmohammadi9812 has quit [Remote host closed the connection]
shawnw has joined #ocaml
mro_name has quit [Remote host closed the connection]
mxns has joined #ocaml
mxns has quit [Ping timeout: 258 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 240 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 246 seconds]
curtosis has joined #ocaml
mxns has joined #ocaml
mro_name has joined #ocaml
mxns has quit [Ping timeout: 240 seconds]
mxns has joined #ocaml
bartholin has quit [Ping timeout: 240 seconds]
curtosis has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
mxns has quit [Ping timeout: 252 seconds]
mxns has joined #ocaml
mro_name has quit [Remote host closed the connection]
mxns has quit [Quit: ZNC 1.8.2 - https://znc.in]
mxns has joined #ocaml
ArthurStrong has quit [Ping timeout: 240 seconds]
mxns has quit [Ping timeout: 240 seconds]
bartholin has joined #ocaml
mxns has joined #ocaml
mxns has quit [Ping timeout: 246 seconds]
curtosis has joined #ocaml
mxns has joined #ocaml
tpefreedom has joined #ocaml
Shreya has quit [Ping timeout: 258 seconds]
<d_bot> <Kakadu> What is the most recommended in 2021 tutorial to make x64 GNU/Linux OCaml host start generating "ELF 32-bit LSB executable, ARM, EABI5 version 1" (or similar) code?
curtosis is now known as curtosis[away]
curtosis[away] has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
<d_bot> <froyo> I will cry
<d_bot> <froyo> I will literally cry
<d_bot> <Kakadu> I hope it is not because my message
bjorkint0sh has quit [Ping timeout: 258 seconds]
mxns has quit [Ping timeout: 246 seconds]
<d_bot> <froyo> I've been onto this exact specific goal
mxns has joined #ocaml
mxns has quit [Ping timeout: 250 seconds]
<d_bot> <EduardoRFS> WE FIXED ESY SORRY
<d_bot> <froyo> 😂
<d_bot> <EduardoRFS> as soon as I make the release of esy.0.6.9 I can merge the PRs and add armv7 and armv6 to the CI
<d_bot> <froyo> > esy.0.6.9
<d_bot> <froyo>
<d_bot> <froyo> nice
mxns has joined #ocaml
mxns has quit [Ping timeout: 245 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 246 seconds]
<d_bot> <Kakadu> @HYPHEN if you would find the right tutorial -- ping me, please
bartholin has quit [Ping timeout: 268 seconds]
mxns has joined #ocaml
bartholin has joined #ocaml
mxns has quit [Ping timeout: 240 seconds]
mxns has joined #ocaml
<d_bot> <froyo> try @EduardoRFS 's reason-mobile, maybe it'll work for you
<d_bot> <froyo> my setup is kinda sorta weird
mxns has quit [Ping timeout: 246 seconds]
mxns has joined #ocaml
shawnw has quit [Ping timeout: 240 seconds]
Guest18 has joined #ocaml
Guest18 has left #ocaml [#ocaml]
tmp123 has joined #ocaml
ArthurStrong has joined #ocaml
mxns has quit [Ping timeout: 240 seconds]
mxns has joined #ocaml
mxns has quit [Quit: ZNC 1.8.2 - https://znc.in]
mxns has joined #ocaml
mxns has quit [Client Quit]
mxns has joined #ocaml
<tmp123> Hello. I have a tiny exercice for school where I have to make a function to count the number of time that n appears in list l. See my code https://paste.debian.net/1192233/ but my code does not compile and my function compt to count is horrible because let res = 0 is not here. What should I do to first make it compile and then improve the
<tmp123> readability of my program please ?
dckc has quit [Quit: ZNC 1.6.6+deb1ubuntu0.2 - http://znc.in]
dckc has joined #ocaml
<hannes> tmp123: the result of your "compte" function is another list (List.filter returns a list) --> use "print_int (List.length u)" in the last line
olle_ has joined #ocaml
mxns has quit [Quit: ZNC 1.8.2 - https://znc.in]
mxns has joined #ocaml
<tmp123> hannes it works and returns 2: https://paste.debian.net/1192234/ but is there a way to return directly 2 from the function instead of use List?length after?
<hannes> tmp123: sure, take a look at List.fold_left
<tmp123> hannes I mean could I put two lines in the same function in ocaml?
mxns has quit [Ping timeout: 246 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 240 seconds]
mxns has joined #ocaml
ArthurStrong has quit [Quit: leaving]
mxns has quit [Ping timeout: 268 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 252 seconds]
mxns has joined #ocaml
<d_bot> <dinosaure> what do you mean? the new line (instead of Python) does not have a signification for OCaml 🙂
<d_bot> <dinosaure> so you can put many lines as you want
<olle_> (unless you're using *that* syntax revision...)
mxns has quit [Ping timeout: 246 seconds]
mxns has joined #ocaml
<steenuil> I've written a bit of F# and I have to say I kinda liked the lighter syntax
<steenuil> on the other hand, it makes some things really awkward
<d_bot> <dinosaure> then, in your _french_ example, many things come to my mind. First, `[ ... ]` is not a "tableau"/`array` but a list 🙂 then, take care about `==`. In your example, it's work but if you want to test the "equality" (as we usually want), you should use `=`
<steenuil> but admittedly those mostly have to do with the weird mix of C# syntax and OCaml syntax
<d_bot> <dinosaure> `==` is the _physical equality_ which means something else specially for more complex values
<tmp123> dinosaure I mean yes what is the best syntax for ocaml
<d_bot> <dinosaure> we use multi-line mostly, you can see some examples here: https://ocaml.org/learn/tutorials/99problems.html
<d_bot> <dinosaure> it's some OCaml exercises with solutions, a good start 🙂
<tmp123> dinosaure it is not what I am looking for I just want to know how to write several lines in the same function (fun) in ocaml if I should
<d_bot> <dinosaure> ```
<d_bot> <dinosaure> let f = fun a b ->
<d_bot> <dinosaure> a + b in
<d_bot> <dinosaure> f 21 5 ;;
mxns has quit [Quit: ZNC 1.8.2 - https://znc.in]
<d_bot> <dinosaure> - : int = 26
<d_bot> <dinosaure> ```
mxns has joined #ocaml
<d_bot> <dinosaure> but it's about style and some people will not agree with such style. More commonly, when it's about style, we prefer to use a _linter_ such as `ocamlformat` which re-style your code
<olle_> Oh, there is a linter? Nice.
<steenuil> tmp123, you might wanna take a look at this page https://ocaml.org/learn/tutorials/structure_of_ocaml_programs.html
<tmp123> yes but can I use fun instead of several variables
<tmp123> ?
<tmp123> ah yes nice
<tmp123> yes I want to use waht you did but I might read in the online manual that it is a bad pratice
mxns has quit [Quit: ZNC 1.8.2 - https://znc.in]
mxns has joined #ocaml
<olle_> "might"?
mxns has quit [Ping timeout: 246 seconds]
bartholin has quit [Ping timeout: 268 seconds]
mxns has joined #ocaml
narimiran has quit [Quit: leaving]
bartholin has joined #ocaml
mxns has quit [Ping timeout: 250 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 245 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 250 seconds]
tmp123 has quit [Ping timeout: 240 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 240 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 268 seconds]
bartholin has quit [Ping timeout: 265 seconds]
mxns has joined #ocaml
glass has joined #ocaml
neiluj has quit [Quit: leaving]
mxns has quit [Ping timeout: 258 seconds]
theglass has quit [*.net *.split]
bartholin has joined #ocaml
mxns has joined #ocaml
Guest18 has joined #ocaml
<Guest18> olle_ yes I may make a mistake
<Guest18> you told the contrary :)
yichiehc has joined #ocaml
Serpent7776 has quit [Quit: leaving]
mxns has quit [Ping timeout: 258 seconds]
mxns has joined #ocaml
bartholin has quit [Quit: Leaving]
olle_ has quit [Ping timeout: 240 seconds]
mxns has quit [Ping timeout: 250 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 250 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 250 seconds]
Guest18 is now known as tmp123
<tmp123> olle_ yes
<tmp123> Hello. I am debugging an elf file and then I did :> dmhg
<tmp123> No Heap section
<tmp123> sorry wrong channel
tmp123 has left #ocaml [#ocaml]
mxns has joined #ocaml
Tuplanolla has quit [Quit: Leaving.]
tpefreedom has quit [Ping timeout: 260 seconds]
yichiehc has quit [Quit: Connection closed]
zebrag has quit [Quit: Konversation terminated!]