00:02
solrize has joined #ocaml
00:02
solrize has quit [Changing host]
00:02
solrize has joined #ocaml
00:08
sapristi has quit [Remote host closed the connection]
00:08
sapristi has joined #ocaml
00:10
iZsh has quit [Ping timeout: 240 seconds]
00:14
mengu has joined #ocaml
00:23
FreeBirdLjj has quit [Remote host closed the connection]
00:36
jimt_ is now known as jimt
00:37
infinity0 has quit [Ping timeout: 264 seconds]
00:37
infinity0 has joined #ocaml
00:42
malina has quit [Quit: Throwing apples of Montserrat]
00:43
ziyourenxiang has joined #ocaml
00:43
pierpa has quit [Quit: Page closed]
00:43
Haudegen has quit [Read error: Connection reset by peer]
00:46
sillyotter has joined #ocaml
00:46
sillyotter has quit [Client Quit]
01:07
sh0t has quit [Remote host closed the connection]
01:21
spew has joined #ocaml
01:31
sapristi has quit [Remote host closed the connection]
01:32
sapristi has joined #ocaml
01:54
silver has quit [Quit: rakede]
01:59
marsam has joined #ocaml
02:01
jp_ has joined #ocaml
02:03
nomicflux has joined #ocaml
02:07
KeyJoo has quit [Quit: Good luck! Have a nice Day!]
02:08
mengu has quit [Quit: Leaving...]
02:08
iZsh has joined #ocaml
02:09
spew has quit [Read error: Connection reset by peer]
02:15
shinnya has joined #ocaml
02:20
whoman has quit [Read error: Connection reset by peer]
02:27
kerrhau_ has joined #ocaml
02:30
kerrhau_ has quit [Client Quit]
02:54
marsam has quit [Ping timeout: 272 seconds]
02:57
mfp has quit [Ping timeout: 265 seconds]
03:04
sapristi has quit [Remote host closed the connection]
03:04
sapristi has joined #ocaml
03:10
whoman has joined #ocaml
03:16
sapristi has quit [Remote host closed the connection]
03:17
sapristi has joined #ocaml
03:26
shinnya has quit [Ping timeout: 265 seconds]
03:36
ygrek has quit [Ping timeout: 256 seconds]
04:02
solrize has quit [Remote host closed the connection]
04:02
solrize has joined #ocaml
04:03
solrize has joined #ocaml
04:03
solrize has quit [Changing host]
04:09
ahf has quit [Ping timeout: 264 seconds]
04:09
ahf has joined #ocaml
04:18
spew has joined #ocaml
04:21
spew has quit [Read error: Connection reset by peer]
04:21
orbitz has quit [Ping timeout: 248 seconds]
04:24
kerrhau_ has joined #ocaml
04:29
orbitz has joined #ocaml
04:31
jimmyrcom_ has quit [Read error: Connection reset by peer]
04:58
jimmyrcom_ has joined #ocaml
04:59
ziyourenxiang has quit [Ping timeout: 265 seconds]
05:01
sapristi has quit [Remote host closed the connection]
05:01
spew has joined #ocaml
05:01
sapristi has joined #ocaml
05:32
kerrhau_ is now known as kerrhau
05:35
sapristi has quit [Remote host closed the connection]
05:35
sapristi has joined #ocaml
05:36
andreas_ has quit [Quit: Connection closed for inactivity]
05:36
andreas__ has quit [Quit: Connection closed for inactivity]
05:40
spew has quit [Read error: Connection reset by peer]
05:46
shinnya has joined #ocaml
05:55
ousado has quit [Remote host closed the connection]
05:55
ousado has joined #ocaml
06:25
raphaelss has joined #ocaml
06:30
nomicflux has quit [Quit: nomicflux]
06:49
enterprisey has joined #ocaml
07:02
KeyJoo has joined #ocaml
07:44
sapristi has quit [Remote host closed the connection]
07:45
sapristi has joined #ocaml
08:03
slash^ has joined #ocaml
08:06
rostero has quit [Quit: Connection closed for inactivity]
08:11
ziyourenxiang has joined #ocaml
08:22
sapristi has quit [Remote host closed the connection]
08:23
sapristi has joined #ocaml
08:45
madroach has quit [Quit: leaving]
08:48
madroach has joined #ocaml
08:48
madroach has quit [Read error: Connection reset by peer]
08:54
madroach has joined #ocaml
09:07
cbot has quit [Quit: Leaving]
09:15
sapristi has quit [Remote host closed the connection]
09:15
sapristi has joined #ocaml
09:24
nicoo has quit [Remote host closed the connection]
09:25
nicoo has joined #ocaml
09:33
donflopez has joined #ocaml
09:47
aubian has quit [Ping timeout: 264 seconds]
09:59
aubian has joined #ocaml
10:00
Fardale has quit [Quit: Fardale]
10:00
tobiasBora has quit [Quit: WeeChat 1.6]
10:00
aubian has quit [Client Quit]
10:07
argent_smith has joined #ocaml
10:14
<
companion_cube >
SpaceSheep: the context contains parameters
10:14
<
companion_cube >
like, verbosity, etc.
10:14
<
companion_cube >
you can also create your own parameters for the CLI interface to parse
10:16
enterprisey has quit [Remote host closed the connection]
10:20
heisenberg has joined #ocaml
10:20
<
heisenberg >
Good Morning
10:21
<
companion_cube >
o/
10:24
jnavila has joined #ocaml
10:31
enterprisey has joined #ocaml
10:35
donflopez has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
11:02
mfp has joined #ocaml
11:16
Fardale has joined #ocaml
11:20
<
Drup >
heisenberg: there is no else in your last if
11:23
Anarchos has joined #ocaml
11:24
andreas__ has joined #ocaml
11:25
argent_smith1 has joined #ocaml
11:27
argent_smith has quit [Ping timeout: 264 seconds]
11:31
silver has joined #ocaml
11:36
jnavila has quit [Ping timeout: 240 seconds]
11:37
jnavila has joined #ocaml
11:38
<
heisenberg >
Drup I'm a genius
11:41
Anarchos has quit [Quit: Vision[0.10.2]: i've been blurred!]
11:57
_whitelogger has joined #ocaml
12:03
Fardale has quit [Ping timeout: 240 seconds]
12:04
enterprisey has quit [Remote host closed the connection]
12:28
sapristi has quit [Remote host closed the connection]
12:28
sapristi has joined #ocaml
12:53
igarnier has joined #ocaml
12:53
<
igarnier >
Hi everyone!
13:05
moei has joined #ocaml
13:07
Haudegen has joined #ocaml
13:17
nicoo has quit [Remote host closed the connection]
13:18
nicoo has joined #ocaml
13:28
mengu has joined #ocaml
13:33
nullifidian__ has quit [Read error: Connection reset by peer]
13:33
nullifidian_ has joined #ocaml
13:37
jnavila has quit [Ping timeout: 240 seconds]
13:38
kerrhau has quit [Ping timeout: 265 seconds]
13:45
Fardale has joined #ocaml
13:52
marsam has joined #ocaml
14:06
igarnier has quit [Quit: Page closed]
14:24
marsam has quit [Ping timeout: 240 seconds]
14:42
mengu has quit [Remote host closed the connection]
14:49
Haudegen has quit [Remote host closed the connection]
15:13
sapristi has quit [Remote host closed the connection]
15:13
sapristi has joined #ocaml
15:24
jnavila has joined #ocaml
15:27
shinnya has quit [Ping timeout: 240 seconds]
15:38
kerrhau has joined #ocaml
15:46
zmt00 has quit [Quit: Leaving]
15:49
marsam has joined #ocaml
15:53
andreas__ has quit [Quit: Connection closed for inactivity]
15:54
sapristi has quit [Remote host closed the connection]
15:55
sapristi has joined #ocaml
16:12
spew has joined #ocaml
16:18
nomicflux has joined #ocaml
16:23
nicoo has quit [Remote host closed the connection]
16:23
nicoo has joined #ocaml
16:27
mengu has joined #ocaml
16:32
mengu has quit [Ping timeout: 264 seconds]
16:40
nomicflux has quit [Quit: nomicflux]
16:50
sapristi has quit [Remote host closed the connection]
16:50
sapristi has joined #ocaml
16:54
nicoo has quit [Remote host closed the connection]
16:54
nicoo has joined #ocaml
16:58
spew has quit [Ping timeout: 248 seconds]
17:02
sapristi has quit [Remote host closed the connection]
17:03
sapristi has joined #ocaml
17:05
marsam has quit [Ping timeout: 240 seconds]
17:10
sapristi has quit [Ping timeout: 256 seconds]
17:11
kakadu has joined #ocaml
17:15
<
heisenberg >
anyone can help me with n-trees ?
17:27
heisenberg has quit [Quit: Lost terminal]
17:29
spew has joined #ocaml
17:43
jnavila has quit [Ping timeout: 272 seconds]
17:50
malc_ has joined #ocaml
17:56
tsani has joined #ocaml
17:58
sapristi has joined #ocaml
18:08
Anarchos has joined #ocaml
18:09
heisenberg has joined #ocaml
18:10
<
heisenberg >
Hi, it's anybody there?
18:12
<
companion_cube >
hi
18:13
sapristi has quit [Remote host closed the connection]
18:13
sapristi has joined #ocaml
18:14
<
heisenberg >
companion_cube hi
18:15
<
heisenberg >
do you know if there's a good source to learn how to deal with n-trees ?
18:15
<
companion_cube >
what do you want to do with n-trees?
18:16
<
heisenberg >
companion_cube nothing special, I'm learning.
18:16
<
companion_cube >
(you mean `type 'a tree = Leaf of 'a | Node of 'a tree list`?)
18:17
<
heisenberg >
type 'a ntree = Tr of 'a * 'a ntree list
18:17
<
heisenberg >
it's a leaf when the list is empty ofc
18:17
<
companion_cube >
right
18:17
<
companion_cube >
that works too
18:18
<
heisenberg >
I'm trying some exercises but looks difficult for me
18:18
<
companion_cube >
I won't solve your exercise for you, but I can try to help ;)
18:18
<
heisenberg >
is there any source to learn how to work on that structure, expecially using mutual recursion ?
18:19
<
companion_cube >
not particularly, it's "normal" recursion
18:19
<
companion_cube >
what are you trying to do?
18:19
<
companion_cube >
(you'd have to mutually recurse on trees and on lists of trees, indeed)
18:20
<
heisenberg >
nothing in particular actually, since I'm not able to do anything yet
18:20
<
heisenberg >
yeah exactly, that should be the easiest way.
18:20
<
companion_cube >
well, try to find if an element is in the tree, or try to mirror the tree
18:20
<
companion_cube >
these are relatively easy :)
18:20
<
heisenberg >
what does mirror mean?
18:21
<
companion_cube >
like a vertical symmetry :)
18:21
<
companion_cube >
look the tree in the mirror, somehow
18:25
<
heisenberg >
you mean if 'a is an int, to put the elements in a list following a certain order?
18:25
<
heisenberg >
actually for me is a nightmare even to count nodes in that kind of struct
18:26
<
heisenberg >
may you redirect me to a good source where it's explained ? (even a yt video would be ok for me I guess)
18:27
<
companion_cube >
I can show you a simple example
18:27
<
companion_cube >
to count nodes, e.g.
18:27
<
heisenberg >
companion_cube there's no need to
18:28
<
companion_cube >
let rec count (t:_ tree) : int = match t with Tr (_, l) -> 1 + count_list l and count_list = function [] -> 0 | t :: tail -> count t + count_list tail
18:28
<
heisenberg >
I already have some examples like this one, but I need to understand really where how mutual recursion works somehow
18:30
<
companion_cube >
you can try to #trace count;; #trace count_list;; count (Tr (1, [Tr (2, []); Tr (3,[])]));;
18:30
<
companion_cube >
(or bigger trees)
18:30
<
heisenberg >
tell me if is correct to think in that way:
18:30
<
companion_cube >
to see what's going on and understand these functions
18:31
<
heisenberg >
uhm, is not easy to explain what I'm thinking, give me a sec
18:34
<
heisenberg >
I mean, the first function should do smthg on the element, and call the function (2nd one) for the list
18:34
<
heisenberg >
while, the 2nd one should call the 1st function on each element, and call itself on the next element of the list
18:34
<
companion_cube >
yep
18:34
<
companion_cube >
that's what the functions I wrote above do
18:34
<
companion_cube >
(except the element is ignored)
18:35
<
companion_cube >
you can try to adapt it to compute the sum of the elements of an `int tree`
18:35
<
heisenberg >
it's that ALWAYS correct ? (of course if I need to find smth I would stop once found, if that happens... I mean generally if that way of thinking should work)
18:35
kakadu has quit [Ping timeout: 240 seconds]
18:36
kakadu_ has joined #ocaml
18:36
<
companion_cube >
sometimes you can avoid recursing on the list's tail
18:36
<
companion_cube >
if you're looking for an element, and you found it in the head of the list (the first tree), no need to continue
18:39
nullifidian__ has joined #ocaml
18:42
nullifidian_ has quit [Ping timeout: 248 seconds]
18:44
<
malc_ >
heisenberg: "and count_lst" (i.e. not without let rec)
18:44
<
companion_cube >
the second `let rec` is wrong
18:44
<
companion_cube >
also, you miss the `[]` case
18:45
<
companion_cube >
[] -> … | el::rest -> …
18:46
<
heisenberg >
that one "compiles"
18:46
<
heisenberg >
but does it work ?
18:47
<
heisenberg >
what if I put "1 + .." after el::rest, and just count_lst after Tr case ?
18:47
kerrhau has quit [Ping timeout: 264 seconds]
18:48
kerrhau has joined #ocaml
18:48
kerrhau has quit [Changing host]
18:48
kerrhau has joined #ocaml
18:49
<
companion_cube >
well it should work
18:49
<
companion_cube >
try it out
18:50
sh0t has joined #ocaml
18:51
<
heisenberg >
in both cases ?
18:52
<
companion_cube >
depends on what you want to count
18:52
mk9 has joined #ocaml
18:53
solrize has quit [Ping timeout: 265 seconds]
18:53
<
heisenberg >
the total number of nodes
18:53
<
heisenberg >
in both cases...
18:54
<
companion_cube >
you should probably have only one `1+…`
18:54
<
companion_cube >
really, try to run this on some examples in utop
18:54
<
companion_cube >
(possibly with `#trace count;;` and `#trace count_list;;` first)
18:55
<
heisenberg >
I'm about to try but I never used trace
18:56
<
heisenberg >
yeah ofc the 1+ is only in one place
18:56
<
companion_cube >
I'm off to dinner, good luck
18:56
<
heisenberg >
I wanted to know if there's a difference between putting it in one function or the other
18:56
<
heisenberg >
thanks :)
18:56
<
companion_cube >
but try it out in utop, you'll see
18:56
<
companion_cube >
not much of a difference in this case
18:57
heisenberg has quit [Quit: leaving]
18:58
zolk3ri has quit [Remote host closed the connection]
18:59
zolk3ri has joined #ocaml
19:00
solrize has joined #ocaml
19:00
solrize has quit [Changing host]
19:00
solrize has joined #ocaml
19:23
sapristi_ has joined #ocaml
19:23
iCharlie has joined #ocaml
19:24
sapristi has quit [Read error: Connection reset by peer]
19:32
andreas__ has joined #ocaml
19:52
Jesin has joined #ocaml
20:25
heisenberg has joined #ocaml
20:25
<
heisenberg >
Hi, is anybody there ?
20:25
<
octachron >
Probably
20:27
<
heisenberg >
anyone may help me with trees? :\
20:27
spew has quit [Ping timeout: 240 seconds]
20:37
<
Leonidas >
heisenberg: that's rather unconcrete?
20:38
<
Leonidas >
have you tried /r/trees on reddit?
20:43
<
reynir >
Dunno if you get this Danish joke: "ingen cykler i træet"
20:44
<
Leonidas >
reynir: yep, a beautiful example of a b-tree, thanks.
20:44
<
Leonidas >
(bicycle-tree)
20:44
jnavila has joined #ocaml
20:48
<
heisenberg >
Leonidas not binary, the follwing struct ---> type 'a ntree = Tr of 'a * 'a ntree list
20:53
mk9 has quit [Quit: mk9]
21:07
heisenberg has quit [Quit: leaving]
21:07
mk9 has joined #ocaml
21:15
webshinra has quit [Remote host closed the connection]
21:20
webshinra has joined #ocaml
21:42
raphaelss has quit [Ping timeout: 256 seconds]
21:50
sapristi has joined #ocaml
21:50
sapristi_ has quit [Ping timeout: 248 seconds]
21:52
kakadu_ has quit [Remote host closed the connection]
21:52
slash^ has quit [Read error: Connection reset by peer]
22:04
jnavila has quit [Ping timeout: 264 seconds]
22:17
malc_ has quit [Quit: ERC (IRC client for Emacs 25.0.50.2)]
22:23
pierpa has joined #ocaml
22:23
spew has joined #ocaml
22:30
spew has quit [Ping timeout: 240 seconds]
22:30
cbot has joined #ocaml
22:51
spew has joined #ocaml
22:52
Anarchos has quit [Quit: Vision[0.10.2]: i've been blurred!]
23:21
argent_smith1 has quit [Quit: Leaving.]
23:21
sapristi has quit [Remote host closed the connection]
23:21
sapristi_ has joined #ocaml
23:23
andreas__ has quit [Quit: Connection closed for inactivity]
23:30
zolk3ri has quit [Quit: leaving]
23:42
Jesin has quit [Ping timeout: 248 seconds]
23:42
sh0t has quit [Ping timeout: 256 seconds]
23:51
pmetzger has joined #ocaml