caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Reasoning about categories at compile-time.
@ 2011-03-30 22:27 Guillaume Yziquel
  2011-03-31  6:02 ` Gabriel Scherer
  0 siblings, 1 reply; 5+ messages in thread
From: Guillaume Yziquel @ 2011-03-30 22:27 UTC (permalink / raw)
  To: caml-list

Hello.

I have a small problem that I would wish to encode in the type system,
and I would like some advice on how to do that using Camlp4.

You have a finite category (in the sense of a finite number of objects),
and a finite set of arrows that generates all the arrows. Let's assume
that you have tokens (Camlp4 a_LIDENT) for all of these.

I want my Camlp4 syntax extension to operate on an .mli interface file
and an .ml file.

The .mli interface should contain all the relations you want to enforce
concerning composition of arrows.

The .ml file should contain some relations about composition of arrows.

If I compile the preprocessed .ml file against the preprocessed .mli
file, I want it to type check if and only if all relations in the .mli
file can be deduced from relations in the .mli file.

If, for instance the unprocessed .mli file contains

	f o g o h = i o j o k

and the unprocessed .ml file contains

	f o g = i
	h = j o k

I want it to type check fine. I you ommit h = j o k, I want the type
checker to fail.

This is purely type-system-ish, and I really do not care how arrows are
encoded (types, type parameters, fun (type arrow) -> stuff).

Is there a way to use Camlp4 to encode this in the type system?
Intuitively, I'd say yes, but I currently do not see how.

-- 
     Guillaume Yziquel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-04-03 21:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-30 22:27 [Caml-list] Reasoning about categories at compile-time Guillaume Yziquel
2011-03-31  6:02 ` Gabriel Scherer
2011-03-31 23:46   ` Guillaume Yziquel
2011-04-03  7:25     ` Andrej Bauer
2011-04-03 21:03       ` Guillaume Yziquel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).