mirror of
https://github.com/github/semantic.git
synced 2024-11-29 11:02:26 +03:00
🔥 redundant parens.
This commit is contained in:
parent
cca474b0e9
commit
7aaaa6433c
@ -78,19 +78,19 @@ parseTermBuilder TermDotGraph = distributeFoldMap dotGraphTerm
|
|||||||
parseTermBuilder TermShow = distributeFoldMap showTerm
|
parseTermBuilder TermShow = distributeFoldMap showTerm
|
||||||
parseTermBuilder TermQuiet = distributeFoldMap quietTerm
|
parseTermBuilder TermQuiet = distributeFoldMap quietTerm
|
||||||
|
|
||||||
jsonTerm :: (ParseEffects sig m) => Blob -> m (Rendering.JSON.JSON "trees" SomeJSON)
|
jsonTerm :: ParseEffects sig m => Blob -> m (Rendering.JSON.JSON "trees" SomeJSON)
|
||||||
jsonTerm blob = (doParse blob >>= withSomeTerm (pure . renderJSONTerm blob)) `catchError` jsonError blob
|
jsonTerm blob = (doParse blob >>= withSomeTerm (pure . renderJSONTerm blob)) `catchError` jsonError blob
|
||||||
|
|
||||||
jsonError :: Applicative m => Blob -> SomeException -> m (Rendering.JSON.JSON "trees" SomeJSON)
|
jsonError :: Applicative m => Blob -> SomeException -> m (Rendering.JSON.JSON "trees" SomeJSON)
|
||||||
jsonError blob (SomeException e) = pure $ renderJSONError blob (show e)
|
jsonError blob (SomeException e) = pure $ renderJSONError blob (show e)
|
||||||
|
|
||||||
sexpTerm :: (ParseEffects sig m) => Blob -> m Builder
|
sexpTerm :: ParseEffects sig m => Blob -> m Builder
|
||||||
sexpTerm = doParse >=> withSomeTerm (serialize (SExpression ByConstructorName))
|
sexpTerm = doParse >=> withSomeTerm (serialize (SExpression ByConstructorName))
|
||||||
|
|
||||||
dotGraphTerm :: (ParseEffects sig m) => Blob -> m Builder
|
dotGraphTerm :: ParseEffects sig m => Blob -> m Builder
|
||||||
dotGraphTerm = doParse >=> withSomeTerm (serialize (DOT (termStyle "terms")) . renderTreeGraph)
|
dotGraphTerm = doParse >=> withSomeTerm (serialize (DOT (termStyle "terms")) . renderTreeGraph)
|
||||||
|
|
||||||
showTerm :: (ParseEffects sig m) => Blob -> m Builder
|
showTerm :: ParseEffects sig m => Blob -> m Builder
|
||||||
showTerm = doParse >=> withSomeTerm (serialize Show . quieterm)
|
showTerm = doParse >=> withSomeTerm (serialize Show . quieterm)
|
||||||
|
|
||||||
quietTerm :: (ParseEffects sig m, MonadIO m) => Blob -> m Builder
|
quietTerm :: (ParseEffects sig m, MonadIO m) => Blob -> m Builder
|
||||||
@ -112,7 +112,7 @@ type TermConstraints =
|
|||||||
, ToJSONFields1
|
, ToJSONFields1
|
||||||
]
|
]
|
||||||
|
|
||||||
doParse :: (ParseEffects sig m) => Blob -> m (SomeTerm TermConstraints Loc)
|
doParse :: ParseEffects sig m => Blob -> m (SomeTerm TermConstraints Loc)
|
||||||
doParse blob = case blobLanguage blob of
|
doParse blob = case blobLanguage blob of
|
||||||
Go -> SomeTerm <$> parse goParser blob
|
Go -> SomeTerm <$> parse goParser blob
|
||||||
Haskell -> SomeTerm <$> parse haskellParser blob
|
Haskell -> SomeTerm <$> parse haskellParser blob
|
||||||
|
Loading…
Reference in New Issue
Block a user