00:02
infinity0_ has joined #ocaml
00:03
infinity0_ has quit [Changing host]
00:03
infinity0 has quit [Killed (verne.freenode.net (Nickname regained by services))]
00:03
infinity0 has joined #ocaml
00:06
ryanartecona has joined #ocaml
00:18
FreeBirdLjj has joined #ocaml
00:21
ryanartecona_ has joined #ocaml
00:22
ryanartecona has quit [Ping timeout: 248 seconds]
00:22
ryanartecona_ is now known as ryanartecona
00:23
FreeBirdLjj has quit [Ping timeout: 240 seconds]
00:34
jlam has quit [Ping timeout: 240 seconds]
00:34
jlam has joined #ocaml
00:42
pierpa has quit [Quit: Page closed]
00:43
ziyourenxiang has joined #ocaml
00:53
silver has quit [Read error: Connection reset by peer]
00:55
copy_ has quit [Quit: Connection closed for inactivity]
00:56
ryanartecona has quit [Quit: ryanartecona]
01:18
iitalics has quit [Quit: /thread]
01:19
FreeBirdLjj has joined #ocaml
01:22
malina has quit [Read error: Connection reset by peer]
01:24
FreeBirdLjj has quit [Ping timeout: 248 seconds]
02:02
ygrek has quit [Ping timeout: 248 seconds]
02:15
_whitelogger has joined #ocaml
02:17
mfp__ has quit [Ping timeout: 248 seconds]
02:19
ziyourenxiang has quit [Ping timeout: 240 seconds]
02:20
FreeBirdLjj has joined #ocaml
02:25
FreeBirdLjj has quit [Ping timeout: 255 seconds]
02:25
kalio has quit [Quit: WeeChat 1.9]
02:58
sh0t has quit [Ping timeout: 240 seconds]
03:20
bombastus has joined #ocaml
03:21
FreeBirdLjj has joined #ocaml
03:28
FreeBirdLjj has quit [Ping timeout: 260 seconds]
03:36
ziyourenxiang has joined #ocaml
03:51
_whitelogger has joined #ocaml
04:21
MercurialAlchemi has joined #ocaml
04:24
FreeBirdLjj has joined #ocaml
04:29
FreeBirdLjj has quit [Ping timeout: 240 seconds]
04:37
iitalics has joined #ocaml
04:41
jlam_ has joined #ocaml
04:42
jlam1 has joined #ocaml
04:43
jlam has quit [Ping timeout: 268 seconds]
04:45
jlam_ has quit [Ping timeout: 248 seconds]
05:09
bombastus has quit [Ping timeout: 258 seconds]
05:12
glnerd has joined #ocaml
05:25
FreeBirdLjj has joined #ocaml
05:30
FreeBirdLjj has quit [Ping timeout: 260 seconds]
05:32
FreeBirdLjj has joined #ocaml
05:35
samrat has joined #ocaml
05:40
jao has quit [Ping timeout: 260 seconds]
05:49
iitalics has quit [Quit: /thread]
07:03
moei has quit [Quit: Leaving...]
07:05
argent_smith has joined #ocaml
07:13
enterprisey has joined #ocaml
07:23
argent_smith has quit [Quit: Leaving.]
07:27
samrat has quit [Ping timeout: 276 seconds]
07:30
argent_smith has joined #ocaml
07:38
samrat has joined #ocaml
07:39
argent_smith has quit [Quit: Leaving.]
07:41
al-damiri has quit [Quit: Connection closed for inactivity]
07:43
glnerd has quit [Quit: Leaving]
07:52
moei has joined #ocaml
08:09
samrat has quit [Ping timeout: 248 seconds]
08:15
Algebr has quit [Ping timeout: 248 seconds]
08:31
enterprisey has quit [Remote host closed the connection]
08:45
samrat has joined #ocaml
09:00
andreas_ has joined #ocaml
09:45
slash^ has joined #ocaml
09:49
mfp__ has joined #ocaml
10:03
ziyourenxiang has quit [Ping timeout: 240 seconds]
10:16
freusque has joined #ocaml
10:27
TheLemonMan has joined #ocaml
10:34
fraggle_ has quit [Ping timeout: 240 seconds]
10:34
fraggle-boate has quit [Ping timeout: 248 seconds]
10:36
fraggle_ has joined #ocaml
10:37
fraggle-boate has joined #ocaml
10:49
samrat has quit [Ping timeout: 248 seconds]
10:50
sepp2k has joined #ocaml
10:56
freusque has quit [Ping timeout: 240 seconds]
11:03
_whitelogger has joined #ocaml
11:10
FreeBirdLjj has quit [Remote host closed the connection]
11:11
FreeBirdLjj has joined #ocaml
11:15
FreeBirdLjj has quit [Ping timeout: 240 seconds]
11:16
samrat has joined #ocaml
11:31
cranmax has joined #ocaml
11:34
sz0 has quit [Quit: Connection closed for inactivity]
11:54
sepp2k has quit [Ping timeout: 248 seconds]
12:09
sepp2k has joined #ocaml
12:20
fraggle-boate has quit [Ping timeout: 276 seconds]
12:22
fraggle-boate has joined #ocaml
12:23
freusque has joined #ocaml
12:26
ziyourenxiang has joined #ocaml
12:31
jlam has joined #ocaml
12:32
slash^ has quit [Read error: Connection reset by peer]
12:34
jlam1 has quit [Ping timeout: 240 seconds]
12:48
freusque has quit [Quit: WeeChat 1.7.1]
12:53
sh0t has joined #ocaml
13:03
_aux_ has joined #ocaml
13:12
esel has joined #ocaml
13:17
jlam_ has joined #ocaml
13:18
jlam has quit [Ping timeout: 276 seconds]
13:24
jlam has joined #ocaml
13:24
jlam_ has quit [Ping timeout: 240 seconds]
13:24
jlam_ has joined #ocaml
13:28
jlam has quit [Ping timeout: 258 seconds]
13:41
_aux_ has left #ocaml [#ocaml]
13:43
sh0t has quit [Ping timeout: 268 seconds]
13:48
spew has joined #ocaml
13:54
freusque has joined #ocaml
14:00
samrat has quit [Ping timeout: 248 seconds]
14:01
FreeBirdLjj has joined #ocaml
14:03
andreas_ has quit [Quit: Connection closed for inactivity]
14:08
jlam has joined #ocaml
14:10
jlam_ has quit [Ping timeout: 258 seconds]
14:17
robertc`` has joined #ocaml
14:28
spew has quit [Ping timeout: 260 seconds]
14:29
spew has joined #ocaml
14:31
nomicflux has joined #ocaml
14:33
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
14:35
sepp2k has quit [Quit: Leaving.]
14:36
jlam_ has joined #ocaml
14:39
jlam has quit [Ping timeout: 255 seconds]
14:40
freusque has quit [Ping timeout: 255 seconds]
14:42
spew has quit [Ping timeout: 248 seconds]
14:43
spew has joined #ocaml
14:51
freusque has joined #ocaml
14:51
spew has quit [Ping timeout: 240 seconds]
14:58
nomicflux has quit [Quit: nomicflux]
15:08
FreeBirdLjj has quit [Read error: Connection reset by peer]
15:09
FreeBirdLjj has joined #ocaml
15:19
silver has joined #ocaml
15:30
freusque has quit [Quit: WeeChat 1.7.1]
15:32
jnavila has joined #ocaml
16:18
spew has joined #ocaml
16:36
sepp2k has joined #ocaml
16:38
samrat has joined #ocaml
16:45
robertc`` has quit [Ping timeout: 240 seconds]
16:49
sh0t has joined #ocaml
16:50
spew has quit [Ping timeout: 260 seconds]
16:59
nanoz has joined #ocaml
17:01
<
nanoz >
Lists and arrays are predefined data structures, for example you can have a list of integers:
17:01
<
nanoz >
[ 42; 1; 55 ]
17:01
<
nanoz >
its semicolon to seperate ?
17:02
<
Fardale >
For list it is like : [2;34;1]
17:02
<
artart78 >
yes semicolon, with commas it'd be an array of one element which is a tuple
17:02
<
Fardale >
[42,1,55] is a list of tuple [(42,1,55)]
17:03
<
nanoz >
[|"John"; "Doe"|] what is this ?
17:04
<
xa0 >
an array of strings
17:04
<
xa0 >
with John and Doe as elements
17:04
<
artart78 >
woops I said a mistake, list not array
17:06
<
nanoz >
["John"; "Doe"] is this fine
17:07
sz0 has joined #ocaml
17:07
<
xa0 >
that's a list of strings
17:08
<
nanoz >
[|"John"; "Doe"|] this is array of strings ?
17:09
<
nanoz >
what is the difference b/w list and arrays ? why didnt ocaml have just array ?
17:12
<
Armael >
they are different structures, and you can do different things with them
17:13
<
Armael >
(this may be surprising if you come from python and are used to the "one structure for all needs")
17:13
<
Armael >
eg with arrays you can access to any element in constant time given its index
17:13
<
Armael >
but extending an array requires allocating a new one and copying the elements of the old one
17:14
<
Armael >
with lists, you can add elements in front in constant time without any copying
17:14
<
Armael >
but you need to walk through the list if you want to access the nth element, for example
17:14
<
Armael >
also, lists are immutable data structures while arrays are mutable
17:15
spew has joined #ocaml
17:17
ryanartecona has joined #ocaml
17:18
ziyourenxiang has quit [Ping timeout: 260 seconds]
17:28
<
nanoz >
isnt arrays are immutable ?
17:29
<
Armael >
arrays are mutable
17:30
<
Armael >
let a = [|1;2|] in a.(0) <- 15; a
17:30
<
Armael >
a.(i) <- foo writes foo at index i of array a
17:31
<
nanoz >
you can replace the head element of a list too
17:32
<
Armael >
not really, what you can do is constructing a new list with a different head element
17:32
<
Armael >
but the previous list will still exist
17:33
andreas_ has joined #ocaml
17:33
<
Armael >
let a = [1;2;3] in
17:33
<
Armael >
let b = 15 :: (List.tl a) in
17:34
<
Armael >
this returns ([1;2;3], [15; 2; 3])
17:34
<
Armael >
b is just a new list composed of 15 followed by the "tail" of a
17:38
<
nanoz >
List.hd [1; 2; 3] is to get head, how to get middle element
17:38
esel has quit [Ping timeout: 260 seconds]
17:38
<
nanoz >
List.tl [1; 2; 3]
17:39
<
Armael >
the best is to use pattern matching to destruct a list
17:39
<
Armael >
List.hd / List.tl should be used with care since they can fail (and raise an exception) if the list is empty
17:39
<
Armael >
while pattern matching will ensure you handle all cases
17:40
<
orbifx[m] >
look at `nth` function
17:40
<
nanoz >
why ocaml is weird ; let foo = [1,2,3]; foo[1] /// is far easy
17:40
<
orbifx[m] >
nanoz: because OCaml isn't weir :)
17:41
<
Armael >
accessing an element by its index is not a primitive operation on lists: it has to walk the list
17:46
iitalics has joined #ocaml
17:48
copy_ has joined #ocaml
17:49
samrat has quit [Ping timeout: 260 seconds]
17:50
<
nanoz >
a high level language should be extremely friendly
17:51
jlam_ has quit [Ping timeout: 240 seconds]
17:51
jlam has joined #ocaml
17:53
iitalics has quit [Remote host closed the connection]
17:53
ryanartecona has quit [Quit: ryanartecona]
17:54
sh0t has quit [Ping timeout: 240 seconds]
17:56
jnavila has quit [Ping timeout: 255 seconds]
17:56
iitalics has joined #ocaml
17:56
<
nanoz >
by the way i'm from js world :) ((f)=>{f('hello world')})(alert)
17:58
<
nanoz >
as i'm unable to crack in haskell , ocaml is the place i started to learn fp
17:59
<
thizanne >
(fun f -> f "hello world) print_string
17:59
<
thizanne >
doesnt seem much less friendly
18:00
<
thizanne >
you have a "weird" feeling because you're used to languages that basically all work the same
18:00
<
thizanne >
ocaml makes you think differently, which isnt bad but is disturbing at first
18:01
<
thizanne >
just keep practicing until the pieces of the puzzle fit together
18:01
iitalics has quit [Remote host closed the connection]
18:03
<
nanoz >
by the way i was choosing good place to learn / start with FP
18:05
AlexRussia has joined #ocaml
18:05
<
nanoz >
which is used most in production is it scala or ocaml ?
18:06
iitalics has joined #ocaml
18:06
AlexRussia_ has joined #ocaml
18:08
AlexRussia_ has quit [Client Quit]
18:09
<
Leonidas >
didn't xmlm have a mode to directly parse xml into a tree?
18:09
AlexRussia has quit [Ping timeout: 240 seconds]
18:10
<
Leonidas >
nanoz: depends on where you ask. We use 0 Scala in production and >0 OCaml, so /clearly/ Ocaml is used more :p
18:11
<
Leonidas >
nanoz: accessing lists by index is also something that is not done very often in fp code. Fortunately, since that leads to off-by-ones and complicated logic.
18:15
<
nanoz >
1 more do startup company use Ocaml ?
18:18
shinnya has quit [Ping timeout: 248 seconds]
18:20
argent_smith has joined #ocaml
18:22
nanoz has quit [Quit: <3]
18:31
jnavila has joined #ocaml
18:42
<
_y >
just why python people deemed calling their arrays “lists” was a good idea :-(
18:57
tane has joined #ocaml
19:07
zv has quit [Quit: WeeChat 1.7.1]
19:15
maarhart has joined #ocaml
19:19
maarhart has quit [Remote host closed the connection]
19:21
zv has joined #ocaml
19:22
shinnya has joined #ocaml
19:31
jlam has quit [Ping timeout: 255 seconds]
19:31
sh0t has joined #ocaml
19:31
jlam has joined #ocaml
19:32
shinnya has quit [Ping timeout: 260 seconds]
19:35
jlam_ has joined #ocaml
19:35
jlam has quit [Ping timeout: 240 seconds]
19:42
jnavila has quit [Remote host closed the connection]
19:44
ryanartecona has joined #ocaml
19:45
jlam has joined #ocaml
19:47
jlam_ has quit [Ping timeout: 240 seconds]
19:50
jnavila has joined #ocaml
19:54
kakadu has joined #ocaml
20:02
MercurialAlchemi has quit [Remote host closed the connection]
20:11
jlam_ has joined #ocaml
20:11
iitalics has quit [Remote host closed the connection]
20:11
iitalics has joined #ocaml
20:13
jlam has quit [Ping timeout: 260 seconds]
20:13
jlam has joined #ocaml
20:15
jlam_ has quit [Ping timeout: 240 seconds]
20:24
jnavila has quit [Remote host closed the connection]
20:27
tane has quit [Quit: Leaving]
20:31
iitalics has quit [Quit: /thread]
20:38
iitalics has joined #ocaml
20:50
<
reynir >
Ugh, I'm tired of json web apis that return more or less fields than specified
20:54
ryanartecona has quit [Quit: ryanartecona]
20:55
iitalics has quit [Quit: /thread]
20:58
spew has quit [Ping timeout: 255 seconds]
21:04
ygrek has joined #ocaml
21:19
<
dxtr >
Hmm, can Core handle unicode?
21:24
sh0t has quit [Ping timeout: 260 seconds]
21:26
argent_smith has quit [Quit: Leaving.]
21:32
<
octachron >
dxtr, it depends a lot on what you mean by "handle" unicode
21:32
<
octachron >
having strings containing unicode data would be fine with core (or even the stdlib)
21:35
<
octachron >
manipulating strings in a unicode-aware way is (like often) more complicated (see the various uus… library by Daniel Bünzli for instance, or camomille)
22:29
<
dxtr >
Is there something like lisps property lists?
22:35
<
octachron >
dxtr, yes and no? If the type of values are homogeneous, there is the Map and Hashtbl modules
22:36
<
octachron >
otherwise the encoding is more complicated, universal map can play this role, there is a corresponding module in Core as far as I remember
22:43
andreas_ has quit [Quit: Connection closed for inactivity]
23:01
<
dxtr >
I realized I can just create a data type for what I want :)
23:01
<
orbifx[m] >
How related are FP Monads to Leibniz monads? Anyone seen references in papers?
23:01
<
orbifx[m] >
dxtr: nice :)
23:07
<
octachron >
orbifx[m], they are mostly homographs (I imagine that with enough effort one could discover a filliation but it would be very artificial)
23:09
jlam_ has joined #ocaml
23:10
<
orbifx[m] >
I remember reading something on this Quora. I think there was some amount of inspiration. Wondered if anyone here has looked into it
23:10
jlam1 has joined #ocaml
23:10
jlam has quit [Ping timeout: 260 seconds]
23:14
jlam_ has quit [Ping timeout: 248 seconds]
23:17
pierpa has joined #ocaml
23:28
copy_ has quit [Quit: Connection closed for inactivity]
23:35
sh0t has joined #ocaml
23:39
kakadu has quit [Remote host closed the connection]
23:41
jlam1 has quit [Ping timeout: 240 seconds]