mirror of
https://github.com/github/semantic.git
synced 2024-12-22 22:31:36 +03:00
Relax eval constaints for more choice in control flow
This commit is contained in:
parent
355ec2aa5e
commit
e336e8735e
@ -23,8 +23,8 @@ import Prelude hiding (fail)
|
||||
|
||||
-- Collecting evaluator
|
||||
class Monad m => Eval term v m constr where
|
||||
eval :: ((v -> m v) -> term -> m v) -> (v -> m w) -> constr term -> m w
|
||||
default eval :: (MonadFail m, Show1 constr) => ((v -> m v) -> term -> m v) -> (v -> m w) -> constr term -> m w
|
||||
eval :: ((v -> m v) -> term -> m v) -> ((v -> m v) -> constr term -> m v)
|
||||
default eval :: (MonadFail m, Show1 constr) => ((v -> m v) -> term -> m v) -> ((v -> m v) -> constr term -> m v)
|
||||
eval _ _ expr = fail $ "Eval unspecialized for " ++ liftShowsPrec (const (const id)) (const id) 0 expr ""
|
||||
|
||||
instance (Monad m, Apply (Eval t v m) fs) => Eval t v m (Union fs) where
|
||||
|
Loading…
Reference in New Issue
Block a user