mirror of
https://github.com/google/ormolu.git
synced 2024-11-30 14:46:39 +03:00
85d5f78b4b
Goals: * Make the set of combinators clearer and smaller. * Solve a number of issues, such as those about parse failures related to patterns. * Solve the bug from #244. The idea is very simple, we stop doing this ( foo , bar ) and start doing this ( foo, bar ) * We switch to trailing commas which solves the indentation issues for patterns automatically. * The new general ‘sep’ combinator finally is clear enough, and all the old zoo of ‘velt’ and ‘velt'’ and ‘sepWith’, etc. which was confusing and overlapping goes away.
26 lines
430 B
Haskell
26 lines
430 B
Haskell
{-# LANGUAGE FunctionalDependencies #-}
|
|
|
|
-- | Something.
|
|
class (MonadReader r s, MonadWriter w m) => MonadState s m | m -> s where
|
|
|
|
get :: m s
|
|
|
|
put :: s -> m ()
|
|
|
|
-- | 'MonadParsec'
|
|
class
|
|
( Stream s, -- Token streams
|
|
MonadPlus m -- Potential for failure
|
|
)
|
|
=> MonadParsec e s m
|
|
| m -> e s where
|
|
|
|
-- | 'getState' returns state
|
|
getState
|
|
:: m s
|
|
|
|
-- | 'putState' sets state
|
|
putState
|
|
:: s
|
|
-> m ()
|