[protolude] export more of Protolude in Gargantext.Prelude

parent 8f97fef4
dist-newstyle/
.stack-work/
*~
\ No newline at end of file
......@@ -51,6 +51,7 @@ library
FlexibleContexts
FlexibleInstances
GeneralizedNewtypeDeriving
ImportQualifiedPost
MultiParamTypeClasses
NamedFieldPuns
NoImplicitPrelude
......
......@@ -16,84 +16,45 @@ Portability : POSIX
module Gargantext.Prelude
( module Gargantext.Prelude
, module Protolude
, module GHC.Err.Located
, module Data.String.Conversions
, module Text.Show
, module Text.Read
, module Data.Maybe
, module Prelude
, MonadBase(..)
, Typeable
, cs
, headMay, lastMay, sortWith
, round
)
where
-- TODO import functions optimized in Utils.Count
-- import Gargantext.Utils.Count
import Control.Monad qualified as M
import Control.Monad.Base (MonadBase(..))
import Data.Set (Set)
import GHC.Exts (sortWith)
import GHC.Err.Located (undefined)
import GHC.Real (round)
import Data.List qualified as L hiding (head, sum)
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.Semigroup (Semigroup, (<>))
import Data.Text (Text, pack)
import Data.Typeable (Typeable)
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.Set (Set)
import Data.Set qualified as Set
import Data.String.Conversions (ConvertibleStrings, cs)
import Prelude (Enum, Bounded, minBound, maxBound, putStrLn)
-- TODO import functions optimized in Utils.Count
-- import Protolude hiding (head, last, all, any, sum, product, length)
-- import Gargantext.Utils.Count
import Data.Map.Strict (insertWith)
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 Data.Typeable (Typeable)
import Data.Vector qualified as V
import GHC.Exts (sortWith)
import GHC.Real (round)
import Protolude
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 _ _ = pure ()
saveAsFileDebug :: (Show a, MonadBase IO m) => [Char] -> a -> m ()
saveAsFileDebug :: (Show a, MonadBase IO m) => FilePath -> a -> m ()
saveAsFileDebug fname x = do
let dir = takeDirectory fname
_ <- liftBase $ createDirectoryIfMissing True dir
liftBase . Protolude.writeFile fname $ pack $ show x
liftBase . writeFile fname $ show x
-- | splitEvery n == chunkAlong n n
......
......@@ -14,14 +14,14 @@ Portability : POSIX
module Gargantext.Prelude.Crypto.Hash
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 qualified as Set
import Data.Text (Text)
import Gargantext.Prelude
import qualified Data.ByteString.Lazy.Char8 as Char
import qualified Data.Digest.Pure.SHA as SHA (sha256, showDigest)
import qualified Data.Set as Set
import qualified Data.Text as Text
import Data.Text qualified as Text
import Gargantext.Prelude hiding (Ordering, hash)
import Prelude (String)
--------------------------------------------------------------------------
-- | Use this datatype to keep traceability of hashes
......
......@@ -27,9 +27,9 @@ module Gargantext.Prelude.Crypto.Share
where
import Data.Maybe
import System.Random
import Gargantext.Prelude hiding (Ordering)
import Prelude (fromEnum, toEnum, String)
import Gargantext.Prelude
import System.Random
------------------------------------------------------------------------
-- | 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