-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
It's unclear how one should handle failures in previous steps. Is there any recommended way to do it?
Using the example from readme, what if Parse was instead FilePath -> Query (Either ParseError AST), what should happen in Typecheck if Parse returned Left?
data Query a where
Parse :: FilePath -> Query (Either ParseError AST)
Typecheck :: FilePath -> Query (Either TypeError TypedAST)
rules :: Rock.Rules Query
rules key = case key of
Parse file -> do
_ -- parse the file..
Typecheck file -> do
ast <- Rock.fetch (Parse file)
_ -- typecheck file..It seems sixten constructs a dummy value for result and uses Writer to store errors from previous steps. Are there other approaches?
Metadata
Metadata
Assignees
Labels
No labels