packages feed

talash 0.1.0.1 → 0.1.1.0

raw patch · 5 files changed

+21/−12 lines, 5 filesdep ~basedep ~bytestringdep ~containersPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: base, bytestring, containers, intro, text, vector

API changes (from Hackage documentation)

+ Talash.Files: [dirFiles] :: FileTree a -> Vector a
+ Talash.Files: [rootDir] :: FileTree a -> a
+ Talash.Files: [subDirs] :: FileTree a -> Vector (FileTree a)
- Talash.Brick: allMatches :: forall a_auvg. Lens' (Searcher a_auvg) (IORef (Vector Int))
+ Talash.Brick: allMatches :: forall a_auzV. Lens' (Searcher a_auzV) (IORef (Vector Int))
- Talash.Brick: candidates :: forall a_auDs. Lens' (SearchEnv a_auDs) (Vector Text)
+ Talash.Brick: candidates :: forall a_auI7. Lens' (SearchEnv a_auI7) (Vector Text)
- Talash.Brick: displayer :: forall a_at55 n_at57. KnownNat n_at57 => SimpleGetter (SearchFunctions a_at55) (MatcherSized n_at57 a_at55 -> Text -> Vector n_at57 Int -> [Text])
+ Talash.Brick: displayer :: forall a_at9z n_at9B. KnownNat n_at9B => SimpleGetter (SearchFunctions a_at9z) (MatcherSized n_at9B a_at9z -> Text -> Vector n_at9B Int -> [Text])
- Talash.Brick: eventSource :: forall a_auDs. Lens' (SearchEnv a_auDs) (BChan SearchEvent)
+ Talash.Brick: eventSource :: forall a_auI7. Lens' (SearchEnv a_auI7) (BChan SearchEvent)
- Talash.Brick: hooks :: forall a_auJs b_auJt a_auKU b_auKV. Lens (AppSettings a_auJs b_auJt) (AppSettings a_auKU b_auKV) (ReaderT (SearchEnv a_auJs) EventHooks (Searcher b_auJt)) (ReaderT (SearchEnv a_auKU) EventHooks (Searcher b_auKV))
+ Talash.Brick: hooks :: forall a_auO7 b_auO8 a_auPz b_auPA. Lens (AppSettings a_auO7 b_auO8) (AppSettings a_auPz b_auPA) (ReaderT (SearchEnv a_auO7) EventHooks (Searcher b_auO8)) (ReaderT (SearchEnv a_auPz) EventHooks (Searcher b_auPA))
- Talash.Brick: lister :: forall a_at55 n_at56. KnownNat n_at56 => SimpleGetter (SearchFunctions a_at55) (MatcherSized n_at56 a_at55 -> Vector Text -> Vector Int -> (Vector Int, Vector (Indices n_at56)))
+ Talash.Brick: lister :: forall a_at9z n_at9A. KnownNat n_at9A => SimpleGetter (SearchFunctions a_at9z) (MatcherSized n_at9A a_at9z -> Vector Text -> Vector Int -> (Vector Int, Vector (Indices n_at9A)))
- Talash.Brick: makeMatcher :: forall a_at55. Lens' (SearchFunctions a_at55) (Text -> Maybe (Matcher a_at55))
+ Talash.Brick: makeMatcher :: forall a_at9z. Lens' (SearchFunctions a_at9z) (Text -> Maybe (Matcher a_at9z))
- Talash.Brick: matches :: forall a_auvg. Lens' (Searcher a_auvg) (List Bool [Text])
+ Talash.Brick: matches :: forall a_auzV. Lens' (Searcher a_auzV) (List Bool [Text])
- Talash.Brick: numMatches :: forall a_auvg. Lens' (Searcher a_auvg) Int
+ Talash.Brick: numMatches :: forall a_auzV. Lens' (Searcher a_auzV) Int
- Talash.Brick: prevQuery :: forall a_auvg. Lens' (Searcher a_auvg) (Maybe Text)
+ Talash.Brick: prevQuery :: forall a_auzV. Lens' (Searcher a_auzV) (Maybe Text)
- Talash.Brick: query :: forall a_auvg. Lens' (Searcher a_auvg) (Editor Text Bool)
+ Talash.Brick: query :: forall a_auzV. Lens' (Searcher a_auzV) (Editor Text Bool)
- Talash.Brick: searchFunctions :: forall a_auDs a_auER. Lens (SearchEnv a_auDs) (SearchEnv a_auER) (SearchFunctions a_auDs) (SearchFunctions a_auER)
+ Talash.Brick: searchFunctions :: forall a_auI7 a_auJw. Lens (SearchEnv a_auI7) (SearchEnv a_auJw) (SearchFunctions a_auI7) (SearchFunctions a_auJw)
- Talash.Brick: theme :: forall a_auJs b_auJt. Lens' (AppSettings a_auJs b_auJt) AppTheme
+ Talash.Brick: theme :: forall a_auO7 b_auO8. Lens' (AppSettings a_auO7 b_auO8) AppTheme
- Talash.Brick: wait :: forall a_auvg. Lens' (Searcher a_auvg) (Maybe ThreadId)
+ Talash.Brick: wait :: forall a_auzV. Lens' (Searcher a_auzV) (Maybe ThreadId)
- Talash.Brick.Columns: allMatches :: forall a_akQS. Lens' (Searcher a_akQS) (IORef (Vector Int))
+ Talash.Brick.Columns: allMatches :: forall a_akQl. Lens' (Searcher a_akQl) (IORef (Vector Int))
- Talash.Brick.Columns: candidates :: forall a_al5g. Lens' (SearchEnv a_al5g) (Vector Text)
+ Talash.Brick.Columns: candidates :: forall a_al4J. Lens' (SearchEnv a_al4J) (Vector Text)
- Talash.Brick.Columns: displayer :: forall a_akOM n_akON. KnownNat n_akON => SimpleGetter (SearchFunctions a_akOM) (MatcherSized n_akON a_akOM -> Text -> Vector n_akON Int -> [[Text]])
+ Talash.Brick.Columns: displayer :: forall a_akOf n_akOg. KnownNat n_akOg => SimpleGetter (SearchFunctions a_akOf) (MatcherSized n_akOg a_akOf -> Text -> Vector n_akOg Int -> [[Text]])
- Talash.Brick.Columns: eventSource :: forall a_al5g. Lens' (SearchEnv a_al5g) (BChan SearchEvent)
+ Talash.Brick.Columns: eventSource :: forall a_al4J. Lens' (SearchEnv a_al4J) (BChan SearchEvent)
- Talash.Brick.Columns: hooks :: forall a_aldz b_aldA a_alfz b_alfA. Lens (AppSettings a_aldz b_aldA) (AppSettings a_alfz b_alfA) (ReaderT (SearchEnv a_aldz) EventHooks (Searcher b_aldA)) (ReaderT (SearchEnv a_alfz) EventHooks (Searcher b_alfA))
+ Talash.Brick.Columns: hooks :: forall a_ald2 b_ald3 a_alf2 b_alf3. Lens (AppSettings a_ald2 b_ald3) (AppSettings a_alf2 b_alf3) (ReaderT (SearchEnv a_ald2) EventHooks (Searcher b_ald3)) (ReaderT (SearchEnv a_alf2) EventHooks (Searcher b_alf3))
- Talash.Brick.Columns: lister :: forall a_akOM n_akOO. KnownNat n_akOO => SimpleGetter (SearchFunctions a_akOM) (MatcherSized n_akOO a_akOM -> Vector Text -> Vector Int -> (Vector Int, Vector (Indices n_akOO)))
+ Talash.Brick.Columns: lister :: forall a_akOf n_akOh. KnownNat n_akOh => SimpleGetter (SearchFunctions a_akOf) (MatcherSized n_akOh a_akOf -> Vector Text -> Vector Int -> (Vector Int, Vector (Indices n_akOh)))
- Talash.Brick.Columns: makeMatcher :: forall a_akOM. Lens' (SearchFunctions a_akOM) (Text -> Maybe (Matcher a_akOM))
+ Talash.Brick.Columns: makeMatcher :: forall a_akOf. Lens' (SearchFunctions a_akOf) (Text -> Maybe (Matcher a_akOf))
- Talash.Brick.Columns: matches :: forall a_akQS. Lens' (Searcher a_akQS) (List Bool [[Text]])
+ Talash.Brick.Columns: matches :: forall a_akQl. Lens' (Searcher a_akQl) (List Bool [[Text]])
- Talash.Brick.Columns: numMatches :: forall a_akQS. Lens' (Searcher a_akQS) Int
+ Talash.Brick.Columns: numMatches :: forall a_akQl. Lens' (Searcher a_akQl) Int
- Talash.Brick.Columns: prevQuery :: forall a_akQS. Lens' (Searcher a_akQS) (Maybe Text)
+ Talash.Brick.Columns: prevQuery :: forall a_akQl. Lens' (Searcher a_akQl) (Maybe Text)
- Talash.Brick.Columns: query :: forall a_akQS. Lens' (Searcher a_akQS) (Editor Text Bool)
+ Talash.Brick.Columns: query :: forall a_akQl. Lens' (Searcher a_akQl) (Editor Text Bool)
- Talash.Brick.Columns: searchFunctions :: forall a_al5g a_al6F. Lens (SearchEnv a_al5g) (SearchEnv a_al6F) (SearchFunctions a_al5g) (SearchFunctions a_al6F)
+ Talash.Brick.Columns: searchFunctions :: forall a_al4J a_al68. Lens (SearchEnv a_al4J) (SearchEnv a_al68) (SearchFunctions a_al4J) (SearchFunctions a_al68)
- Talash.Brick.Columns: theme :: forall a_aldz b_aldA. Lens' (AppSettings a_aldz b_aldA) AppTheme
+ Talash.Brick.Columns: theme :: forall a_ald2 b_ald3. Lens' (AppSettings a_ald2 b_ald3) AppTheme
- Talash.Brick.Columns: wait :: forall a_akQS. Lens' (Searcher a_akQS) (Maybe ThreadId)
+ Talash.Brick.Columns: wait :: forall a_akQl. Lens' (Searcher a_akQl) (Maybe ThreadId)
- Talash.Files: Dir :: !a -> !Vector a -> !Vector (FileTree a) -> FileTree a
+ Talash.Files: Dir :: a -> Vector a -> Vector (FileTree a) -> FileTree a
- Talash.Piped: displayer :: forall a_at55 n_at57. KnownNat n_at57 => SimpleGetter (SearchFunctions a_at55) (MatcherSized n_at57 a_at55 -> Text -> Vector n_at57 Int -> [Text])
+ Talash.Piped: displayer :: forall a_at9z n_at9B. KnownNat n_at9B => SimpleGetter (SearchFunctions a_at9z) (MatcherSized n_at9B a_at9z -> Text -> Vector n_at9B Int -> [Text])
- Talash.Piped: lister :: forall a_at55 n_at56. KnownNat n_at56 => SimpleGetter (SearchFunctions a_at55) (MatcherSized n_at56 a_at55 -> Vector Text -> Vector Int -> (Vector Int, Vector (Indices n_at56)))
+ Talash.Piped: lister :: forall a_at9z n_at9A. KnownNat n_at9A => SimpleGetter (SearchFunctions a_at9z) (MatcherSized n_at9A a_at9z -> Vector Text -> Vector Int -> (Vector Int, Vector (Indices n_at9A)))
- Talash.Piped: makeMatcher :: forall a_at55. Lens' (SearchFunctions a_at55) (Text -> Maybe (Matcher a_at55))
+ Talash.Piped: makeMatcher :: forall a_at9z. Lens' (SearchFunctions a_at9z) (Text -> Maybe (Matcher a_at9z))

Files

CHANGELOG.md view
@@ -7,3 +7,8 @@ ## 0.1.0.1 -- 20121-05-28  * Minor internal changes to relax bounds on bytestring. Enables building with ghc-8.10.2. ++## 0.1.1.0 -- 20121-06-05++* FileTree is now a record.+* Some internal changes to get it to build on somewhat older versions of ghc. Tested with 8.2.2 
app/Main.hs view
@@ -2,6 +2,7 @@  import qualified Talash.Brick as B import qualified Talash.Piped as P+import Intro import System.Environment (getArgs)  run :: [String] -> IO ()@@ -9,7 +10,7 @@ run ("tui"  :xs) = B.run' xs run  _           = putStrLn usageString -usageString :: String+usageString :: Text usageString =    "talash is the demo program for the talash library. It has two set of subcommand:\n"               <> "talash tui : for the terminal user interface, use 'talash tui help' for details.\n"               <> "talash piped : for the piped interface, use 'talash piped help' for details.\n"
src/Talash/Core.hs view
@@ -27,6 +27,7 @@ import qualified Data.Vector.Unboxed.Mutable as M import qualified Data.Vector.Unboxed.Sized as S import GHC.TypeNats+import Prelude (fromIntegral) import Intro import Lens.Micro (_1 , _2 , (^.)) @@ -131,7 +132,7 @@                     -> Maybe (Matcher a) -- ^ Nothing if the string is empty or if the number of needles turns out to be non-positive makeMatcher c lenf matf t   | T.null t || lenf t <= 0                                    = Nothing-  | SomeNat p <- someNatVal . fromIntegralUnsafe . lenf $ t    = Just . Matcher . matf p c $ t+  | SomeNat p <- someNatVal . fromIntegral. lenf $ t    = Just . Matcher . matf p c $ t  {-# INLINE withSensitivity #-} withSensitivity :: CaseSensitivity -> Text -> Text
src/Talash/Files.hs view
@@ -36,9 +36,9 @@                     -- | The list of directories to which this configuration should apply.                     dirsLocal :: [ByteString]} -data FileTree a = Dir !a -- ^ The root directory-                      !(V.Vector a) -- ^ The files in the root directory that are not subdirectories-                      !(V.Vector (FileTree a)) -- ^ The vector of trees formed by subdirectories+data FileTree a = Dir { rootDir :: a -- ^ The root directory+                      , dirFiles :: (V.Vector a) -- ^ The files in the root directory that are not subdirectories+                      , subDirs :: (V.Vector (FileTree a))} -- ^ The vector of trees formed by subdirectories                         deriving (Eq , Show)  -- | Default configuration, include every file and search directory.@@ -116,6 +116,7 @@ {-# INLINABLE findFilesInDirs #-} findFilesInDirs :: [FindInDirs] -> IO (V.Vector (FileTree Text)) findFilesInDirs = foldr (\a t -> t <> findWithExts a) (pure mempty)+ -- | Find all the executables in PATH executables :: IO (V.Vector Text) executables = foldr (\a t -> t <> map (V.map (T.takeWhileEnd (/= '/')) . flatten) (fileTreeWith cl a)) (pure V.empty) . B.split ':' =<< getEnvDefault "PATH" ""
talash.cabal view
@@ -1,6 +1,6 @@ cabal-version:      2.4 name:               talash-version:            0.1.0.1+version:            0.1.1.0  -- A short (one-line) description of the package. synopsis: Line oriented fast enough text search@@ -64,21 +64,21 @@     other-modules: Talash.Internal Talash.Brick.Internal     default-extensions: DeriveGeneric OverloadedStrings NoImplicitPrelude BangPatterns TupleSections ScopedTypeVariables DeriveFunctor DataKinds KindSignatures     other-extensions: TemplateHaskell ExistentialQuantification RankNTypes-    build-depends:base                    >=  4.14.1 && < 5,+    build-depends:base                    >=  4.10.1 && < 5,                   alfred-margaret         ^>= 1.1.1.0,                   brick                   >=  0.60 && < 0.70,                   bytestring              >=  0.10.10 && < 0.11,                   colorful-monoids        >=  0.2.1 && < 0.3,                   ghc-compact             >=  0.1.0 && < 0.3,-                  containers              >=  0.6.2 && < 0.7,+                  containers              >=  0.6   && < 0.7,                   directory               >=  1.3.6 && < 1.4,-                  intro                   ^>= 0.9.0.0,+                  intro                   >=  0.4.0 && < 0.10,                   microlens               ^>= 0.4.12.0,                   microlens-th            ^>= 0.4.3.9,                   text                    ^>= 1.2.4.1,                   unix                    >=  2.7.2 && < 2.8,                   unordered-containers    >=  0.2.13 && < 0.3,-                  vector                  ^>= 0.12.3.0,+                  vector                  ^>= 0.12.1,                   vector-algorithms       ^>= 0.8.0.4,                   vector-sized            >=  1.4.3 && < 1.5,                   vty                     ^>= 5.33@@ -89,11 +89,12 @@  executable talash     main-is:          Main.hs-+    default-extensions: OverloadedStrings NoImplicitPrelude     -- Modules included in this executable, other than Main.     -- other-modules:     build-depends:-        base                    >= 4.14.1 && < 5,+        base                    >= 4.10.1 && < 5,+        intro                   >=  0.4.0 && < 0.10,         talash      ghc-options: -threaded -rtsopts