diff --git a/protolude.cabal b/protolude.cabal index ac62997e4..3f4d12b4b 100644 --- a/protolude.cabal +++ b/protolude.cabal @@ -39,21 +39,21 @@ library Debug other-modules: - Exceptions - Base - Applicative - Bool - List - Monad - Show - Conv - Either - Functor - Semiring - Bifunctor - CallStack - Error - Panic + Protolude.Exceptions + Protolude.Base + Protolude.Applicative + Protolude.Bool + Protolude.List + Protolude.Monad + Protolude.Show + Protolude.Conv + Protolude.Either + Protolude.Functor + Protolude.Semiring + Protolude.Bifunctor + Protolude.CallStack + Protolude.Error + Protolude.Panic default-extensions: NoImplicitPrelude diff --git a/src/Debug.hs b/src/Debug.hs index a43aabfed..b4c5bc71f 100644 --- a/src/Debug.hs +++ b/src/Debug.hs @@ -16,9 +16,9 @@ module Debug ( import Data.Text (Text, unpack) import Control.Monad (Monad, return) -import qualified Base as P -import Error (error) -import Show (Print, hPutStrLn) +import qualified Protolude.Base as P +import Protolude.Error (error) +import Protolude.Show (Print, hPutStrLn) import System.IO(stderr) import System.IO.Unsafe (unsafePerformIO) diff --git a/src/Protolude.hs b/src/Protolude.hs index 81c581060..7b13e4ca7 100644 --- a/src/Protolude.hs +++ b/src/Protolude.hs @@ -32,20 +32,20 @@ module Protolude ( ) where -- Protolude module exports. -import List as X -import Show as X -import Bool as X import Debug as X -import Monad as X -import Functor as X -import Either as X -import Applicative as X -import Conv as X -import Panic as X -import Exceptions as X -import Semiring as X +import Protolude.List as X +import Protolude.Show as X +import Protolude.Bool as X +import Protolude.Monad as X +import Protolude.Functor as X +import Protolude.Either as X +import Protolude.Applicative as X +import Protolude.Conv as X +import Protolude.Panic as X +import Protolude.Exceptions as X +import Protolude.Semiring as X -import Base as Base hiding ( +import Protolude.Base as Base hiding ( putStr -- Overriden by Show.putStr , putStrLn -- Overriden by Show.putStrLn , print -- Overriden by Protolude.print @@ -56,7 +56,7 @@ import Base as Base hiding ( , showSignedFloat -- Custom Show instances deprecated. , showsPrec -- Custom Show instances deprecated. ) -import qualified Base as PBase +import qualified Protolude.Base as PBase -- Used for 'show', not exported. import Data.String (String) @@ -155,10 +155,10 @@ import Control.DeepSeq as X ( import Data.Tuple as X ( fst , snd - , curry + , curry , uncurry , swap - ) + ) import Data.List as X ( splitAt @@ -325,7 +325,7 @@ import Data.Word as X ( import Data.Either as X ( Either(..) - , either + , either , lefts , rights , partitionEithers @@ -431,7 +431,7 @@ import Data.Text.Encoding.Error as X ( -- IO import System.Environment as X (getArgs) -import qualified System.Exit +import qualified System.Exit import System.Exit as X ( ExitCode(..) , exitWith @@ -475,7 +475,7 @@ import Control.Monad.STM as X ( , retry , orElse , check - , throwSTM + , throwSTM , catchSTM ) import Control.Concurrent as X hiding ( @@ -494,7 +494,7 @@ import Control.Concurrent.Async as X ( , wait , poll , waitCatch - , cancel + , cancel , cancelWith , asyncThreadId , waitAny diff --git a/src/Applicative.hs b/src/Protolude/Applicative.hs similarity index 96% rename from src/Applicative.hs rename to src/Protolude/Applicative.hs index 34da016d1..5e2a00ca5 100644 --- a/src/Applicative.hs +++ b/src/Protolude/Applicative.hs @@ -1,7 +1,7 @@ {-# LANGUAGE Safe #-} {-# LANGUAGE NoImplicitPrelude #-} -module Applicative ( +module Protolude.Applicative ( orAlt, orEmpty, eitherA, diff --git a/src/Base.hs b/src/Protolude/Base.hs similarity index 98% rename from src/Base.hs rename to src/Protolude/Base.hs index db95965ed..8b58c7cf5 100644 --- a/src/Base.hs +++ b/src/Protolude/Base.hs @@ -4,7 +4,7 @@ {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE ExplicitNamespaces #-} -module Base ( +module Protolude.Base ( module X, ($!), ) where diff --git a/src/Bifunctor.hs b/src/Protolude/Bifunctor.hs similarity index 97% rename from src/Bifunctor.hs rename to src/Protolude/Bifunctor.hs index 3b2d1cca2..185c98b01 100644 --- a/src/Bifunctor.hs +++ b/src/Protolude/Bifunctor.hs @@ -1,7 +1,7 @@ {-# LANGUAGE Safe #-} {-# LANGUAGE NoImplicitPrelude #-} -module Bifunctor ( +module Protolude.Bifunctor ( Bifunctor(..) ) where diff --git a/src/Bool.hs b/src/Protolude/Bool.hs similarity index 98% rename from src/Bool.hs rename to src/Protolude/Bool.hs index 930e121f2..834e35c2e 100644 --- a/src/Bool.hs +++ b/src/Protolude/Bool.hs @@ -1,7 +1,7 @@ {-# LANGUAGE Safe #-} {-# LANGUAGE NoImplicitPrelude #-} -module Bool ( +module Protolude.Bool ( whenM , unlessM , ifM diff --git a/src/CallStack.hs b/src/Protolude/CallStack.hs similarity index 93% rename from src/CallStack.hs rename to src/Protolude/CallStack.hs index 8f875b72d..ce587f669 100644 --- a/src/CallStack.hs +++ b/src/Protolude/CallStack.hs @@ -3,7 +3,7 @@ {-# LANGUAGE ImplicitParams #-} {-# LANGUAGE ConstraintKinds #-} -module CallStack +module Protolude.CallStack ( HasCallStack ) where diff --git a/src/Conv.hs b/src/Protolude/Conv.hs similarity index 98% rename from src/Conv.hs rename to src/Protolude/Conv.hs index 99826e127..eca4f0767 100644 --- a/src/Conv.hs +++ b/src/Protolude/Conv.hs @@ -2,7 +2,7 @@ {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE TypeSynonymInstances #-} -module Conv ( +module Protolude.Conv ( StringConv (..) , toS , toSL @@ -17,7 +17,7 @@ import Data.Text.Encoding.Error as T import Data.Text.Lazy as LT import Data.Text.Lazy.Encoding as LT -import Base +import Protolude.Base import Data.Eq (Eq(..)) import Data.Ord (Ord(..)) import Data.Function ((.), id) diff --git a/src/Either.hs b/src/Protolude/Either.hs similarity index 96% rename from src/Either.hs rename to src/Protolude/Either.hs index 7b5d17f6c..28eab6164 100644 --- a/src/Either.hs +++ b/src/Protolude/Either.hs @@ -1,7 +1,7 @@ {-# LANGUAGE Safe #-} {-# LANGUAGE NoImplicitPrelude #-} -module Either ( +module Protolude.Either ( maybeToLeft , maybeToRight , leftToMaybe diff --git a/src/Error.hs b/src/Protolude/Error.hs similarity index 93% rename from src/Error.hs rename to src/Protolude/Error.hs index fd497e0ea..83667c648 100644 --- a/src/Error.hs +++ b/src/Protolude/Error.hs @@ -8,7 +8,7 @@ {-# OPTIONS_GHC -fno-warn-redundant-constraints #-} #endif -module Error +module Protolude.Error ( error ) where @@ -19,7 +19,7 @@ import Data.Text (Text, unpack) -- Full stack trace. import GHC.Types (RuntimeRep) -import CallStack (HasCallStack) +import Protolude.CallStack (HasCallStack) import GHC.Exception (errorCallWithCallStackException) error :: forall (r :: RuntimeRep) . forall (a :: TYPE r) . HasCallStack => Text -> a diff --git a/src/Exceptions.hs b/src/Protolude/Exceptions.hs similarity index 94% rename from src/Exceptions.hs rename to src/Protolude/Exceptions.hs index 801b2aafc..031120d17 100644 --- a/src/Exceptions.hs +++ b/src/Protolude/Exceptions.hs @@ -2,13 +2,13 @@ {-# LANGUAGE Trustworthy #-} {-# LANGUAGE NoImplicitPrelude #-} -module Exceptions ( +module Protolude.Exceptions ( hush, note, tryIO, ) where -import Base (IO) +import Protolude.Base (IO) import Data.Function ((.)) import Control.Monad.Trans (liftIO) import Control.Monad.IO.Class (MonadIO) diff --git a/src/Functor.hs b/src/Protolude/Functor.hs similarity index 95% rename from src/Functor.hs rename to src/Protolude/Functor.hs index ebc35030d..f5345becb 100644 --- a/src/Functor.hs +++ b/src/Protolude/Functor.hs @@ -2,7 +2,7 @@ {-# LANGUAGE Safe #-} {-# LANGUAGE NoImplicitPrelude #-} -module Functor ( +module Protolude.Functor ( Functor(..), ($>), (<$>), diff --git a/src/List.hs b/src/Protolude/List.hs similarity index 97% rename from src/List.hs rename to src/Protolude/List.hs index 635236e8f..364e0d761 100644 --- a/src/List.hs +++ b/src/Protolude/List.hs @@ -1,7 +1,7 @@ {-# LANGUAGE Safe #-} {-# LANGUAGE NoImplicitPrelude #-} -module List ( +module Protolude.List ( head, ordNub, sortOn, diff --git a/src/Monad.hs b/src/Protolude/Monad.hs similarity index 95% rename from src/Monad.hs rename to src/Protolude/Monad.hs index 139bacb74..f2a468b54 100644 --- a/src/Monad.hs +++ b/src/Protolude/Monad.hs @@ -2,7 +2,7 @@ {-# LANGUAGE Trustworthy #-} {-# LANGUAGE NoImplicitPrelude #-} -module Monad ( +module Protolude.Monad ( Monad((>>=), return) , MonadPlus(..) @@ -40,7 +40,7 @@ module Monad ( , (<$!>) ) where -import Base (seq) +import Protolude.Base (seq) import Data.List (concat) import Control.Monad diff --git a/src/Panic.hs b/src/Protolude/Panic.hs similarity index 85% rename from src/Panic.hs rename to src/Protolude/Panic.hs index 508ddc7f0..6471d2cb9 100644 --- a/src/Panic.hs +++ b/src/Protolude/Panic.hs @@ -6,15 +6,15 @@ {-# OPTIONS_GHC -fno-warn-redundant-constraints #-} #endif -module Panic ( +module Protolude.Panic ( FatalError(..), panic, ) where -import Base (Show) +import Protolude.Base (Show) +import Protolude.CallStack (HasCallStack) import Data.Text (Text) import Data.Typeable (Typeable) -import CallStack (HasCallStack) import Control.Exception as X -- | Uncatchable exceptions thrown and never caught. diff --git a/src/Semiring.hs b/src/Protolude/Semiring.hs similarity index 90% rename from src/Semiring.hs rename to src/Protolude/Semiring.hs index 8699015f2..6cbbcdbd9 100644 --- a/src/Semiring.hs +++ b/src/Protolude/Semiring.hs @@ -1,7 +1,7 @@ {-# LANGUAGE Safe #-} {-# LANGUAGE NoImplicitPrelude #-} -module Semiring ( +module Protolude.Semiring ( Semiring(..), zero, ) where diff --git a/src/Show.hs b/src/Protolude/Show.hs similarity index 96% rename from src/Show.hs rename to src/Protolude/Show.hs index 4b3bdd192..a069c8888 100644 --- a/src/Show.hs +++ b/src/Protolude/Show.hs @@ -5,7 +5,7 @@ {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE ExtendedDefaultRules #-} -module Show ( +module Protolude.Show ( Print(..), putText, putLText, @@ -13,8 +13,8 @@ module Show ( putLByteString, ) where -import qualified Base import qualified System.IO as Base +import qualified Protolude.Base as Base import Data.Function ((.)) import Control.Monad.IO.Class (MonadIO, liftIO) diff --git a/src/Unsafe.hs b/src/Unsafe.hs index 1e1bdc3f1..2b25b3058 100644 --- a/src/Unsafe.hs +++ b/src/Unsafe.hs @@ -11,7 +11,7 @@ module Unsafe ( unsafeThrow, ) where -import Base (Int) +import Protolude.Base (Int) import qualified Data.List as List import qualified Data.Maybe as Maybe import qualified Control.Exception as Exc