[protolude] export more of Protolude in Gargantext.Prelude

parent 8f97fef4
dist-newstyle/
.stack-work/ .stack-work/
*~ *~
\ No newline at end of file
...@@ -51,6 +51,7 @@ library ...@@ -51,6 +51,7 @@ library
FlexibleContexts FlexibleContexts
FlexibleInstances FlexibleInstances
GeneralizedNewtypeDeriving GeneralizedNewtypeDeriving
ImportQualifiedPost
MultiParamTypeClasses MultiParamTypeClasses
NamedFieldPuns NamedFieldPuns
NoImplicitPrelude NoImplicitPrelude
......
...@@ -16,84 +16,45 @@ Portability : POSIX ...@@ -16,84 +16,45 @@ Portability : POSIX
module Gargantext.Prelude module Gargantext.Prelude
( module Gargantext.Prelude ( module Gargantext.Prelude
, module Protolude , module Protolude
, module GHC.Err.Located
, module Data.String.Conversions , module Data.String.Conversions
, module Text.Show
, module Text.Read
, module Data.Maybe
, module Prelude
, MonadBase(..) , MonadBase(..)
, Typeable , Typeable
, cs , cs
, headMay, lastMay, sortWith
, round , round
) )
where where
-- TODO import functions optimized in Utils.Count
-- import Gargantext.Utils.Count
import Control.Monad qualified as M
import Control.Monad.Base (MonadBase(..)) import Control.Monad.Base (MonadBase(..))
import Data.Set (Set) import Data.List qualified as L hiding (head, sum)
import GHC.Exts (sortWith)
import GHC.Err.Located (undefined)
import GHC.Real (round)
import Data.Map (Map, lookup) import Data.Map (Map, lookup)
import Data.Maybe (isJust, fromJust, maybe) import Data.Map qualified as M
import Data.Map.Strict (insertWith)
import Data.Monoid (Monoid, mempty) import Data.Monoid (Monoid, mempty)
import Data.Semigroup (Semigroup, (<>)) import Data.Semigroup (Semigroup, (<>))
import Data.Text (Text, pack) import Data.Set (Set)
import Data.Typeable (Typeable) import Data.Set qualified as Set
import Protolude ( Bool(True, False), Int, Int64, Double, Integer
, Fractional, Num, Maybe(Just,Nothing)
, Enum, Bounded, Float
, Floating, Char, IO
, Functor(..)
, pure, (>>=), (=<<), (<*>), (<$>), (<&>), (>>)
, head, flip
, Ord, Integral, Foldable, RealFrac, Monad, filter
, reverse, map, mapM, zip, drop, take, zipWith
, sum, fromIntegral, length, fmap, foldl, foldl'
, takeWhile, sqrt, identity
, abs, min, max, maximum, minimum, return, snd, truncate
, (+), (*), (/), (-), (.), ($), (&), (**), (^), (<), (>), log
, Eq, (==), (>=), (<=), (<>), (/=), xor
, (&&), (||), not, any, all
, concatMap
, fst, snd, toS
, elem, die, mod, div, const, either
, curry, uncurry, repeat
, otherwise, when
, IO()
, compare
, on
, panic
, seq
)
import qualified Protolude as Protolude (writeFile)
import Data.String.Conversions (ConvertibleStrings, cs) import Data.String.Conversions (ConvertibleStrings, cs)
import Prelude (Enum, Bounded, minBound, maxBound, putStrLn) import Data.Typeable (Typeable)
-- TODO import functions optimized in Utils.Count import Data.Vector qualified as V
-- import Protolude hiding (head, last, all, any, sum, product, length) import GHC.Exts (sortWith)
-- import Gargantext.Utils.Count import GHC.Real (round)
import Data.Map.Strict (insertWith) import Protolude
import Safe (headMay, lastMay, initMay, tailMay)
import Text.Read (Read())
import Text.Show (Show(), show)
import qualified Control.Monad as M
import qualified Data.List as L hiding (head, sum)
import qualified Data.Map as M
import qualified Data.Set as Set
import qualified Data.Vector as V
import System.FilePath.Posix (takeDirectory)
import System.Directory (createDirectoryIfMissing) import System.Directory (createDirectoryIfMissing)
import System.FilePath.Posix (takeDirectory)
printDebug :: (Show a, MonadBase IO m) => [Char] -> a -> m () printDebug :: (Show a, MonadBase IO m) => Text -> a -> m ()
printDebug msg x = liftBase . putStrLn $ msg <> " " <> show x printDebug msg x = liftBase . putStrLn $ msg <> " " <> show x
-- printDebug _ _ = pure () -- printDebug _ _ = pure ()
saveAsFileDebug :: (Show a, MonadBase IO m) => [Char] -> a -> m () saveAsFileDebug :: (Show a, MonadBase IO m) => FilePath -> a -> m ()
saveAsFileDebug fname x = do saveAsFileDebug fname x = do
let dir = takeDirectory fname let dir = takeDirectory fname
_ <- liftBase $ createDirectoryIfMissing True dir _ <- liftBase $ createDirectoryIfMissing True dir
liftBase . Protolude.writeFile fname $ pack $ show x liftBase . writeFile fname $ show x
-- | splitEvery n == chunkAlong n n -- | splitEvery n == chunkAlong n n
......
...@@ -14,14 +14,14 @@ Portability : POSIX ...@@ -14,14 +14,14 @@ Portability : POSIX
module Gargantext.Prelude.Crypto.Hash module Gargantext.Prelude.Crypto.Hash
where where
import Prelude (String) import Data.ByteString.Lazy.Char8 qualified as Char
import Data.Digest.Pure.SHA qualified as SHA (sha256, showDigest)
import Data.Set (Set) import Data.Set (Set)
import Data.Set qualified as Set
import Data.Text (Text) import Data.Text (Text)
import Gargantext.Prelude import Data.Text qualified as Text
import qualified Data.ByteString.Lazy.Char8 as Char import Gargantext.Prelude hiding (Ordering, hash)
import qualified Data.Digest.Pure.SHA as SHA (sha256, showDigest) import Prelude (String)
import qualified Data.Set as Set
import qualified Data.Text as Text
-------------------------------------------------------------------------- --------------------------------------------------------------------------
-- | Use this datatype to keep traceability of hashes -- | Use this datatype to keep traceability of hashes
......
...@@ -27,9 +27,9 @@ module Gargantext.Prelude.Crypto.Share ...@@ -27,9 +27,9 @@ module Gargantext.Prelude.Crypto.Share
where where
import Data.Maybe import Data.Maybe
import System.Random import Gargantext.Prelude hiding (Ordering)
import Prelude (fromEnum, toEnum, String) import Prelude (fromEnum, toEnum, String)
import Gargantext.Prelude import System.Random
------------------------------------------------------------------------ ------------------------------------------------------------------------
-- | Main Types -- | Main Types
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment