Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typage explicite avec types de foncteurs #8080

Closed
vicuna opened this issue Mar 28, 2003 · 1 comment
Closed

typage explicite avec types de foncteurs #8080

vicuna opened this issue Mar 28, 2003 · 1 comment

Comments

@vicuna
Copy link

vicuna commented Mar 28, 2003

Original bug ID: 1614
Reporter: administrator
Status: acknowledged
Resolution: open
Priority: normal
Severity: feature
Category: typing

Bug description

salut a vous,

Voici un probleme a propos des types de foncteurs: on ne
peut pas y associer a posteriori une expression "with type".

Je ne pense pas que ce soit reellement un bug (en tous cas
la doc est coherente dans son traitement differenci'e des
signatures et des types de foncteurs). Mais le
fonctionnement actuel rend peut-etre inutilement asymetrique
l'utilisation du typage explicite pour les foncteurs et les
modules simples.

Exemple:

module type S = sig end
module type SF = functor (M: S) -> sig type t val v : t end;;
module F : SF =
   functor (M: S) -> struct type t = int let v = 3 let w = 4 end;;
module M = F (struct end);;

Ce qui donne a l'utilisation:

# M.v;;
- : M.t = <abstr>
# M.w;;
Unbound value M.w

On a donc ici un effet identique au typage explicite avec
signature simple: masquage du type abstrait t et masquage
des champs qui n'apparaissent pas dans la signature du
module resultat.

Mais le parallele s'arrete l`a puisqu'on ne peut pas ajouter
une expression "with type" pour e.g. rendre concret a
posteriori le type t:

module F : SF with type t = int =
    functor (M: S) -> struct type t = int let v = 3 end ;;

Avec un message d'erreur:

  module F : SF with type t = int =
              ^^
This module type is not a signature

pn

@github-actions
Copy link

github-actions bot commented May 6, 2020

This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.

@github-actions github-actions bot added the Stale label May 6, 2020
@github-actions github-actions bot closed this as completed Jun 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant