mirror of
https://github.com/github/semantic.git
synced 2024-11-28 10:15:55 +03:00
Add a Show instance over BranchElement.
This commit is contained in:
parent
3aaa9f79ca
commit
419bcfe776
@ -214,6 +214,11 @@ instance Arbitrary Child where
|
||||
instance Show Child where
|
||||
show Child {..} = childMargin ++ "(" ++ childKey ++ childContents ++ ")"
|
||||
|
||||
instance Show BranchElement where
|
||||
show (Child' key contents) = show (showContents <$> contents)
|
||||
where showContents contents = "(" ++ key ++ contents ++ ")"
|
||||
show (Margin contents) = show contents
|
||||
|
||||
counts :: [Join These (Int, a)] -> Both Int
|
||||
counts numbered = fromMaybe 0 . getLast . mconcat . fmap Last <$> Join (unalign (runJoin . fmap Prelude.fst <$> numbered))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user