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
mxns has quit [Ping timeout: 276 seconds]
rom1504 has quit [Ping timeout: 272 seconds]
rom1504 has joined #ocaml
Tuplanolla has quit [Ping timeout: 245 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 272 seconds]
henistein has quit [Quit: Connection closed]
mxns has joined #ocaml
mxns has quit [Ping timeout: 240 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 272 seconds]
decentpenguin has quit [Ping timeout: 245 seconds]
decentpenguin has joined #ocaml
mxns has joined #ocaml
mxns has quit [Ping timeout: 272 seconds]
mxns has joined #ocaml
xandkar has quit [Remote host closed the connection]
rock64 has quit [Ping timeout: 245 seconds]
mxns has quit [Ping timeout: 276 seconds]
rock64 has joined #ocaml
mxns has joined #ocaml
xandkar has joined #ocaml
oriba has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
xandkar1 has joined #ocaml
xandkar1 has quit [Quit: xandkar1]
wreed has joined #ocaml
mxns has quit [Quit: ZNC 1.8.2 - https://znc.in]
mxns has joined #ocaml
mxns has quit [Quit: ZNC 1.8.2 - https://znc.in]
mxns has joined #ocaml
Haudegen has quit [Ping timeout: 264 seconds]
mxns has quit [Ping timeout: 265 seconds]
mxns has joined #ocaml
wreed has quit [Quit: Goodbye]
mxns has quit [Ping timeout: 260 seconds]
wreed has joined #ocaml
wreed has quit [Quit: Goodbye]
mfp has quit [Ping timeout: 264 seconds]
mbuf has joined #ocaml
mxns has joined #ocaml
wingsorc has quit [Quit: Leaving]
mxns has quit [Ping timeout: 260 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 245 seconds]
mxns has joined #ocaml
mxns 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: 272 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 260 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 245 seconds]
xandkar1 has joined #ocaml
mxns has joined #ocaml
mxns has quit [Ping timeout: 264 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 256 seconds]
_whitelogger has joined #ocaml
mxns has quit [Ping timeout: 260 seconds]
arecaceae has quit [Remote host closed the connection]
arecaceae has joined #ocaml
sonfon has joined #ocaml
mxns has joined #ocaml
mxns has quit [Ping timeout: 256 seconds]
mxns has joined #ocaml
decentpenguin has quit [Quit: ZNC crashed or something]
decentpenguin has joined #ocaml
shawnw has quit [Remote host closed the connection]
waleee-cl has quit [Quit: Connection closed for inactivity]
mxns has quit [Ping timeout: 260 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 240 seconds]
shawnw has joined #ocaml
Tuplanolla has joined #ocaml
webshinra has quit [Remote host closed the connection]
webshinra has joined #ocaml
webshinra has quit [Remote host closed the connection]
webshinra has joined #ocaml
_whitelogger has joined #ocaml
vicfred has quit [Quit: Leaving]
ewd has joined #ocaml
mxns has joined #ocaml
mxns has quit [Ping timeout: 260 seconds]
sonfon has quit [Ping timeout: 240 seconds]
tane has joined #ocaml
ewd has quit [Ping timeout: 246 seconds]
Haudegen has joined #ocaml
mfp has joined #ocaml
mxns has joined #ocaml
mxns has quit [Ping timeout: 260 seconds]
nullcone has quit [Quit: Connection closed for inactivity]
henistein has joined #ocaml
<henistein> I am a student and I am currently learning ocaml, after I search for some books I found real world ocaml by o’reilley . The problem is that it uses core.std. Should I use another book or it is ok? Do you use that lib often?
henistein has quit [Quit: Connection closed]
henistein has joined #ocaml
zebrag has joined #ocaml
ewd has joined #ocaml
henistein has quit [Ping timeout: 240 seconds]
<qwr> many people use, shouldn't be a problem as the language is still same. https://ocaml.org/learn/books.html
mxns has joined #ocaml
mxns has quit [Ping timeout: 245 seconds]
eoyath has quit [Quit: Connection closed for inactivity]
mxns has joined #ocaml
mxns has quit [Ping timeout: 265 seconds]
shawnw has quit [Ping timeout: 246 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 260 seconds]
henistein has joined #ocaml
<henistein> what is the simple way to split a string?
<tizoc> henistein: String.split_on_char
<henistein> thanks
mxns has joined #ocaml
mxns has quit [Ping timeout: 245 seconds]
mxns has joined #ocaml
<dmbaturin> henistein: One problem with RWOv1 is that many examples no longer compile with recent Core versions.
<dmbaturin> If you ignore the Core stuff, it's a good book though.
mxns has quit [Ping timeout: 260 seconds]
<henistein> yes it explains very well, I will read it and ignore the Core stuff, thanks
mxns has joined #ocaml
mxns has quit [Ping timeout: 240 seconds]
mxns has joined #ocaml
<dmbaturin> henistein: I'm slowly writing one at https://ocamlbook.org with the idea to stick to the standard library and go bottom up.
<dmbaturin> Well, and under a free license so that it can be maintained without me.
mxns has quit [Ping timeout: 240 seconds]
<henistein> wow amazing I will read that
mxns has joined #ocaml
mxns has quit [Ping timeout: 264 seconds]
henistein has quit [Quit: Connection closed]
mxns has joined #ocaml
mxns has quit [Ping timeout: 256 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 276 seconds]
mxns has joined #ocaml
ewd has quit [Remote host closed the connection]
kini has quit [Quit: bye]
mxns has quit [Ping timeout: 256 seconds]
waleee-cl has joined #ocaml
kini has joined #ocaml
mxns has joined #ocaml
mxns has quit [Ping timeout: 240 seconds]
mbuf has quit [Quit: Leaving]
mxns has joined #ocaml
bjorkintosh has quit [*.net *.split]
dx has quit [*.net *.split]
copy has quit [*.net *.split]
chewbranca has quit [*.net *.split]
adi__________ has quit [*.net *.split]
cbarrett has quit [*.net *.split]
angerman has quit [*.net *.split]
Boarders has quit [*.net *.split]
jeroud has quit [*.net *.split]
rfv has quit [*.net *.split]
pmonson has quit [*.net *.split]
ipavlo has quit [*.net *.split]
bjorkintosh has joined #ocaml
jeroud has joined #ocaml
angerman has joined #ocaml
rfv has joined #ocaml
Boarders has joined #ocaml
chewbranca has joined #ocaml
dx has joined #ocaml
adi__________ has joined #ocaml
copy has joined #ocaml
pmonson has joined #ocaml
cbarrett has joined #ocaml
ipavlo has joined #ocaml
cbarrett has joined #ocaml
cbarrett has quit [Changing host]
pmonson has quit [Changing host]
pmonson has joined #ocaml
adi__________ has joined #ocaml
ipavlo has joined #ocaml
adi__________ has quit [Changing host]
ipavlo has quit [Changing host]
cbarrett has quit [Max SendQ exceeded]
cbarrett has joined #ocaml
nullcone has joined #ocaml
aspiwack[m] has quit [Ping timeout: 240 seconds]
slt[m] has quit [Ping timeout: 268 seconds]
sonfon has joined #ocaml
aditi314 has quit [Ping timeout: 246 seconds]
smondet[m] has quit [Ping timeout: 268 seconds]
stites[m] has quit [Ping timeout: 268 seconds]
BitPuffin has quit [Ping timeout: 244 seconds]
peddie has quit [Ping timeout: 244 seconds]
tjammer[m] has quit [Ping timeout: 246 seconds]
dash has quit [Ping timeout: 268 seconds]
avsm[m] has quit [Ping timeout: 258 seconds]
pqwy[m] has quit [Ping timeout: 240 seconds]
flux has quit [Ping timeout: 268 seconds]
lnxw37d4 has quit [Ping timeout: 268 seconds]
labor[m] has quit [Ping timeout: 260 seconds]
mxns has quit [Ping timeout: 245 seconds]
Jeanne-Kamikaze has joined #ocaml
jimt[m] has quit [Ping timeout: 258 seconds]
mxns has joined #ocaml
slt[m] has joined #ocaml
henistein has joined #ocaml
<henistein> I want to make a function that receives a list and if the list has one element it returns it, if not it returns the list, I have this: let one_element l = if ((List.length l) = 1) then (List.nth l 0) else l;;
<henistein> but it is wrong and I don't know why
aspiwack[m] has joined #ocaml
<d_bot_> <Christophe> henistein: this cannot type properly because in one case you return a list and in other case you return it's elements
<d_bot_> <Christophe> for instance in one case you'd return an int list and another case an int, so you cannot give a type to this function
stites[m] has joined #ocaml
<d_bot_> <Christophe> one option for you would be to use the Either type defined as `type ('a,' b) either = Left of 'a | Right of' b` and in one case you'd return for instance `Left (List.nth l 0)` and other case `Right l`
smondet[m] has joined #ocaml
arecaceae has quit [Remote host closed the connection]
arecaceae has joined #ocaml
aditi314 has joined #ocaml
peddie has joined #ocaml
BitPuffin has joined #ocaml
dash has joined #ocaml
mxns has quit [Ping timeout: 264 seconds]
mxns has joined #ocaml
tjammer[m] has joined #ocaml
mxns has quit [Ping timeout: 246 seconds]
avsm[m] has joined #ocaml
<d_bot_> <Styxs> how are you actually supposed to do comparisons now in Base since they removed the polymorphic comparator
<d_bot_> <Styxs> Char.equal / String.equal etc. is quite verbose
<d_bot_> <undu> You can still use `Char.(=)`
<d_bot_> <Styxs> is that what people use?
labor[m] has joined #ocaml
<steenuil> you can do `Char.('a' = 'a')`
<d_bot_> <undu> don't know what other people use, it's what I've used for upgrading some code: https://github.com/xapi-project/xapi-storage-script/commit/338912cf817a06cdde2d2602bbf2d3fce1bd466b
pqwy[m] has joined #ocaml
sonfon has left #ocaml ["Leaving"]
<d_bot_> <Styxs> oh i didn't know that cool
mxns has joined #ocaml
lnxw37d4 has joined #ocaml
mxns has quit [Ping timeout: 265 seconds]
flux has joined #ocaml
jimt[m] has joined #ocaml
vicfred has joined #ocaml
mxns has joined #ocaml
kini has quit [Quit: bye]
mxns has quit [Ping timeout: 245 seconds]
kini has joined #ocaml
mxns has joined #ocaml
mxns has quit [Quit: ZNC 1.8.2 - https://znc.in]
mxns has joined #ocaml
mxns has quit [Quit: ZNC 1.8.2 - https://znc.in]
mxns has joined #ocaml
kini has quit [Quit: bye]
mxns has quit [Client Quit]
mxns has joined #ocaml
kini has joined #ocaml
mxns has quit [Ping timeout: 258 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 264 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 264 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 260 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 260 seconds]
kini has quit [Remote host closed the connection]
kini has joined #ocaml
<henistein> let last_two = function
<henistein>          | [] | [_] -> None
<henistein>          | [a; b] -> Some (a, b)
<henistein>          | h :: t -> last_two t;;
<henistein> Why can't use a list of ints with this function, how does the ocaml knows that this is just for strings?
<d_bot_> <Butanium> what is Some (a,b)?
<d_bot_> <Butanium> If Some requires a string tuple that's why
<henistein> Is some just for strings?
<henistein> I can have a tuple of ints like int * int = (1, 2)
<steenuil> henistein, you forgot rec in the definition of last_two
<steenuil> most likely you're calling a previously defined function that only worked with lists of strings
<steenuil> (if you want to define a recursive function in OCaml you need to write `let rec` instead of just `let`)
<henistein> Ah ok thanks, now it works with ints too, makes sense
FrothyPeak has joined #ocaml
ollehar3 has joined #ocaml
<ollehar3> test
<ollehar3> hm
<ollehar3> is there a conflict between readability and maintainability?
<ollehar3> higher maintainability makes more abstract code
FrothyPeak has quit [Quit: Leaving]
tane has quit [Quit: Leaving]
Haudegen has quit [Ping timeout: 245 seconds]