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

Fix MPR#7414 #929

Merged
merged 2 commits into from Nov 21, 2016
Merged

Fix MPR#7414 #929

merged 2 commits into from Nov 21, 2016

Conversation

garrigue
Copy link
Contributor

Fix MPR#7414.
The problem was that non-generalizable variable lowering, introduced in 4.04 for modules, didn't work for functors.
The first attempt uses Subst.modtype for its side-effect.

@garrigue garrigue merged commit 2bd2296 into ocaml:trunk Nov 21, 2016
@gasche
Copy link
Member

gasche commented Feb 24, 2017

@vprevosto linked this fix to a typing regression for his (safe) codebase on the caml-list:

module Foo : sig
  module M(E: sig type t end) : sig
  type t
  val u: t -> t -> t
  end
end = struct
  module M(E: sig type t end) = struct
  type t = (E.t, unit) Hashtbl.t
  let u = Hashtbl.fold (fun x () h -> Hashtbl.add h x (); h)
  end
end

If I understand correctly, this regression is expected and users have to change their code -- this is what we concluded for the non-functor case in MPR#7313, MP#7401.

@gasche
Copy link
Member

gasche commented Feb 25, 2017

For the record, other OCaml software that have to be fixed after this change are camomile (opam-builder report) and fury-puyo (opam-builder report). I am planning on sending patches to the affected packages.

@garrigue
Copy link
Contributor Author

garrigue commented Mar 1, 2017

Indeed, this is a typical case of signature annotation outside of module with nesting, which requires a more local annotation since 4.04.

@thierry-martinez
Copy link
Contributor

Coccinelle has also to be fixed. Here is another bit of code that was correctly typed by 4.04 and is now rejected with 4.05 beta.

module type S = sig
  type 'a t = N

  val r: (unit -> unit t) ref
end

module F (X: S) = struct
end

module M = struct
  type 'a t = N

  let r = ref (fun () -> raise Not_found)
end

module N = F (M)

camlspotter pushed a commit to camlspotter/ocaml that referenced this pull request Oct 17, 2017
* Fix PR#7414 by adding Mtype.lower_nongen
EmileTrotignon pushed a commit to EmileTrotignon/ocaml that referenced this pull request Jan 12, 2024

Changes the caching strategy for assets.

All assets {PATH} (e.g. css/main.css) are now served under two URLs:

1. /{PATH} (Cache-control header allows caching for 1 day)
2. /_/{DIGEST}/{PATH} (Cache-control header allows caching for a very long time and declares the file immutable)

Digests are looked up via assets.ml (produced by ocaml-crunch with mode plain). They are a hash of the file content.

In the templates, there is now a parameter digest_url : string -> string which renders the path containing the digest (only for assets from assets.ml, as we do not expect files from media.ml to change).

Note: Cache-control: immutable tells the browser that checking whether the file was modified is unnecessary.

Resolves ocaml#839 except for the playground.

Note that, since inter.css has a relative import for the font files, all the font files are served under inter.css's digest. So, if anyone ever needs to update the font files, they have to modify inter.css to change its digest.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants