caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Guillaume Yziquel <guillaume.yziquel@citycable.ch>
To: caml-list@inria.fr
Subject: [Caml-list] Reasoning about categories at compile-time.
Date: Thu, 31 Mar 2011 00:27:04 +0200	[thread overview]
Message-ID: <20110330222702.GF20598@localhost> (raw)

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

             reply	other threads:[~2011-03-30 22:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-30 22:27 Guillaume Yziquel [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110330222702.GF20598@localhost \
    --to=guillaume.yziquel@citycable.ch \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).