00:01
barcabuona has quit [Ping timeout: 248 seconds]
00:17
ygrek has quit [Ping timeout: 248 seconds]
00:18
sh0t has joined #ocaml
00:44
orbifx has quit [Ping timeout: 250 seconds]
00:49
snhmib has quit [Ping timeout: 268 seconds]
00:50
gpietro has joined #ocaml
00:50
sh0t has quit [Ping timeout: 255 seconds]
00:53
enterprisey has quit [Read error: Connection reset by peer]
00:53
sh0t has joined #ocaml
00:54
gpietro has quit [Ping timeout: 268 seconds]
00:56
gpietro has joined #ocaml
00:58
sh0t has quit [Ping timeout: 250 seconds]
01:05
aciniglio has quit [Ping timeout: 248 seconds]
01:23
jao has quit [Ping timeout: 240 seconds]
01:27
ziyourenxiang has joined #ocaml
01:29
jao has joined #ocaml
01:31
zolk3ri has quit [Remote host closed the connection]
01:40
malina has quit [Quit: Throwing apples of Montserrat]
01:58
jao has quit [Ping timeout: 248 seconds]
01:59
silver has quit [Read error: Connection reset by peer]
02:05
wxyzzyrd has joined #ocaml
02:21
kerrhau has quit [Read error: Connection reset by peer]
02:22
kerrhau has joined #ocaml
02:23
rossberg has quit [Ping timeout: 255 seconds]
02:26
mfp has quit [Ping timeout: 248 seconds]
02:28
zv has joined #ocaml
02:29
jmsaunde has left #ocaml [#ocaml]
02:32
<
wxyzzyrd >
Is #ocaml dead?
02:34
rossberg has joined #ocaml
02:37
jmiven has quit [Quit: co'o]
02:38
jmiven has joined #ocaml
02:47
p1n34ppl3 has quit [Quit: Lost terminal]
02:49
<
whoman >
ppl busy being productive. talk about ocaml
02:52
cobreadmonster has joined #ocaml
03:31
shinnya has joined #ocaml
04:00
aciniglio has joined #ocaml
04:05
aciniglio has quit [Ping timeout: 260 seconds]
04:08
pierpa has quit [Quit: Page closed]
05:21
raphaelss has joined #ocaml
05:55
kerrhau has quit [Ping timeout: 268 seconds]
06:07
infinity0_ has joined #ocaml
06:07
infinity0_ has quit [Changing host]
06:07
infinity0_ has joined #ocaml
06:07
infinity0 is now known as Guest57
06:07
Guest57 has quit [Killed (tolkien.freenode.net (Nickname regained by services))]
06:07
infinity0_ is now known as infinity0
06:19
wxyzzyrd has quit [Ping timeout: 248 seconds]
06:20
spew has joined #ocaml
06:27
jbrown has quit [Ping timeout: 260 seconds]
06:42
cobreadmonster has quit [Quit: Connection closed for inactivity]
06:43
gpietro has quit [Remote host closed the connection]
07:04
FreeBirdLjj has joined #ocaml
07:14
spew has quit [Read error: Connection reset by peer]
07:23
aciniglio has joined #ocaml
07:31
aciniglio has quit [Ping timeout: 240 seconds]
07:38
aciniglio has joined #ocaml
07:38
aciniglio has quit [Remote host closed the connection]
07:47
greyfacenospace has joined #ocaml
07:47
<
greyfacenospace >
hello
07:48
slash^ has joined #ocaml
07:51
snhmib has joined #ocaml
07:53
<
greyfacenospace >
i have a question
07:55
<
greyfacenospace >
the last function tail
07:56
<
greyfacenospace >
currently has this val: val tail : 'a t -> 'a t t option = <fun>
07:56
<
greyfacenospace >
i want it to have val tail : 'a t -> 'a t option = <fun>
07:56
<
greyfacenospace >
how can i change my function?
08:02
<
tane >
GreyFaceNoSpace, what's this second match in tail p for?
08:03
<
tane >
you're constructing "Nil" with y, which has type 'a t already, yielding 'a t t
08:03
<
tane >
why not just make it |Cons(x,y) -> Some(y)
08:04
<
greyfacenospace >
in the second match?
08:04
<
tane >
skip the second match completely
08:04
<
tane >
the second part of a "Cons" is already 'a t
08:05
<
greyfacenospace >
oh ok, the reason i added the second match was so that i return none if the list has one element
08:06
enterprisey has joined #ocaml
08:09
<
greyfacenospace >
tane, your suggestion makes the function have to correct val , however its not working as intended.
08:09
<
greyfacenospace >
tane, sorry i'm still learning ocaml
08:09
<
tane >
GreyFaceNoSpace, what is your intention?
08:10
<
greyfacenospace >
tane, i want it so that if i get Nil (a) as input i return None. otherwise i return the last Nil in the input
08:11
<
greyfacenospace >
example: tail (Cons(1,Cons (2,Nil 3))) should return Nil(3)
08:11
<
greyfacenospace >
tail Nil(3) should return None
08:11
<
tane >
then it's along Cons(x,y) -> tail y
08:12
<
tane >
well, I see the problem
08:12
<
greyfacenospace >
tane, no this is the reason i did the second match
08:12
<
greyfacenospace >
if i get Nil in the first recursive call
08:12
<
greyfacenospace >
i return None
08:12
<
tane >
I'd recommend splitting this
08:13
<
greyfacenospace >
in to two functions?
08:13
<
tane >
build one function that simply returns the LAST Nil
08:13
<
tane >
you can call this then, instead of the second match
08:13
<
greyfacenospace >
oh
08:14
<
greyfacenospace >
good idea
08:14
<
greyfacenospace >
thanks
08:21
<
greyfacenospace >
this is what i tried
08:22
<
tane >
it does not compile, right?
08:22
<
greyfacenospace >
no it doesn't
08:22
<
tane >
have a look at function `tail` and see whether all branches return the same type
08:23
<
greyfacenospace >
first branch returns an option (None) second one returns a Nil
08:23
<
tane >
btw, you don't need parenthesis for function application unless you need to group arguments
08:23
<
tane >
GreyFaceNoSpace, that doesn't see right then
08:24
<
tane >
Nil is not of type 'a option
08:24
<
greyfacenospace >
should i right |Cons(x,y)-> Some(tailHelp y)
08:24
<
greyfacenospace >
yea Nil is not an option
08:25
<
greyfacenospace >
Thank you very much!
08:25
<
greyfacenospace >
it works now
08:25
<
greyfacenospace >
quick question. is there a friendly debugger for ocaml?
08:25
<
greyfacenospace >
currently i am using atom + utop
08:27
<
tane >
hm, I don't know, there's ocamldebug, but I don't know how whether there are nice interfaces
08:39
madroach has quit [Read error: Connection reset by peer]
08:41
snhmib has quit [Ping timeout: 255 seconds]
08:42
zmt00 has quit [Quit: Leaving]
08:44
madroach has joined #ocaml
08:46
snhmib has joined #ocaml
09:09
donflopez has joined #ocaml
09:10
donflopez has quit [Client Quit]
09:11
kakadu has joined #ocaml
09:12
donflopez has joined #ocaml
09:22
cbot has quit [Quit: Leaving]
09:23
mk9 has joined #ocaml
09:37
mk9 has quit [Quit: mk9]
09:52
sapristi has joined #ocaml
09:52
TarVanimelde has joined #ocaml
10:13
mk9 has joined #ocaml
10:14
mk9 has quit [Client Quit]
10:16
p1n34ppl3 has joined #ocaml
10:22
BitPuffin|osx has joined #ocaml
10:31
zolk3ri has joined #ocaml
10:39
orbifx has joined #ocaml
10:42
mfp has joined #ocaml
10:49
orbifx has quit [Ping timeout: 268 seconds]
10:53
BitPuffin|osx has quit [Ping timeout: 248 seconds]
10:55
donflopez has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
11:15
donflopez has joined #ocaml
11:15
nicoo has quit [Remote host closed the connection]
11:17
nicoo has joined #ocaml
11:22
enterprisey has quit [Remote host closed the connection]
11:36
madroach has quit [Quit: leaving]
11:39
TarVanimelde has quit [Quit: TarVanimelde]
11:40
<
greyfacenospace >
hello... how do i let my function access a list in a module with out passing the list as a parameter to the function?
11:43
jnavila has joined #ocaml
11:43
<
tane >
GreyFaceNoSpace, could you provide some example code, that illustrates what you mean, especially "list in a module"
11:45
enterprisey has joined #ocaml
11:46
<
greyfacenospace >
and want to create the function find_student with out passing the list student as a parameter
11:46
<
greyfacenospace >
the list students*
11:47
<
tane >
GreyFaceNoSpace, then just do that
11:47
<
greyfacenospace >
basically i want my function find_student to take a string as parameter and compare that string to all the student names in the list
11:48
<
tane >
yes, you can just do that
11:48
<
greyfacenospace >
ok thanks! :)
11:48
FreeBirdLjj has quit [Remote host closed the connection]
11:52
jnavila has quit [Ping timeout: 240 seconds]
12:05
barcabuona has joined #ocaml
12:18
jnavila has joined #ocaml
12:30
kakadu has quit [Remote host closed the connection]
12:32
jnavila has quit [Ping timeout: 240 seconds]
12:32
jnavila has joined #ocaml
12:57
BitPuffin|osx has joined #ocaml
12:58
enterprisey has quit [Remote host closed the connection]
13:02
ski has quit [Quit: Lost terminal]
13:11
jnavila has quit [Ping timeout: 240 seconds]
13:22
donflopez has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
13:39
silver has joined #ocaml
13:42
FreeBirdLjj has joined #ocaml
13:53
donflopez has joined #ocaml
13:58
FreeBirdLjj has quit [Remote host closed the connection]
13:59
donflopez has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
14:03
mk9 has joined #ocaml
14:03
mk9 has quit [Client Quit]
14:04
TheLemonMan has joined #ocaml
14:05
mk9 has joined #ocaml
14:08
FreeBirdLjj has joined #ocaml
14:14
donflopez has joined #ocaml
14:15
mk9 has quit [Ping timeout: 276 seconds]
14:17
mk9 has joined #ocaml
14:34
mk9 has quit [Quit: mk9]
14:49
moei has quit [Quit: Leaving...]
14:51
shinnya has quit [Ping timeout: 260 seconds]
14:52
donflopez has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
15:10
TheLemonMan has quit [Ping timeout: 248 seconds]
15:25
sh0t has joined #ocaml
15:35
jao has joined #ocaml
15:43
j0sh has joined #ocaml
15:46
greyfacenospace has quit [Quit: Ex-Chat]
15:46
sh0t has quit [Remote host closed the connection]
15:46
sh0t has joined #ocaml
15:57
mk9 has joined #ocaml
16:02
moei has joined #ocaml
16:03
mk9 has quit [Quit: mk9]
16:04
KeyJoo has joined #ocaml
16:22
spew has joined #ocaml
16:25
malina has joined #ocaml
16:40
spew has quit [Remote host closed the connection]
16:40
spew has joined #ocaml
16:42
Siegfried has joined #ocaml
16:45
KeyJoo has quit [Remote host closed the connection]
16:46
jao has quit [Ping timeout: 248 seconds]
16:53
spew has quit [Ping timeout: 276 seconds]
16:55
wxyzzyrd has joined #ocaml
17:05
spew has joined #ocaml
17:08
ayxih_ has quit [Quit: Leaving]
17:11
ayxih has joined #ocaml
17:11
malina has quit [Ping timeout: 240 seconds]
17:11
spew has quit [Quit: Leaving]
17:27
donflopez has joined #ocaml
17:28
FreeBirdLjj has quit [Remote host closed the connection]
17:30
ziyourenxiang has quit [Ping timeout: 240 seconds]
17:36
donflopez has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
17:39
andreas___ has quit [Quit: Connection closed for inactivity]
17:53
zmt00 has joined #ocaml
17:57
donflopez has joined #ocaml
18:16
sh0t has quit [Ping timeout: 248 seconds]
18:16
sh0t has joined #ocaml
18:16
malina has joined #ocaml
18:20
kakadu has joined #ocaml
18:29
donflopez has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
18:32
sh0t has quit [Remote host closed the connection]
18:34
jbrown has joined #ocaml
18:42
KeyJoo has joined #ocaml
19:05
timclassic has left #ocaml ["User left"]
19:08
wxyzzyrd has quit [Ping timeout: 258 seconds]
19:08
cbot has joined #ocaml
19:09
osa1 has joined #ocaml
19:12
<
osa1 >
another question is I can't use Str module; ocaml-language-server lets me use that module, but ocamlc says "Required module `Str' is unavailable". any ideas?
19:13
<
companion_cube >
maybe you've added `str` to .merlin but not to your build system
19:14
<
osa1 >
I don't even have a .merlin
19:14
<
osa1 >
oh wow I added `str.cma` argument and it worked. I don't even know where that file is.
19:14
<
osa1 >
just saw that command on SO and gave it a try
19:15
Jesin has joined #ocaml
19:17
<
companion_cube >
ah, you call ocamlc by youself?
19:18
<
osa1 >
I don't understand why I need extra params to use a stdlib module
19:19
<
osa1 >
yeah I don't use a build system just yet
19:19
<
companion_cube >
well, str is not really in the stdlib anymore :-)
19:20
<
companion_cube >
it is, but I mean that some parts of the stdlib are being put in separate packages
19:20
<
companion_cube >
num, str
19:20
<
companion_cube >
becaues there are better alternatives on opam, and no one is working on them anymore
19:23
davs has joined #ocaml
19:25
<
octachron >
Str, num, unix, threads, graph, dynlink and bigarray were never part of the standard library, but just extra libaries provided with the compilr distribution
19:26
<
companion_cube >
graphics, you mean :)
19:26
<
octachron >
in particular, it includes the compiler-libs documentation
19:26
<
octachron >
companion_cube, yes, thanks :)
19:31
BitPuffin|osx has quit [Ping timeout: 276 seconds]
19:33
<
osa1 >
thanks octachron. I was wondering why there are two similar pages (libref and stdlib)...
19:34
<
osa1 >
is there a format string for printing a list of .. formattable values? (I have an `int list` right now)
19:37
<
companion_cube >
you need to use a combinator for printing lists
19:37
<
companion_cube >
(or write one yourself, but it's very tedious)
19:37
<
companion_cube >
the `fmt` library provides such a printer, or Format.pp_print_list
19:37
Cheery has joined #ocaml
19:38
<
companion_cube >
Format.printf "some list: %a@." (Format.pp_print_list Format.pp_print_int) [1;2;3]
19:38
sh0t has joined #ocaml
19:39
<
osa1 >
nice, thanks
19:39
Cheery has left #ocaml [#ocaml]
19:40
greyfacenospace has joined #ocaml
19:40
<
companion_cube >
for more complicated printers you might want to use Fmt, or some other similar library
19:44
<
greyfacenospace >
how can i recursively access elements in a list of lists ?
19:44
<
companion_cube >
List.iter (fun l -> List.iter print_int l) [[1;2];[3;4]]
19:45
<
greyfacenospace >
yea but with out using library functions. i wanna get the median for each index in the lists.
19:45
<
greyfacenospace >
for a normal list i would match with |x::xs -> ...
19:46
<
greyfacenospace >
what do we do in case of list of lists?
19:47
wxyzzyrd has joined #ocaml
19:47
malina has quit [Remote host closed the connection]
19:47
<
companion_cube >
same, but you can match with x as a list
19:47
<
companion_cube >
you'll probably need multiple recursive functions
19:48
<
companion_cube >
one for the outer list, and one for trversing each inner list
19:48
<
companion_cube >
that you call on `x` in your code sample
19:49
p1n34ppl3 has quit [Quit: Lost terminal]
19:49
<
greyfacenospace >
oh...i'll try that out
19:49
<
greyfacenospace >
thanks
19:51
slash^ has quit [Read error: Connection reset by peer]
20:08
barcabuona has quit [Quit: WeeChat 1.9.1]
20:09
mengu has joined #ocaml
20:10
jbrown has quit [Remote host closed the connection]
20:14
andreas___ has joined #ocaml
20:19
osa1 has quit [Ping timeout: 246 seconds]
20:25
davs has quit [Ping timeout: 240 seconds]
20:25
davs has joined #ocaml
20:42
sz0 has quit [Quit: Connection closed for inactivity]
20:45
kakadu_ has joined #ocaml
20:46
kakadu has quit [Ping timeout: 260 seconds]
20:51
greyfacenospace has quit [Quit: Ex-Chat]
21:00
tane has quit [Quit: Leaving]
21:06
argent_smith has joined #ocaml
21:12
jnavila has joined #ocaml
21:12
mengu has quit [Remote host closed the connection]
21:14
sapristi has quit [Ping timeout: 260 seconds]
21:20
mengu has joined #ocaml
21:22
kerrhau has joined #ocaml
21:23
davs has quit [Ping timeout: 255 seconds]
21:25
davs has joined #ocaml
21:42
groovy2shoes has quit [Quit: moritura te saluto]
21:43
groovy2shoes has joined #ocaml
21:45
mengu has quit [Remote host closed the connection]
21:49
malina has joined #ocaml
21:59
Siegfried has quit [Ping timeout: 276 seconds]
22:02
pierpa has joined #ocaml
22:02
argent_smith has quit [Quit: Leaving.]
22:03
mengu has joined #ocaml
22:11
malina has quit [Remote host closed the connection]
22:25
davs has quit [Ping timeout: 248 seconds]
22:27
jimmyrcom has joined #ocaml
22:28
mengu has quit [Remote host closed the connection]
22:36
jimmyrcom has quit [Ping timeout: 268 seconds]
22:37
jimmyrcom has joined #ocaml
22:38
jao has joined #ocaml
22:43
andreas___ has quit [Quit: Connection closed for inactivity]
22:44
jnavila has quit [Ping timeout: 240 seconds]
23:02
jao has quit [Remote host closed the connection]
23:07
orbifx has joined #ocaml
23:11
jao has joined #ocaml
23:13
ShalokShalom has joined #ocaml
23:20
VermillionAzure has joined #ocaml
23:30
kakadu_ has quit [Remote host closed the connection]
23:31
mengu has joined #ocaml
23:36
mengu has quit [Ping timeout: 248 seconds]
23:44
mengu has joined #ocaml
23:49
mengu has quit [Ping timeout: 260 seconds]
23:52
mengu has joined #ocaml
23:57
mengu has quit [Ping timeout: 255 seconds]