00:36
azimut has joined #ocaml
00:53
tizoc has quit [Quit: Coyote finally caught me]
00:55
Haudegen has quit [Ping timeout: 260 seconds]
01:00
tizoc has joined #ocaml
02:05
wingsorc__ has quit [Ping timeout: 260 seconds]
02:30
chrisz has quit [Ping timeout: 268 seconds]
02:31
waleee has quit [Ping timeout: 268 seconds]
02:32
chrisz has joined #ocaml
03:31
jao has quit [Ping timeout: 250 seconds]
03:34
zebrag has quit [Quit: Konversation terminated!]
04:41
jedb has quit [Remote host closed the connection]
04:41
jedb has joined #ocaml
05:23
azimut has quit [Remote host closed the connection]
05:33
azimut has joined #ocaml
06:10
John_Ivan has quit [Ping timeout: 260 seconds]
06:31
azimut has quit [Remote host closed the connection]
06:58
mbuf has joined #ocaml
07:19
bobo_ has joined #ocaml
07:19
spip has quit [Ping timeout: 260 seconds]
07:24
mbuf has quit [Read error: Connection reset by peer]
07:25
mbuf has joined #ocaml
07:32
azimut has joined #ocaml
08:02
Tuplanolla has joined #ocaml
08:07
bartholin has joined #ocaml
08:09
Haudegen has joined #ocaml
08:13
olle has joined #ocaml
08:34
<
olle >
About phantom types
08:34
<
olle >
Imagine I have type ('a, 'b) t
08:34
<
olle >
I want to extend it to type ('a, 'b, 'c) t
08:35
<
olle >
Does that mean I have to change all functions that operate on t? Or is there a way to pick only 'a, and ignore 'b and possibly 'c, etc
08:52
wonko has joined #ocaml
09:46
wonko has quit [Ping timeout: 248 seconds]
10:06
Serpent7776 has joined #ocaml
10:54
waleee has joined #ocaml
11:01
sagax has quit [Remote host closed the connection]
12:21
waleee has quit [Ping timeout: 268 seconds]
13:18
jao has joined #ocaml
13:32
waleee has joined #ocaml
13:44
John_Ivan has joined #ocaml
13:45
xd1le has joined #ocaml
14:14
eduardo-bellani has quit [Remote host closed the connection]
14:14
eduardo-bellani has joined #ocaml
14:23
waleee has quit [Ping timeout: 246 seconds]
14:31
wingsorc__ has joined #ocaml
15:01
azimut_ has joined #ocaml
15:12
neiluj has quit [Quit: WeeChat 3.5]
15:15
<
sim642 >
If you don't have type annotations on your functions, but rely on type inference, then you might get away with few changes
15:21
zebrag has joined #ocaml
15:57
Serpent7776 has quit [Quit: Lost terminal]
15:58
Serpent7776 has joined #ocaml
16:27
johnel has quit [Ping timeout: 268 seconds]
16:30
<
olle >
sim642: But phantom types require explicit annotations :D
16:30
<
olle >
Same with GADT
16:30
<
olle >
afaik, I can't pattern match on type-level and choose to ignore certain parts of a type
16:31
azimut_ has quit [Ping timeout: 258 seconds]
16:31
<
olle >
I can only choose to use a place-holder type variable like 'a or 'b to say "I don't care exactly which type this is", but the structure of the type must be exactly matched
16:32
azimut has joined #ocaml
16:38
johnel has joined #ocaml
16:46
<
olle >
37 let print_inner_door : type a b. (a, b) t -> unit = function
16:46
<
olle >
Error: This pattern matches values of type closed but a pattern was expected which matches values of type a
16:48
<
olle >
No idea why this would fail
16:48
<
olle >
I thought `: type a b. (a, b) t` created a fully polymorphic situation?
16:48
<
olle >
Oh, maybe I have to explicitly type the match-cases?
16:48
<
olle >
Nope, no such thing x)
16:55
<
olle >
I can't match on two different types in the same match case? :(
17:11
<
olle >
Is this one of those "existential witness" kind of situation...?
17:42
waleee has joined #ocaml
17:54
<
octachron >
olle, this is how parametric polymorphism works.
17:55
<
octachron >
When you write the type as `'a 'b. ('a,'b) t` you are promising to handle all types `'a` and `'b`
17:55
<
octachron >
and this is only possible if you handle values of those types as black boxes
18:07
<
olle >
octachron: Sad
18:07
<
olle >
I'll try to rewrite it a bit
18:07
<
olle >
type opened;; type closed;; type _ door_state = Op | Cl
18:07
<
olle >
Something like that
18:08
<
octachron >
also you should never use abstract type for type-level tag
18:08
<
octachron >
type opened = Opened_tag
18:09
<
octachron >
otherwise outside of the initial module, the typechecker cannot know if opened ≠ closed
18:25
mbuf has quit [Quit: Leaving]
18:49
adanwan_ has joined #ocaml
18:50
adanwan has quit [Ping timeout: 258 seconds]
19:14
spip has joined #ocaml
19:14
bobo_ has quit [Ping timeout: 268 seconds]
19:49
cedric has joined #ocaml
20:13
williewi` has joined #ocaml
20:45
adanwan_ has quit [Remote host closed the connection]
20:47
adanwan has joined #ocaml
21:18
xd1le has quit [Quit: xd1le]
21:18
<
olle >
Is there any difference between 'a and _ in a type, btw? Or `_` is used when it's not referenced? Hm.
21:19
<
olle >
type 'a foo = Heyo
22:03
olle has quit [Ping timeout: 265 seconds]
22:07
Serpent7776 has quit [Ping timeout: 268 seconds]
22:29
bartholin has quit [Quit: Leaving]
22:54
adanwan has quit [Remote host closed the connection]
22:55
adanwan has joined #ocaml
23:01
Tuplanolla has quit [Quit: Leaving.]
23:09
Haudegen has quit [Quit: No Ping reply in 180 seconds.]
23:10
Haudegen has joined #ocaml
23:31
<
dh` >
should be the same
23:36
spip has quit [Quit: Konversation terminated!]
23:41
spip has joined #ocaml
23:45
cedric has quit [Quit: Konversation terminated!]