companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 4.14.0 released: https://ocaml.org/releases/4.14.0.html | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
azimut has joined #ocaml
tizoc has quit [Quit: Coyote finally caught me]
Haudegen has quit [Ping timeout: 260 seconds]
tizoc has joined #ocaml
wingsorc__ has quit [Ping timeout: 260 seconds]
chrisz has quit [Ping timeout: 268 seconds]
waleee has quit [Ping timeout: 268 seconds]
chrisz has joined #ocaml
jao has quit [Ping timeout: 250 seconds]
zebrag has quit [Quit: Konversation terminated!]
jedb has quit [Remote host closed the connection]
jedb has joined #ocaml
azimut has quit [Remote host closed the connection]
azimut has joined #ocaml
John_Ivan has quit [Ping timeout: 260 seconds]
azimut has quit [Remote host closed the connection]
mbuf has joined #ocaml
bobo_ has joined #ocaml
spip has quit [Ping timeout: 260 seconds]
mbuf has quit [Read error: Connection reset by peer]
mbuf has joined #ocaml
azimut has joined #ocaml
Tuplanolla has joined #ocaml
bartholin has joined #ocaml
Haudegen has joined #ocaml
olle has joined #ocaml
<olle> About phantom types
<olle> Imagine I have type ('a, 'b) t
<olle> I want to extend it to type ('a, 'b, 'c) t
<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
wonko has joined #ocaml
wonko has quit [Ping timeout: 248 seconds]
Serpent7776 has joined #ocaml
waleee has joined #ocaml
sagax has quit [Remote host closed the connection]
waleee has quit [Ping timeout: 268 seconds]
jao has joined #ocaml
waleee has joined #ocaml
John_Ivan has joined #ocaml
xd1le has joined #ocaml
eduardo-bellani has quit [Remote host closed the connection]
eduardo-bellani has joined #ocaml
waleee has quit [Ping timeout: 246 seconds]
wingsorc__ has joined #ocaml
azimut_ has joined #ocaml
azimut has quit [Quit: ZNC - https://znc.in]
neiluj has quit [Quit: WeeChat 3.5]
<sim642> If you don't have type annotations on your functions, but rely on type inference, then you might get away with few changes
zebrag has joined #ocaml
Serpent7776 has quit [Quit: Lost terminal]
Serpent7776 has joined #ocaml
johnel has quit [Ping timeout: 268 seconds]
<olle> sim642: But phantom types require explicit annotations :D
<olle> Same with GADT
<olle> afaik, I can't pattern match on type-level and choose to ignore certain parts of a type
azimut_ has quit [Ping timeout: 258 seconds]
<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
azimut has joined #ocaml
johnel has joined #ocaml
<olle> 37 let print_inner_door : type a b. (a, b) t -> unit = function
<olle> Error: This pattern matches values of type closed but a pattern was expected which matches values of type a
<olle> No idea why this would fail
<olle> I thought `: type a b. (a, b) t` created a fully polymorphic situation?
<olle> Oh, maybe I have to explicitly type the match-cases?
<olle> Nope, no such thing x)
<olle> I can't match on two different types in the same match case? :(
<olle> Is this one of those "existential witness" kind of situation...?
waleee has joined #ocaml
<octachron> olle, this is how parametric polymorphism works.
<octachron> When you write the type as `'a 'b. ('a,'b) t` you are promising to handle all types `'a` and `'b`
<octachron> and this is only possible if you handle values of those types as black boxes
<olle> octachron: Sad
<olle> I'll try to rewrite it a bit
<olle> type opened;; type closed;; type _ door_state = Op | Cl
<olle> Something like that
<olle> Thanks :)
<octachron> also you should never use abstract type for type-level tag
<octachron> type opened = Opened_tag
<octachron> otherwise outside of the initial module, the typechecker cannot know if opened ≠ closed
<olle> Oh
<olle> Sure
mbuf has quit [Quit: Leaving]
adanwan_ has joined #ocaml
adanwan has quit [Ping timeout: 258 seconds]
spip has joined #ocaml
bobo_ has quit [Ping timeout: 268 seconds]
cedric has joined #ocaml
williewi` has joined #ocaml
adanwan_ has quit [Remote host closed the connection]
adanwan has joined #ocaml
xd1le has quit [Quit: xd1le]
<olle> Is there any difference between 'a and _ in a type, btw? Or `_` is used when it's not referenced? Hm.
<olle> type 'a foo = Heyo
olle has quit [Ping timeout: 265 seconds]
Serpent7776 has quit [Ping timeout: 268 seconds]
bartholin has quit [Quit: Leaving]
adanwan has quit [Remote host closed the connection]
adanwan has joined #ocaml
Tuplanolla has quit [Quit: Leaving.]
Haudegen has quit [Quit: No Ping reply in 180 seconds.]
Haudegen has joined #ocaml
<dh`> should be the same
spip has quit [Quit: Konversation terminated!]
spip has joined #ocaml
cedric has quit [Quit: Konversation terminated!]
rwmjones has quit [Quit: ZNC - 1.6.0 - http://znc.in]