-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
The definitions of singlet and Mu can only work on types that do not have a parameter. This is not a bug, but it's a limitation in the definitions.
A parametrized type is a function on types, and a function is not a type. Hence the e in singlet e and Mu t. e cannot be a parametrized/higher-kinded type. It must only be an expression that evaluates to a type.
Here are practical cases for wanting them to work with parametrized types.
let F : (S : sig val t : type -> type end) -> (sig val t : singlet S.t end) =
fun S -> struct
let t = S.t
endThis is more readable (to me) as the following.
let F : (S : sig val t : type -> type end) -> (sig val t = S.t end) =
fun S -> struct
let t = S.t
endAny parametrized recursive type must be written as a recursive function, which works just fine but messes with some heuristics we use for performance.
let rec t a = e... might be better written as ...
let t = Mu t a. eor
let t = Mu t. fun a -> eif possible. I think this is similarly as difficult to fix as the singlet issue.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels