-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9d2b9de
commit 6fd24c0
Showing
8 changed files
with
62 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
b.$.value;a | ||
field b2;field a0 | ||
field b xxx;field a0 | ||
field b1;field a1 | ||
field b2;field a2 | ||
field b xxx;field a2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,6 @@ dependencies: | |
- lens | ||
- lens-aeson | ||
- monad-loops | ||
- deque | ||
- hashable | ||
- deepseq | ||
- optparse-applicative | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module SequenceUtils where | ||
|
||
import Data.Foldable (find, toList) | ||
import qualified Data.List as L | ||
import qualified Data.Maybe as Mb (mapMaybe) | ||
import Data.Sequence | ||
import Prelude hiding (concat, elem, foldl, foldl', foldl1, mapM, null, (++)) | ||
|
||
maybeNes :: Seq a -> Maybe (Seq a) | ||
maybeNes = find (not . null) . Just | ||
|
||
uniq :: Eq a => Seq a -> Seq a | ||
uniq = fromList . L.nub . toList | ||
|
||
mapMaybe :: (a -> Maybe b) -> Seq a -> Seq b | ||
mapMaybe _ Empty = empty | ||
mapMaybe pred dq = | ||
fromList . Mb.mapMaybe pred . toList $ dq |