-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CN: Use simpler, custom monad for WellTyped
This commit removes functor from around the implementation of WellTyped, and uses a simpler Error and Reader monad based only on Context.t, hence no solver. Like Global, it also provides an transformer functor to lift its exposed monadic API to a give target.
- Loading branch information
Showing
3 changed files
with
247 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,23 @@ | ||
val use_ity : bool ref | ||
|
||
module Make : functor (Monad : Sigs.NoSolver) -> sig | ||
module Exposed : Sigs.Exposed with type 'a t := 'a Monad.t | ||
module NoSolver : Sigs.NoSolver | ||
|
||
module Exposed : Sigs.Exposed with type 'a t := 'a NoSolver.t | ||
|
||
module type ErrorReader = sig | ||
type 'a t | ||
|
||
val return : 'a -> 'a t | ||
|
||
val bind : 'a t -> ('a -> 'b t) -> 'b t | ||
|
||
type state | ||
|
||
val get : unit -> state t | ||
|
||
val to_context : state -> Context.t | ||
|
||
val lift : 'a Or_TypeError.t -> 'a t | ||
end | ||
|
||
module Lift : functor (M : ErrorReader) -> Sigs.Exposed with type 'a t := 'a M.t |