00:01
swgillespie has joined #ocaml
00:21
jwatzman|work has quit [Quit: jwatzman|work]
00:23
grouzen has joined #ocaml
00:27
ousado has quit [Ping timeout: 255 seconds]
00:27
ousado has joined #ocaml
00:30
creicher` has quit [Remote host closed the connection]
00:30
creicher` has joined #ocaml
00:31
creicher` has quit [Remote host closed the connection]
00:31
Tamae has joined #ocaml
00:31
creichert has joined #ocaml
00:44
obadz- has quit [Ping timeout: 244 seconds]
00:45
obadz has joined #ocaml
00:51
Heiher has joined #ocaml
00:56
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
01:02
tennix has joined #ocaml
01:02
tennix has joined #ocaml
01:05
tmtwd has quit [Ping timeout: 255 seconds]
01:07
tmtwd has joined #ocaml
01:14
tmtwd has quit [Ping timeout: 244 seconds]
01:26
Algebr has joined #ocaml
01:38
tmtwd has joined #ocaml
01:43
tmtwd has quit [Ping timeout: 264 seconds]
01:51
linman32 has joined #ocaml
01:55
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
01:55
swgillespie has joined #ocaml
01:58
Hannibal_Smith has quit [Quit: Leaving]
02:01
linman16 has joined #ocaml
02:02
igoroliveira has quit [Quit: Connection closed for inactivity]
02:04
linman32 has quit [Ping timeout: 240 seconds]
02:05
manizzle has quit [Ping timeout: 244 seconds]
02:07
jeffmo has joined #ocaml
02:09
ceryo has joined #ocaml
02:10
ceryo has quit [Client Quit]
02:26
grouzen has quit [Ping timeout: 264 seconds]
02:28
mk270 has quit [Ping timeout: 244 seconds]
02:29
mk270 has joined #ocaml
02:36
igoroliveira has joined #ocaml
02:41
claudiuc has quit [Remote host closed the connection]
03:00
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
03:03
tokik has quit [Quit: leaving]
03:03
tokik has joined #ocaml
03:04
ygrek_ has quit [Ping timeout: 246 seconds]
03:04
tokik has quit [Client Quit]
03:05
tokik has joined #ocaml
03:14
jeffmo has quit [Read error: Connection reset by peer]
03:14
jeffmo has joined #ocaml
03:14
jeffmo has quit [Client Quit]
03:23
darkf has joined #ocaml
03:25
struktured has joined #ocaml
03:31
ski has quit [Ping timeout: 252 seconds]
03:32
ski has joined #ocaml
03:45
tmtwd has joined #ocaml
03:47
shinnya has quit [Ping timeout: 272 seconds]
03:59
manud has quit [Quit: manud]
04:04
manud has joined #ocaml
04:09
tmtwd has quit [Ping timeout: 240 seconds]
04:13
ygrek_ has joined #ocaml
04:14
siddharthv_away is now known as siddharthv
04:20
xificurC has quit [Ping timeout: 256 seconds]
04:22
kolko has joined #ocaml
04:25
mk270 has quit [Ping timeout: 272 seconds]
04:28
MercurialAlchemi has joined #ocaml
04:31
ggole has joined #ocaml
04:39
keen__________32 has quit [Read error: Connection reset by peer]
04:41
keen__________32 has joined #ocaml
04:55
<
linman16 >
is it possible to explicitly cast something in ocaml?
04:57
<
ggole >
Yes, (expr :> type)
04:57
tmtwd has joined #ocaml
04:57
<
ggole >
Of course this is only allowed if expr is compatible with type.
05:00
linman8 has joined #ocaml
05:01
<
linman8 >
ggole: thanks. your a life saver :)
05:01
mk270 has joined #ocaml
05:04
linman16 has quit [Ping timeout: 250 seconds]
05:04
manud has quit [Quit: manud]
05:09
<
linman8 >
Error: This expression has type int/1 but an expression was expected of type int/1284
05:09
<
linman8 >
^ what is that error mean?
05:14
mk270 has quit [Ping timeout: 240 seconds]
05:15
Bhavya has joined #ocaml
05:21
zaquest has quit [Quit: Leaving]
05:26
<
ggole >
Different type definitions with the same name
05:31
MercurialAlchemi has quit [Ping timeout: 246 seconds]
05:41
linman8 has quit [Ping timeout: 240 seconds]
05:43
Bhavya has quit [Ping timeout: 260 seconds]
05:45
mk270 has joined #ocaml
05:48
tmtwd has quit [Remote host closed the connection]
05:50
swgillespie has joined #ocaml
05:51
mk270 has quit [Ping timeout: 272 seconds]
05:55
Bhavya has joined #ocaml
05:56
kushal has quit [Quit: Leaving]
06:27
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
06:33
mk270 has joined #ocaml
06:44
Haudegen has quit [Ping timeout: 244 seconds]
06:45
mk270 has quit [Ping timeout: 246 seconds]
06:48
sepp2k has joined #ocaml
06:50
Haudegen has joined #ocaml
06:50
kushal has joined #ocaml
07:28
mk270 has joined #ocaml
07:30
Haudegen has quit [Ping timeout: 250 seconds]
07:33
xificurC has joined #ocaml
07:42
mk270 has quit [Ping timeout: 252 seconds]
07:46
Haudegen has joined #ocaml
07:57
TheLemonMan has joined #ocaml
07:57
zpe has joined #ocaml
08:01
sh0t has joined #ocaml
08:02
huza has joined #ocaml
08:02
igoroliveira has quit [Quit: Connection closed for inactivity]
08:17
creichert has quit [Ping timeout: 250 seconds]
08:22
Kakadu has joined #ocaml
08:22
teiresias has quit [Quit: leaving]
08:31
c74d has quit [Remote host closed the connection]
08:32
sh0t has quit [Ping timeout: 244 seconds]
08:33
ggole has quit [Read error: Connection reset by peer]
08:35
<
flux >
soo, there is the github bindings in opam, has someone made a nice little command line tool that makes use of it?
08:39
<
flux >
the bindings themselves seem so big that I wonder if they in fact might be complete
08:40
<
flux >
buut it also depends on cmdliner, so does it infact come with some tool?-)
08:40
huza has quit [Quit: WeeChat 0.3.8]
08:42
<
flux >
it does, though its binaries are prefixed with git-*. I guess opam doesn't really know where packages install files, does it?
08:43
BitPuffin|osx has quit [Ping timeout: 260 seconds]
08:53
c74d has joined #ocaml
08:55
<
Heiher >
How can I find the documentation about ocaml native compiler porting? thanks!
09:22
ygrek_ has quit [Ping timeout: 246 seconds]
09:33
Heiher has left #ocaml [#ocaml]
09:55
jao has quit [Ping timeout: 265 seconds]
09:59
yomimono has joined #ocaml
10:56
_andre has joined #ocaml
10:56
Haudegen has quit [Ping timeout: 260 seconds]
11:01
Haudegen has joined #ocaml
11:13
yomimono has quit [Ping timeout: 250 seconds]
11:14
Bhavya has quit [Quit: Quit the channel]
11:20
yomimono has joined #ocaml
11:27
yomimono has quit [Ping timeout: 250 seconds]
11:31
octachron has joined #ocaml
11:33
Hannibal_Smith has joined #ocaml
11:40
yomimono has joined #ocaml
11:48
ggole has joined #ocaml
11:50
rand000 has joined #ocaml
11:52
Bhavya has joined #ocaml
11:53
tennix has quit [Ping timeout: 244 seconds]
12:09
Bhavya has quit [Quit: Quit the channel]
12:27
nullcatxxx_ has joined #ocaml
12:44
yomimono has quit [Ping timeout: 255 seconds]
12:54
freehck has joined #ocaml
12:55
<
freehck >
hello people. I have faced to the problem of ocamlmerlin again: my emacs does not see modules.
12:55
<
freehck >
I created file .merlin in the root of my project
12:55
<
freehck >
and have already set "S srs" option there.
12:56
siddharthv is now known as siddharthv_away
12:56
<
freehck >
But my Emacs react badly for lines "open Somemodule" even if somemodule is available in src directory.
12:57
<
freehck >
Could somebody help me / explain me how to debug this behaviour?
12:57
yomimono has joined #ocaml
12:58
<
freehck >
I think I must denote that the file src/somemodule.ml specifically exists.
12:58
<
reynir >
probably you want to use PKG too
13:00
<
freehck >
I afraid I don't fully understand what PKG option do.
13:00
kushal has quit [Ping timeout: 272 seconds]
13:01
<
freehck >
I just want my emacs to know all the definitions I made in files in "src" directory. =/
13:01
tennix has joined #ocaml
13:01
<
freehck >
I didn't define packages...
13:09
<
octachron >
freehck, you need to add a build directory
13:09
<
reynir >
Then maybe you need to specify B
13:09
<
freehck >
I specified "B _build/src"
13:10
<
freehck >
well, how can I impose merlin-mode to reload .merlin files?
13:10
yomimono has quit [Ping timeout: 272 seconds]
13:10
<
freehck >
That directory didn't exist when I started merlin-mode.
13:12
<
reynir >
maybe merlin-restart-process
13:13
<
freehck >
Thank you. I've already restarted the whole Emacs instance, and now everything works fine. :)
13:13
<
freehck >
Shall I run merlin-restart-process every time I add new file into my project?
13:14
<
ggole >
freehck: I think it's only necessary when you change .merlin
13:14
<
octachron >
freehck, (re)building the project should be enough
13:14
<
freehck >
Gotcha. Thanks.
13:15
Hannibal_Smith has quit [Quit: Leaving]
13:17
kushal has joined #ocaml
13:31
igoroliveira has joined #ocaml
13:34
nahoj has joined #ocaml
13:45
mort___ has joined #ocaml
13:45
ceryo has joined #ocaml
13:52
badkins has joined #ocaml
13:55
Asmadeus has quit [Ping timeout: 272 seconds]
13:55
adrien has quit [Ping timeout: 265 seconds]
13:55
gpietro has joined #ocaml
13:56
yomimono has joined #ocaml
13:56
freehck has quit [Ping timeout: 246 seconds]
13:57
<
gpietro >
hi guys. I am learning ocaml I am reading Practical Ocaml. THere is a piece of code in this book:
http://paste.ubuntu.com/11966770/ I try to compile it but it keeps telling me syntax error
13:57
<
gpietro >
could you please tell me what the problem is?
13:58
<
thizanne >
gpietro: this is not ocaml code
13:58
<
thizanne >
this is for ocamllex
13:58
<
gpietro >
sorry i mean ocamllex
13:59
<
gpietro >
also the part in between { }
13:59
<
gpietro >
is ocaml code
13:59
<
gpietro >
but that's not where the problem is
13:59
<
thizanne >
it works on my machine (TM)
14:00
<
thizanne >
what is your ocaml version ?
14:00
<
gpietro >
sorry I am an idiot
14:00
<
gpietro >
it works on mine too
14:00
<
gpietro >
sorry for the wwaste of time
14:01
<
thizanne >
no problem, i'm glad it works
14:05
struktured has quit [Ping timeout: 240 seconds]
14:07
nullcatx_ has joined #ocaml
14:10
nullcatxxx_ has quit [Ping timeout: 264 seconds]
14:31
mort___ has quit [Quit: Leaving.]
14:43
slash^ has joined #ocaml
14:48
yomimono has quit [Ping timeout: 246 seconds]
14:50
<
gpietro >
it just says SYntax error :(
14:53
jeffmo has joined #ocaml
14:55
paddymahoney has joined #ocaml
14:56
uris77 has joined #ocaml
14:56
tennix has quit [Ping timeout: 252 seconds]
15:00
<
octachron >
gpietro, you should remove ";" between the functions in the preambule
15:01
<
gpietro >
thanks octachron
15:01
<
gpietro >
i have some problems in understanding ';'
15:01
<
gpietro >
can u please give ma n hint?
15:01
<
gpietro >
it's like concatenation of statemnents right?
15:01
<
octachron >
";" is not a terminator in ocaml; it is more an operator
15:02
linman8 has joined #ocaml
15:02
<
gpietro >
yeah so it takes two statements (with side effects...) and executes one after the other right?
15:02
<
gpietro >
why wsa it creating problems there?
15:03
<
octachron >
more something like a ; b → ignore a and return b
15:04
paddymahoney has quit [Remote host closed the connection]
15:04
<
gpietro >
but still it executes a
15:04
<
octachron >
because "let a = print_string "hello"; let s = "world" in print_string s" is valid
15:04
<
gpietro >
if a is a side effects instruciton
15:05
<
octachron >
yes, ocaml is eager by default
15:05
<
octachron >
so if you write "do_something () ; a", "do_something ()" is evaluated
15:06
rand000 has quit [Ping timeout: 246 seconds]
15:09
<
gpietro >
ok octachron thanks
15:09
<
gpietro >
so in the code it was creating problems because ; was expecting something later...which was missing
15:09
<
octachron >
another point, there is no separation between expression and statement in Ocaml. So do_something() could return any type
15:09
grouzen has joined #ocaml
15:11
<
octachron >
gpietro,yes. After the first ";", the compiler was reading the "let substract" as a local binding: " let substract ..= ... in"
15:17
<
gpietro >
thanks octachron
15:23
tmtwd has joined #ocaml
15:23
tennix has joined #ocaml
15:26
tane has joined #ocaml
15:29
S11001001 has quit [Remote host closed the connection]
15:29
mariusae has quit [Remote host closed the connection]
15:29
eventualbuddha has quit [Remote host closed the connection]
15:29
bobpoekert has quit [Remote host closed the connection]
15:29
jeroud has quit [Remote host closed the connection]
15:29
andreypopp_ has quit [Write error: Broken pipe]
15:29
lyxia has quit [Ping timeout: 256 seconds]
15:32
tennix has quit [Ping timeout: 244 seconds]
15:35
lyxia has joined #ocaml
15:37
tennix has joined #ocaml
15:42
tennix has quit [Ping timeout: 240 seconds]
15:42
eventualbuddha has joined #ocaml
15:44
jao has joined #ocaml
15:44
zpe has quit [Remote host closed the connection]
15:51
lobo has joined #ocaml
15:53
tennix has joined #ocaml
15:53
grouzen has quit [Ping timeout: 246 seconds]
15:54
ollehar has joined #ocaml
15:54
creichert has joined #ocaml
15:55
IbnFirnas has quit [Remote host closed the connection]
15:55
ggherdov has quit [Remote host closed the connection]
15:55
strmpnk has quit [Remote host closed the connection]
15:55
l1x has quit [Write error: Broken pipe]
15:55
sspi has quit [Remote host closed the connection]
15:55
mankyKitty has quit [Remote host closed the connection]
16:07
l1x has joined #ocaml
16:09
strmpnk has joined #ocaml
16:10
jeroud has joined #ocaml
16:11
octachron has quit [Quit: Leaving]
16:13
IbnFirnas has joined #ocaml
16:18
yomimono has joined #ocaml
16:19
andreypopp_ has joined #ocaml
16:20
rand000 has joined #ocaml
16:21
ncthom91 has joined #ocaml
16:22
mariusae has joined #ocaml
16:22
ygrek_ has joined #ocaml
16:23
jave has joined #ocaml
16:29
ggherdov has joined #ocaml
16:31
mankyKitty has joined #ocaml
16:33
sspi has joined #ocaml
16:34
S11001001 has joined #ocaml
16:34
jwatzman|work has joined #ocaml
16:40
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
16:40
bobpoekert has joined #ocaml
16:41
tennix has quit [Ping timeout: 264 seconds]
16:42
darkf has quit [Quit: Leaving]
16:45
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
16:53
Hannibal_Smith has joined #ocaml
17:00
yomimono has quit [Ping timeout: 256 seconds]
17:00
sepp2k has quit [Quit: Leaving.]
17:02
tennix has joined #ocaml
17:07
tennix has quit [Ping timeout: 252 seconds]
17:08
ollehar has quit [Ping timeout: 244 seconds]
17:15
yomimono has joined #ocaml
17:15
ygrek_ has quit [Ping timeout: 252 seconds]
17:17
Algebr` has joined #ocaml
17:18
foobar_ has joined #ocaml
17:19
foobar_ is now known as Asmadeus
17:37
linman8 has quit [Ping timeout: 255 seconds]
17:40
malc_ has joined #ocaml
17:46
Kakadu has quit [Quit: Page closed]
17:47
kiwnix has joined #ocaml
17:55
ygrek_ has joined #ocaml
17:57
malc_ has quit [Ping timeout: 272 seconds]
17:57
shinnya has joined #ocaml
18:00
yomimono has quit [Read error: Connection reset by peer]
18:00
Algebr has quit [Remote host closed the connection]
18:09
malc_ has joined #ocaml
18:09
ncthom91 has joined #ocaml
18:11
Haudegen has quit [Ping timeout: 256 seconds]
18:12
yomimono has joined #ocaml
18:18
Haudegen has joined #ocaml
18:19
malc_ has quit [Ping timeout: 264 seconds]
18:19
nullcatxxx_ has joined #ocaml
18:22
nullcatx_ has quit [Ping timeout: 252 seconds]
18:35
_whitelogger____ has joined #ocaml
18:39
bobpoekert has joined #ocaml
18:41
linman8 has quit [Ping timeout: 264 seconds]
18:42
l1x has joined #ocaml
18:45
mehdid has joined #ocaml
18:45
lobo__ is now known as lobo
18:46
ggole has quit [Ping timeout: 252 seconds]
18:48
sspi has joined #ocaml
18:51
yomimono has quit [Ping timeout: 252 seconds]
18:55
lobo has quit [Quit: leaving]
18:56
tane has quit [Excess Flood]
18:57
tane has joined #ocaml
19:07
sh0t has joined #ocaml
19:08
Kakadu has joined #ocaml
19:14
tennix has joined #ocaml
19:15
troydm has quit [Quit: What is hope? That all of your wishes and all of your dreams come true? (C) Rau Le Creuset]
19:17
troydm has joined #ocaml
19:17
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
19:19
tennix has quit [Ping timeout: 265 seconds]
19:21
Denommus has joined #ocaml
19:25
swgillespie has joined #ocaml
19:26
tmtwd has quit [Read error: Connection reset by peer]
19:26
tmtwd has joined #ocaml
19:29
slash^ has quit [Read error: Connection reset by peer]
19:31
kushal has quit [Read error: Connection reset by peer]
19:32
kushal has joined #ocaml
19:36
TheLemonMan has joined #ocaml
19:36
ollehar has joined #ocaml
19:37
ncthom91 has joined #ocaml
19:45
kushal has quit [Ping timeout: 240 seconds]
19:46
claudiuc has joined #ocaml
19:52
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
19:53
nullcatxxx_ has joined #ocaml
19:54
vishesh has joined #ocaml
20:16
nojb has joined #ocaml
20:18
nojb_ has joined #ocaml
20:20
nojb has quit [Ping timeout: 246 seconds]
20:21
nojb_ has left #ocaml [#ocaml]
20:21
nojb_ has joined #ocaml
20:22
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
20:28
ollehar has quit [Ping timeout: 272 seconds]
20:29
claudiuc has quit [Read error: Connection reset by peer]
20:30
claudiuc has joined #ocaml
20:30
claudiuc has quit [Remote host closed the connection]
20:39
claudiuc has joined #ocaml
20:40
Hannibal_Smith has quit [Quit: Leaving]
20:41
ia0 has quit [Quit: leaving]
20:42
_andre has quit [Quit: leaving]
20:42
ia0 has joined #ocaml
20:44
MercurialAlchemi has joined #ocaml
20:56
tane has quit [Quit: Verlassend]
20:58
claudiuc has quit [Remote host closed the connection]
21:03
acieroid` has joined #ocaml
21:03
ygrek_ has quit [Ping timeout: 272 seconds]
21:03
creicher` has joined #ocaml
21:05
Drup has quit [Ping timeout: 250 seconds]
21:05
lyxia has quit [Ping timeout: 250 seconds]
21:05
acieroid has quit [Ping timeout: 250 seconds]
21:05
rand000 has quit [Ping timeout: 250 seconds]
21:05
creichert has quit [Ping timeout: 250 seconds]
21:05
dmbaturin has quit [Ping timeout: 250 seconds]
21:05
w0rp has quit [Ping timeout: 250 seconds]
21:05
tobiasBo1 has quit [Ping timeout: 250 seconds]
21:06
Drup has joined #ocaml
21:06
w0rp has joined #ocaml
21:06
lyxia has joined #ocaml
21:07
dmbaturin has joined #ocaml
21:07
rand000 has joined #ocaml
21:08
sh0t has quit [Remote host closed the connection]
21:09
struktured has joined #ocaml
21:10
tobiasBo1 has joined #ocaml
21:11
uris77 has quit [Ping timeout: 255 seconds]
21:20
manud has joined #ocaml
21:25
tennix has joined #ocaml
21:27
linman8 has joined #ocaml
21:31
tennix has quit [Ping timeout: 264 seconds]
21:32
claudiuc has joined #ocaml
21:35
<
linman8 >
how does one force a type over a group of polymorphic functions?
21:43
jeffmo has quit [Quit: jeffmo]
21:46
<
Drup >
linman8: just annotate
21:50
<
linman8 >
Drup: this works too and i used it. but do you know of any alternative methods?
21:51
<
Drup >
I need an example
21:53
<
Denommus >
linman8: ewww
21:54
<
linman8 >
why eww, Denommus?
21:54
tmtwd has quit [Ping timeout: 264 seconds]
21:54
<
Denommus >
linman8: that's not a thing that classes solve, that's just value restriction in action
21:54
<
Drup >
yeah, I'm not sure to see what is "solved" here
21:56
<
Denommus >
linman8: you could exploit value restriction to do what you want, btw
21:56
<
linman8 >
hmm. well, it is for a programming job question. they want to see an interface so it doesn't use explicit casting
21:56
<
linman8 >
how is that, Denommus?
21:57
<
Drup >
linman8: you still didn't told what is your concrete problem and why/where you would need explicit casting in this problem ...
21:57
ygrek_ has joined #ocaml
21:57
<
Denommus >
linman8: let foo = ref [];; (* val foo: '_a list ref
*) foo := [1] (* val foo: int list ref *)
22:00
<
linman8 >
let bloomFilter = BloomFilter.create 10 0.5;;
22:00
<
linman8 >
this creates type of: 'a BloomFilter.bloomFilterT
22:01
<
linman8 >
but would like to see, for example: int BloomFilter.bloomFilterT
22:01
<
Drup >
why do you want that ?
22:02
<
linman8 >
for job related, programming question.. to get job, need to solve their problem :)
22:02
<
Denommus >
linman8: why don't you have a separate mli file instead of putting annotations everywhere?
22:03
<
linman8 >
Denommus: interesting. never thought of it like that
22:03
<
linman8 >
Denommus: came from a different language, so didn't think that way
22:03
<
Drup >
linman8: just put an annotation, really
22:04
<
Denommus >
linman8: also, OCaml has type inference, so lots of those annotations aren't even needed
22:04
<
Drup >
In this case, the 'a doesn't mean anything, the type restriction is completely useless
22:05
<
linman8 >
let bloomFilter = (BloomFilter.create 10 0.5 :> (string, int BloomFilter.bloomFilterT) either);;
22:05
<
linman8 >
Drup: see line above ^
22:05
<
Drup >
You don't need ":>"
22:05
<
Drup >
":" is enough
22:05
<
Drup >
It's not a coercion
22:05
<
linman8 >
Drup: it solves it because the type returned is an int instead of an 'a
22:06
<
linman8 >
Drup: that works, thanks
22:06
jeffmo has joined #ocaml
22:06
jeffmo has quit [Client Quit]
22:06
<
Drup >
linman8: The thing I'm hinting at, apparently not clearly enough, is that the problem is pointless because the type variable in this interface is pointless ...
22:07
<
Denommus >
Drup: maybe whoever created this was thinking about phantom types
22:08
<
linman8 >
Drup: insert is polymorphic, so it is possible to put in "string" and "int". that is not acceptable!
22:08
<
linman8 >
Drup: i mean in same bloomFilterT data. it should be either string based only, or int based only, etc.
22:09
<
Denommus >
linman8: insert has type 'a bloomFilterT -> 'a -> unit
22:09
<
Drup >
linman8: except insert doesn't do anything.
22:09
<
linman8 >
it's mutable. it is changing the bloomFilterT
22:09
<
Denommus >
linman8: it's completely impossible to insert a string in a int bloomFilterT because of that. Both type must be equal because the type variables are equal
22:10
<
Drup >
linman8: ok, look carefully at the type "bloomfilterT"
22:10
<
Drup >
do you see, anywhere
*inside* the type, a variable 'a ?
22:10
<
Drup >
(oh, btw, bloomfilterT is not mutable)
22:10
<
linman8 >
Denommus: yes, i added that to fix the problem
22:11
<
linman8 >
Denommus: but, to qoute from them on the updated code with the type parameter:
22:11
<
linman8 >
"It is possible to define interface so that it doesn't require explicit casting from the user to achieve same effect."
22:12
<
Drup >
anyway, if I may, except if you have explicit authorization, you probably shouldn't upload the code that they give you.
22:12
<
linman8 >
Drup: that is my code
22:13
<
linman8 >
if bloomFilterT didn't have the 'a, then insert would look like: bloomFilterT -> 'a -> unit
22:13
<
linman8 >
so the 'a is important, or one could insert any type into the bloomfilter
22:14
<
Drup >
linman8: I mean inside the definition of the record, not the type variables ...
22:14
<
linman8 >
Drup: yeah, it doesn't need it though i think
22:15
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
22:15
<
linman8 >
Denommus: do you have any suggestions? need to "define interface so .. type casting is not needed to acheive same effect"
22:16
<
Drup >
(note: I probably don't understand the point of your interface, because for me, those function don't make sense at all)
22:17
<
linman8 >
Drup: bloomFilterT is mutable haha. how can i prove it to you? i see the data change in the repl
22:17
<
Drup >
linman8: BitSet is, bloomfilterT isn't.
22:18
<
linman8 >
Drup: sure,
22:18
<
linman8 >
that is what we want to change
22:20
<
Denommus >
Drup: the value of type 'a is being hashed before modifying the bitset that's inside the bloomFilterT
22:20
<
Denommus >
Drup: that's why you don't see 'a in bloomFilterT
22:20
<
Drup >
Denommus: but why would you restrain the 'a then
22:20
<
Drup >
it will work just fine with any 'a
22:20
<
Denommus >
Drup: maybe that's the problem they want him to solve
22:20
<
Drup >
specializing is completely useless here
22:21
marsam has joined #ocaml
22:21
<
linman8 >
Denommus, Drup: yes. originally that is how i solved it! but they want to restrain 'a
22:21
<
Drup >
I still don't understand the problem
22:21
<
Drup >
but the solution is easy
22:22
<
Drup >
Make the datatype abstract (through the .mli) and create a function "create : unit -> 'a bloomFilterT"
22:23
<
Drup >
and read up on value restriction
22:23
<
Drup >
(there is a section about it on RWO)
22:23
<
Denommus >
Drup: so, effectively, using shadow types? :P
22:23
<
Denommus >
phantom types
22:23
<
Denommus >
why do I always call them shadow types?
22:23
<
Drup >
Denommus: 'a is phantom anyway, since it's usesless :p
22:24
<
Denommus >
Drup: it's phantom but can't possibly be enforced
22:24
<
Drup >
Denommus: sure it can, just expose it non covariant
22:25
<
Denommus >
Drup: no, I mean, the way the code is structured RIGHT NOW there's no enforcement
22:25
<
Denommus >
Drup: I guess they want him to enforce the phantom types
22:25
<
Denommus >
Drup: so you can't hash a int in a string bloomFilterT
22:26
<
Drup >
Yeah, I got it
22:26
<
Drup >
(still not seeing a point of the constraint, though :D)
22:26
<
Denommus >
Drup: maybe there's a use for it in some specific machine we don't know. I dunno.
22:27
<
Denommus >
linman8: nevertheless, that's what you need: phantom types
22:27
<
linman8 >
Denommus, Drup: this is great! thanks for helping out! would have probably done OOP approach or some crap like that haha. thanks
22:29
Kakadu has quit [Remote host closed the connection]
22:32
<
Denommus >
linman8: yeah, OOP in OCaml is hardly ever needed
22:32
<
Denommus >
linman8: anyway, you can even make the shadow type in a functor for it to be parameterized
22:32
<
Drup >
that's .. really overkill here
22:33
<
Drup >
(and that wouldn't be a phantom type anymore, just a functor)
22:34
<
Denommus >
Drup: it's still a phantom type because the type in question is not really relevant internally
22:35
<
Denommus >
Drup: just happens that the phantom type is "filled" by a functor
22:35
<
Drup >
you can just remove the type variable in this case
22:36
<
Denommus >
Drup: ah
22:36
<
Denommus >
Drup: hurr, you're right
22:37
<
Denommus >
linman8: that would be even a simpler approach, in fact
22:37
<
Drup >
not really, no
22:37
<
Denommus >
Drup: it wouldn't involve shadow types
22:37
<
Drup >
phantom type is just fine
22:38
<
Denommus >
well, whatever makes him happy
22:39
<
Denommus >
but now that you mentioned that the bloomFilterT could be just an abstract type and 'a be a parameterized type in a functor everything seems simpler to me
22:39
vishesh has quit [Ping timeout: 264 seconds]
22:39
<
linman8 >
wait, so there is: 1)phantom 2) functor
22:40
marsam has quit [Remote host closed the connection]
22:41
marsam has joined #ocaml
22:43
nullcatxxx_ has joined #ocaml
22:43
<
linman8 >
Denommus Drup: what is this last approach? type variable, then what?
22:43
tmtwd has joined #ocaml
22:45
<
linman8 >
* remove type variable, then...
22:46
adrien has joined #ocaml
22:50
<
Denommus >
linman8: you put everything inside a functor that accepts a module with a type "a"
22:50
<
Denommus >
linman8: replace the 'a by a everywhere
22:50
<
Denommus >
linman8: but remove it form bloomFilterT
22:51
<
Denommus >
linman8: and bloomFilterT should be an abstract type in the functor's signature
22:51
MercurialAlchemi has quit [Ping timeout: 265 seconds]
22:58
<
Denommus >
linman8: with a respective mli, of course
23:01
manud has quit [Quit: manud]
23:20
marsam has quit [Remote host closed the connection]
23:20
<
linman8 >
Denommus: thanks. will check out after break
23:24
linman8 has quit [Ping timeout: 244 seconds]
23:40
madroach has quit [Ping timeout: 264 seconds]
23:41
madroach has joined #ocaml
23:48
creicher` has quit [Quit: Leaving]
23:49
creichert has joined #ocaml
23:54
manud has joined #ocaml