gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.1 http://bit.ly/nNVIVH
<thelema> Drakken: I think the big thing about gadts is that they can be recursive without being regular
<thelema> i.e. type [] t = ... <> t ...
<thelema> without gadt, [] has to be the same as <>
<Drakken> thelema that's if you think of a gadt as a single type.
<Drakken> Can you put [] t's and <> t's in the same list?
<thelema> if they're the same then yes. It's a parameterized type
<thelema> just like list - you can't put int lists and float lists into the same array
<Drakken> wait... yes you can put value with different parameter types together in the same list?
<thelema> in general, no.
<thelema> but with phantom types, you can.
<thelema> because the underlying type is the same
<Drakken> but you're not supposed to, are you? Isn't the point phantom types to create an interface that prevents that?
<Drakken> the point OF phantom types
<Drakken> Irregular recursion looks to me like some kind _mutual_ recursion among _several_ types,
<Drakken> and the gadt just defines a family of related types.
<dsheets> but it enforces the equality so you don't have to write unreachable error cases?
<Drakken> some kind OF ...
<Drakken> so a gadt function with a type variable is just a way of implementing ad-hoc polymorphism, over the parameter.
<Drakken> dsheets equality of what?
<dsheets> Drakken: equality of type variable and type parameter
<Drakken> right. which seems basically equivalent to ad-hoc polymorphism plus a cluster of related type defs.
<dsheets> i'm still on 3.12, though, so i've only looked never tinkered, unfortunately. I am speculating and trying to learn
<dsheets> something like a local type class with instances by type parameter?
<dsheets> for modeling type systems, it takes out the universal sum type constructors and impossible cases?
<Drakken> hmm. they do seem like type classes.
<Drakken> except you can add new functions anywhere.
<Drakken> and the different types are closely related to each other.
<dsheets> yes, it seems like there is some overlap but it covers a different part of the design space
<dsheets> of course, my type class experience is not very extensive so i am unclear on the specific benefits to modeling that gadts offer over type classes and vice versa...
<Drakken> type classes are (all or mostly) about ad-hoc polymorphism.
<Drakken> gadts are about the interrelationships between the types defined by the constructors in the gadt.
<Drakken> they're used for things like parse trees, where you want to impose restrictions on which variants can contain which other variants.
<dsheets> right… that seems incredibly powerful but i'm not sure i understand the essence of them until I have played around with 4.0 enough… what sorts of equality constraints can you use? can you use row parameters of object types? open polymorphic variants? first class modules with sub-interfaces?
<dsheets> or does the gadt syntax restrict the equalities you can express in some way that i haven't grasped?
thelema_ has joined #ocaml
<Drakken> I think the constructors can have any kind of signature.
<Drakken> but they're usually related to each other.
thelema has quit [Ping timeout: 240 seconds]
ulfdoz_ has joined #ocaml
ulfdoz has quit [Ping timeout: 265 seconds]
ulfdoz_ is now known as ulfdoz
BiDOrD_ has joined #ocaml
BiDOrD has quit [Ping timeout: 252 seconds]
struktured has quit [Ping timeout: 244 seconds]
ftrvxmtrx has quit [Ping timeout: 246 seconds]
emmanuelux has quit [Ping timeout: 246 seconds]
ftrvxmtrx has joined #ocaml
zorun has quit [*.net *.split]
bobry has quit [*.net *.split]
Hodapp has quit [*.net *.split]
Asmadeus has quit [*.net *.split]
Ptival has quit [*.net *.split]
r126f has quit [*.net *.split]
wieczyk has quit [*.net *.split]
Hodapp has joined #ocaml
r126f has joined #ocaml
Asmadeus has joined #ocaml
zorun has joined #ocaml
wieczyk has joined #ocaml
bobry has joined #ocaml
Ptival has joined #ocaml
ivan\ has quit [Ping timeout: 244 seconds]
ivan\ has joined #ocaml
err404 has quit [Remote host closed the connection]
<dsheets> ugh recursive ocaml -> js is pain
sepp2k has quit [Remote host closed the connection]
cdidd has joined #ocaml
ankit9_ has joined #ocaml
ankit9_ has quit [Client Quit]
Progster has quit [Ping timeout: 248 seconds]
eni has joined #ocaml
<adrien> morning
Submarine has joined #ocaml
ankit9 has quit [Quit: Leaving]
ftrvxmtrx has quit [Quit: Leaving]
Submarine has quit [Ping timeout: 252 seconds]
<orbitz> morn
cago has joined #ocaml
mika1 has joined #ocaml
ankit9 has joined #ocaml
hto_ has quit [Quit: leaving]
ftrvxmtrx has joined #ocaml
djcoin has joined #ocaml
pango is now known as pangoafk
silver has joined #ocaml
ankit9 has quit [Quit: Leaving]
ankit9 has joined #ocaml
Cyanure has joined #ocaml
Progster has joined #ocaml
Submarine has joined #ocaml
eni has quit [Read error: No route to host]
eni has joined #ocaml
Progster has quit [Ping timeout: 240 seconds]
ankit9 has quit [Quit: Leaving]
zorun has quit [Read error: Connection reset by peer]
zorun has joined #ocaml
eikke has joined #ocaml
<Drakken> Is there a way to compare a Camlp4 ast node to a quotation that ignores the locations?
<Drakken> Camlp4 seems to rely on quotations as much as possible, but it seems like you have to either compare quotations with quotations, so they have the same location, or write out the ast code explicitly.
edwin has joined #ocaml
edwin has left #ocaml []
avsm has joined #ocaml
Ptival has quit [Read error: Connection reset by peer]
avsm1 has joined #ocaml
avsm has quit [Read error: Connection reset by peer]
Ptival has joined #ocaml
avsm has joined #ocaml
avsm1 has quit [Read error: Connection reset by peer]
avsm has quit [Quit: Leaving.]
Associ8or has joined #ocaml
Associ8or has left #ocaml []
Anarchos has joined #ocaml
ankit9 has joined #ocaml
eikke has quit [Ping timeout: 240 seconds]
chambart has joined #ocaml
Cyanure has quit [Remote host closed the connection]
Cyanure has joined #ocaml
eni has quit [Ping timeout: 240 seconds]
mcclurmc has quit [Read error: Connection reset by peer]
mcclurmc has joined #ocaml
eikke has joined #ocaml
_andre has joined #ocaml
mcclurmc has quit [Read error: Connection reset by peer]
mcclurmc has joined #ocaml
avsm has joined #ocaml
emmanuelux has joined #ocaml
alexey has quit [Quit: leaving]
avsm1 has joined #ocaml
avsm has quit [Read error: Connection reset by peer]
hto has quit [Quit: leaving]
hto has joined #ocaml
ocp has joined #ocaml
avsm has joined #ocaml
avsm1 has quit [Read error: Connection reset by peer]
avsm has quit [Client Quit]
gnuvince has quit [Ping timeout: 250 seconds]
xcombelle has joined #ocaml
emmanuelux has quit [Ping timeout: 246 seconds]
BiDOrD_ has quit [Remote host closed the connection]
BiDOrD has joined #ocaml
Progster has joined #ocaml
ankit9 has quit [Quit: Leaving]
gnuvince has joined #ocaml
bobzhang has joined #ocaml
hto has quit [Quit: Lost terminal]
<hongboz> Drakken: you can strip the location while Ast.map
hto has joined #ocaml
sepp2k has joined #ocaml
smondet has joined #ocaml
hongboz has quit [Remote host closed the connection]
eni has joined #ocaml
smondet has quit [Read error: Connection reset by peer]
ankit9 has joined #ocaml
smondet has joined #ocaml
hongboz has joined #ocaml
Submarine has quit [Remote host closed the connection]
mrm has joined #ocaml
<Drakken> honboz right, thank you.
Anarchos has quit [Ping timeout: 246 seconds]
cago has quit [Quit: Leaving.]
mika1 has quit [Quit: Leaving.]
eikke has quit [Ping timeout: 252 seconds]
eikke has joined #ocaml
djcoin has quit [Quit: WeeChat 0.3.2]
Cyanure has quit [Ping timeout: 246 seconds]
rossberg has quit [Ping timeout: 240 seconds]
silver has quit [Remote host closed the connection]
hto has quit [Quit: Lost terminal]
hto has joined #ocaml
hto has quit [Client Quit]
hto has joined #ocaml
osa1 has joined #ocaml
eni has quit [Ping timeout: 255 seconds]
ftrvxmtrx has quit [Quit: Leaving]
osa1 has quit [Ping timeout: 246 seconds]
pangoafk is now known as pango
Anarchos has joined #ocaml
ocp has quit [Ping timeout: 248 seconds]
hto has quit [Quit: Lost terminal]
hto has joined #ocaml
eikke has quit [Ping timeout: 248 seconds]
mrm has quit [Read error: Operation timed out]
emmanuelux has joined #ocaml
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
beckerb has quit [Read error: Operation timed out]
eikke has joined #ocaml
ChristopheT has joined #ocaml
xcombelle has quit [Quit: I am a manual virus, please copy me to your quit message.]
Tobu_ has quit [Ping timeout: 272 seconds]
Tobu has joined #ocaml
ftrvxmtrx has joined #ocaml
gnuvince has quit [Ping timeout: 248 seconds]
iago has joined #ocaml
_andre has quit [Quit: leaving]
gnuvince has joined #ocaml
ankit9 has quit [Ping timeout: 244 seconds]
oriba has joined #ocaml
ankit9 has joined #ocaml
Cyanure has joined #ocaml
smondet has quit [Quit: Leaving]
ftrvxmtrx has quit [Quit: Leaving]
wmeyer has joined #ocaml
<wmeyer> pippijn: I had a go with Cquot
<wmeyer> not yet integrated with your parser
<wmeyer> but somewhat good starting point
<Anarchos> wmeyer what is the point of CQuot ?
<pippijn> wmeyer: nice
<pippijn> Anarchos: do you know what it is?
ftrvxmtrx has joined #ocaml
<wmeyer> Anarchos: Pipjin has developed a C clean frontend - the idea with Cquot is to provide Camlp4 quotations that are able to generate ASTs out of quoted concrete C syntax which then in turn can be passed and pretty printed or composed with other code fragment
<wmeyer> very often you want to generate some C code and pretty print, usually by re-implementing the partial C AST, working even with partial AST to then pretty print or transform it is very troublesome - way better stay quoted and use concrete syntax
<wmeyer> Pippijn AST definitions helps a lot to do this
<wmeyer> + parser, that can turn the concrete syntax to ASTs
<wmeyer> so you should be able to say
<wmeyer> let main a = <:ctopl< int main () { return $int:a$ } >> in main 42;;
<wmeyer> and that will create the AST for this fragment, that you can later pretty print for instance, or compose with other fragment
wmeyer has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
ChristopheT has left #ocaml []
BiDOrD_ has joined #ocaml
eikke has quit [Ping timeout: 244 seconds]
BiDOrD has quit [Ping timeout: 265 seconds]
Progster has quit [Ping timeout: 250 seconds]
Anarchos has quit [Ping timeout: 246 seconds]
sepp2k has quit [Remote host closed the connection]
ImAlsoGreg has joined #ocaml
Cyanure has quit [Remote host closed the connection]