mirror of
https://github.com/github/semantic.git
synced 2024-12-23 06:41:45 +03:00
Align the arguments with the ::.
This commit is contained in:
parent
83a0d9c60e
commit
53bb412fd3
@ -228,20 +228,20 @@ showPos path Info.Pos{..} = maybe (showParen True (showString "interactive")) sh
|
||||
|
||||
-- | Run an assignment over an AST exhaustively.
|
||||
assignBy :: (Symbol grammar, Enum grammar, Eq grammar, Recursive ast, Foldable (Base ast), HasCallStack)
|
||||
=> (forall x. Base ast x -> Node grammar)
|
||||
-> Source.Source
|
||||
-> Assignment ast grammar a
|
||||
-> ast
|
||||
-> Either (Error grammar) a
|
||||
=> (forall x. Base ast x -> Node grammar)
|
||||
-> Source.Source
|
||||
-> Assignment ast grammar a
|
||||
-> ast
|
||||
-> Either (Error grammar) a
|
||||
assignBy toNode source assignment = fmap fst . runAssignment toNode source assignment . makeState . pure
|
||||
|
||||
-- | Run an assignment of nodes in a grammar onto terms in a syntax over an AST exhaustively.
|
||||
runAssignment :: forall grammar a ast. (Symbol grammar, Enum grammar, Eq grammar, Recursive ast, Foldable (Base ast), HasCallStack)
|
||||
=> (forall x. Base ast x -> Node grammar) -- ^ A function to project a 'Node' from the ast.
|
||||
-> Source.Source -- ^ The source for the parse tree.
|
||||
-> Assignment ast grammar a -- ^ The 'Assignment' to run.
|
||||
-> AssignmentState ast grammar -- ^ The current state.
|
||||
-> Either (Error grammar) (a, AssignmentState ast grammar) -- ^ 'Either' an 'Error' or the pair of the assigned value & updated state.
|
||||
=> (forall x. Base ast x -> Node grammar) -- ^ A function to project a 'Node' from the ast.
|
||||
-> Source.Source -- ^ The source for the parse tree.
|
||||
-> Assignment ast grammar a -- ^ The 'Assignment' to run.
|
||||
-> AssignmentState ast grammar -- ^ The current state.
|
||||
-> Either (Error grammar) (a, AssignmentState ast grammar) -- ^ 'Either' an 'Error' or the pair of the assigned value & updated state.
|
||||
runAssignment toNode source assignment state = go assignment state >>= requireExhaustive
|
||||
where go :: forall a
|
||||
. Assignment ast grammar a
|
||||
|
Loading…
Reference in New Issue
Block a user