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

functoria: Constraint the start function to 'unit Lwt.t' #1524

Merged
merged 2 commits into from
May 5, 2024

Commits on May 1, 2024

  1. functoria: Constraint the start function to 'unit Lwt.t'

    This allows to catch subtle bugs caused by partial applications or by
    returning 'unit Lwt.t Lwt.t' using the type-system.
    Julow committed May 1, 2024
    Configuration menu
    Copy the full SHA
    7da68bf View commit details
    Browse the repository at this point in the history
  2. functoria: Better type-error for the start function

    With this change, the error message is no longer about the pattern and
    looks clearer.
    
    Unfortunately, the location is still within generated code. This also
    requires adding the `'a io` type in the prelude.
    
        File "bin/mirage/mirage/main.ml", lines 300-305, characters 3-12:
        Error: This expression has type (unit, 'a) result Lwt.t
               but an expression was expected of type unit start = unit Lwt.t
               Type (unit, 'a) result is not compatible with type unit
    Julow committed May 1, 2024
    Configuration menu
    Copy the full SHA
    2f9ed65 View commit details
    Browse the repository at this point in the history