MadcapJake has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orbifx has quit [Ping timeout: 246 seconds]
ziyourenxiang has joined #ocaml
al-damiri has quit [Quit: Connection closed for inactivity]
jbrown has quit [Remote host closed the connection]
iovec has joined #ocaml
mfp has quit [Ping timeout: 258 seconds]
kvda has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kvda has joined #ocaml
Spetznaz_ has quit [Ping timeout: 245 seconds]
JimmyRcom has quit [Ping timeout: 246 seconds]
tormen has joined #ocaml
tormen_ has quit [Ping timeout: 245 seconds]
JimmyRcom has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
iovec has quit [Quit: Connection closed for inactivity]
kvda has joined #ocaml
marvin2 has quit [Ping timeout: 246 seconds]
kvda has quit [Read error: Connection reset by peer]
JimmyRcom has quit [Ping timeout: 244 seconds]
kvda has joined #ocaml
gravicappa has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
z__tid has quit [Ping timeout: 252 seconds]
z__tid has joined #ocaml
sonologico has quit [Remote host closed the connection]
_whitelogger has joined #ocaml
horatiohb has quit [Ping timeout: 258 seconds]
ostera has joined #ocaml
jao has quit [Ping timeout: 240 seconds]
KeyJoo has joined #ocaml
recj has quit [Read error: Connection reset by peer]
recj has joined #ocaml
carlosdagos has quit [Quit: Connection closed for inactivity]
kvda has joined #ocaml
Serpent7776 has joined #ocaml
recj has quit [Read error: Connection reset by peer]
recj has joined #ocaml
iovec has joined #ocaml
Armael has quit [Ping timeout: 272 seconds]
Armael has joined #ocaml
rixed has quit [Remote host closed the connection]
rixed has joined #ocaml
ziyourenxiang has quit [Ping timeout: 250 seconds]
marvin2 has joined #ocaml
bartholin has joined #ocaml
KeyJoo has quit [Ping timeout: 258 seconds]
Guest6683 has joined #ocaml
KeyJoo has joined #ocaml
mfp has joined #ocaml
bartholin has quit [Remote host closed the connection]
Guest6683 has quit [Read error: Connection reset by peer]
freyr69 has joined #ocaml
Haudegen has joined #ocaml
CcxWrk has quit [Ping timeout: 268 seconds]
ostera has quit [Ping timeout: 272 seconds]
CcxWrk has joined #ocaml
CcxWrk has quit [Ping timeout: 244 seconds]
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ostera has joined #ocaml
nullifidian__ has joined #ocaml
nullifidian_ has quit [Read error: Connection reset by peer]
CcxWrk has joined #ocaml
ostera has quit [Ping timeout: 245 seconds]
ostera has joined #ocaml
zolk3ri has joined #ocaml
jbrown has joined #ocaml
iovec has quit [Quit: Connection closed for inactivity]
ziyourenxiang has joined #ocaml
cthuluh_ is now known as cthuluh
ostera has quit [Ping timeout: 246 seconds]
jao has joined #ocaml
spew has joined #ocaml
Haudegen has quit [Remote host closed the connection]
iovec has joined #ocaml
nullifidian_ has joined #ocaml
zolk3ri has quit [Remote host closed the connection]
zolk3ri has joined #ocaml
nullifidian__ has quit [Ping timeout: 250 seconds]
jao has quit [Ping timeout: 244 seconds]
ggole has joined #ocaml
nikivi has quit [Remote host closed the connection]
nikivi has joined #ocaml
initiumdoeslinux has joined #ocaml
Haudegen has joined #ocaml
FreeBirdLjj has joined #ocaml
freyr69 has quit [Remote host closed the connection]
sagotch has joined #ocaml
nikivi has quit [Quit: ZNC is awesome]
sagotch has quit [Ping timeout: 250 seconds]
sagotch has joined #ocaml
nikivi has joined #ocaml
Jesin has quit [Quit: Leaving]
Jesin has joined #ocaml
zolk3ri has quit [Ping timeout: 256 seconds]
initiumdoeslinux has quit [Remote host closed the connection]
mildtaste has quit [Remote host closed the connection]
zolk3ri has joined #ocaml
recj has quit [Ping timeout: 240 seconds]
jao has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
sagotch has quit [Quit: Leaving.]
FreeBirdLjj has quit [Ping timeout: 246 seconds]
sagotch has joined #ocaml
jao has quit [Disconnected by services]
jao has joined #ocaml
bartholin has joined #ocaml
<
wilfredh>
what's the nicest way to check if a list is empty in ocaml?
<
wilfredh>
let is_empty xs = match xs with | [] -> true | _ -> false
<
wilfredh>
this feels a little verbose
<
wilfredh>
should I use <> or != ?
<
spew>
I usually do lst = []
<
wilfredh>
both `= []` and `== []` seem to work
ygrek has joined #ocaml
<
spew>
depends on what you want
<
spew>
in that case it will be the same, though what you probably "mean" is "= []"
<
wilfredh>
thank you :)
ziyourenxiang has quit [Ping timeout: 252 seconds]
<
spew>
wilfredh: in general just use = unless you know what you are doing
jbrown has quit [Ping timeout: 252 seconds]
JimmyRcom has joined #ocaml
KeyJoo has quit [Quit: KeyJoo]
sagotch has quit [Read error: Connection timed out]
jbrown has joined #ocaml
Haudegen has quit [Remote host closed the connection]
sagotch has joined #ocaml
JimmyRcom has quit [Ping timeout: 246 seconds]
Spetznaz_ has joined #ocaml
Spetznaz_ has quit [Ping timeout: 245 seconds]
Spetznaz_ has joined #ocaml
sagotch has quit [Quit: Leaving.]
ggole has quit [Quit: ggole]
silver has joined #ocaml
Haudegen has joined #ocaml
jnavila has joined #ocaml
JimmyRcom has joined #ocaml
yomimono has joined #ocaml
dmiles has quit [Ping timeout: 246 seconds]
crowley95 has quit [Ping timeout: 246 seconds]
kakadu has quit [Remote host closed the connection]
so has quit [Ping timeout: 246 seconds]
crowley95 has joined #ocaml
so has joined #ocaml
<
def`>
Prefer pattern matching if you can. Just define the is_empty function somewhere ("Utils", "Misc", "MyStd", ... :D)
crowley95 has quit [Ping timeout: 240 seconds]
crowley95 has joined #ocaml
dmiles has joined #ocaml
yomimono has quit [Ping timeout: 252 seconds]
jnavila has quit [Ping timeout: 252 seconds]
crowley95 has quit [Ping timeout: 246 seconds]
crowley95 has joined #ocaml
yomimono has joined #ocaml
jao has quit [Remote host closed the connection]
al-damiri has joined #ocaml
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
JimmyRcom has quit [Ping timeout: 272 seconds]
gravicappa has quit [Ping timeout: 246 seconds]
<
steenuil>
...or just use containers
<
vsiles>
wilfredh: List.length l == 0 works too :D
<
Armael>
don't do that, it takes time proportional to the size of the list :D
jao has joined #ocaml
JimmyRcom has joined #ocaml
kakadu has joined #ocaml
recj has joined #ocaml
<
vsiles>
List.is_empty is usually my choice
<
spew>
def`: you're seriously saying that "match lst with [] -> true | _ -> false" is superior to 'lst = []'?
yomimono has quit [Quit: Lost terminal]
zolk3ri has quit [Remote host closed the connection]
zolk3ri has joined #ocaml
<
spew>
vsiles: where is List.is_empty defined?
<
vsiles>
maybe in one of my libs; I don't remember :D
<
companion_cube>
in Containers, maybe? or Base?
yomimono has joined #ocaml
Serpent7776 has quit [Quit: leaving]
abaiste has quit [Read error: Connection reset by peer]
abaiste has joined #ocaml
abaiste has quit [Max SendQ exceeded]
ygrek has quit [Ping timeout: 246 seconds]
jnavila has joined #ocaml
abaiste has joined #ocaml
abaiste has quit [Max SendQ exceeded]
yomimono has quit [Ping timeout: 244 seconds]
yomimono has joined #ocaml
jnavila has quit [Ping timeout: 246 seconds]
silver has quit [Read error: Connection reset by peer]
yomimono has quit [Ping timeout: 250 seconds]
yomimono has joined #ocaml
zolk3ri has quit [Quit: Lost terminal]
recj has quit [Read error: Connection reset by peer]
recj has joined #ocaml
bartholin has quit [Remote host closed the connection]
ziyourenxiang has joined #ocaml
iovec has quit [Quit: Connection closed for inactivity]