use hierarchical namespace for all modules

This commit is contained in:
Stephen Diehl
2017-08-22 19:23:46 +01:00
parent 6c9b60700e
commit 9533e739ff
19 changed files with 60 additions and 60 deletions
+15 -15
View File
@@ -39,21 +39,21 @@ library
Debug Debug
other-modules: other-modules:
Exceptions Protolude.Exceptions
Base Protolude.Base
Applicative Protolude.Applicative
Bool Protolude.Bool
List Protolude.List
Monad Protolude.Monad
Show Protolude.Show
Conv Protolude.Conv
Either Protolude.Either
Functor Protolude.Functor
Semiring Protolude.Semiring
Bifunctor Protolude.Bifunctor
CallStack Protolude.CallStack
Error Protolude.Error
Panic Protolude.Panic
default-extensions: default-extensions:
NoImplicitPrelude NoImplicitPrelude
+3 -3
View File
@@ -16,9 +16,9 @@ module Debug (
import Data.Text (Text, unpack) import Data.Text (Text, unpack)
import Control.Monad (Monad, return) import Control.Monad (Monad, return)
import qualified Base as P import qualified Protolude.Base as P
import Error (error) import Protolude.Error (error)
import Show (Print, hPutStrLn) import Protolude.Show (Print, hPutStrLn)
import System.IO(stderr) import System.IO(stderr)
import System.IO.Unsafe (unsafePerformIO) import System.IO.Unsafe (unsafePerformIO)
+19 -19
View File
@@ -32,20 +32,20 @@ module Protolude (
) where ) where
-- Protolude module exports. -- Protolude module exports.
import List as X
import Show as X
import Bool as X
import Debug as X import Debug as X
import Monad as X import Protolude.List as X
import Functor as X import Protolude.Show as X
import Either as X import Protolude.Bool as X
import Applicative as X import Protolude.Monad as X
import Conv as X import Protolude.Functor as X
import Panic as X import Protolude.Either as X
import Exceptions as X import Protolude.Applicative as X
import Semiring 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 putStr -- Overriden by Show.putStr
, putStrLn -- Overriden by Show.putStrLn , putStrLn -- Overriden by Show.putStrLn
, print -- Overriden by Protolude.print , print -- Overriden by Protolude.print
@@ -56,7 +56,7 @@ import Base as Base hiding (
, showSignedFloat -- Custom Show instances deprecated. , showSignedFloat -- Custom Show instances deprecated.
, showsPrec -- 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. -- Used for 'show', not exported.
import Data.String (String) import Data.String (String)
@@ -155,10 +155,10 @@ import Control.DeepSeq as X (
import Data.Tuple as X ( import Data.Tuple as X (
fst fst
, snd , snd
, curry , curry
, uncurry , uncurry
, swap , swap
) )
import Data.List as X ( import Data.List as X (
splitAt splitAt
@@ -325,7 +325,7 @@ import Data.Word as X (
import Data.Either as X ( import Data.Either as X (
Either(..) Either(..)
, either , either
, lefts , lefts
, rights , rights
, partitionEithers , partitionEithers
@@ -431,7 +431,7 @@ import Data.Text.Encoding.Error as X (
-- IO -- IO
import System.Environment as X (getArgs) import System.Environment as X (getArgs)
import qualified System.Exit import qualified System.Exit
import System.Exit as X ( import System.Exit as X (
ExitCode(..) ExitCode(..)
, exitWith , exitWith
@@ -475,7 +475,7 @@ import Control.Monad.STM as X (
, retry , retry
, orElse , orElse
, check , check
, throwSTM , throwSTM
, catchSTM , catchSTM
) )
import Control.Concurrent as X hiding ( import Control.Concurrent as X hiding (
@@ -494,7 +494,7 @@ import Control.Concurrent.Async as X (
, wait , wait
, poll , poll
, waitCatch , waitCatch
, cancel , cancel
, cancelWith , cancelWith
, asyncThreadId , asyncThreadId
, waitAny , waitAny
@@ -1,7 +1,7 @@
{-# LANGUAGE Safe #-} {-# LANGUAGE Safe #-}
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE NoImplicitPrelude #-}
module Applicative ( module Protolude.Applicative (
orAlt, orAlt,
orEmpty, orEmpty,
eitherA, eitherA,
+1 -1
View File
@@ -4,7 +4,7 @@
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE ExplicitNamespaces #-} {-# LANGUAGE ExplicitNamespaces #-}
module Base ( module Protolude.Base (
module X, module X,
($!), ($!),
) where ) where
@@ -1,7 +1,7 @@
{-# LANGUAGE Safe #-} {-# LANGUAGE Safe #-}
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE NoImplicitPrelude #-}
module Bifunctor ( module Protolude.Bifunctor (
Bifunctor(..) Bifunctor(..)
) where ) where
+1 -1
View File
@@ -1,7 +1,7 @@
{-# LANGUAGE Safe #-} {-# LANGUAGE Safe #-}
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE NoImplicitPrelude #-}
module Bool ( module Protolude.Bool (
whenM whenM
, unlessM , unlessM
, ifM , ifM
@@ -3,7 +3,7 @@
{-# LANGUAGE ImplicitParams #-} {-# LANGUAGE ImplicitParams #-}
{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE ConstraintKinds #-}
module CallStack module Protolude.CallStack
( HasCallStack ( HasCallStack
) where ) where
+2 -2
View File
@@ -2,7 +2,7 @@
{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE TypeSynonymInstances #-}
module Conv ( module Protolude.Conv (
StringConv (..) StringConv (..)
, toS , toS
, toSL , toSL
@@ -17,7 +17,7 @@ import Data.Text.Encoding.Error as T
import Data.Text.Lazy as LT import Data.Text.Lazy as LT
import Data.Text.Lazy.Encoding as LT import Data.Text.Lazy.Encoding as LT
import Base import Protolude.Base
import Data.Eq (Eq(..)) import Data.Eq (Eq(..))
import Data.Ord (Ord(..)) import Data.Ord (Ord(..))
import Data.Function ((.), id) import Data.Function ((.), id)
+1 -1
View File
@@ -1,7 +1,7 @@
{-# LANGUAGE Safe #-} {-# LANGUAGE Safe #-}
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE NoImplicitPrelude #-}
module Either ( module Protolude.Either (
maybeToLeft maybeToLeft
, maybeToRight , maybeToRight
, leftToMaybe , leftToMaybe
+2 -2
View File
@@ -8,7 +8,7 @@
{-# OPTIONS_GHC -fno-warn-redundant-constraints #-} {-# OPTIONS_GHC -fno-warn-redundant-constraints #-}
#endif #endif
module Error module Protolude.Error
( error ( error
) where ) where
@@ -19,7 +19,7 @@ import Data.Text (Text, unpack)
-- Full stack trace. -- Full stack trace.
import GHC.Types (RuntimeRep) import GHC.Types (RuntimeRep)
import CallStack (HasCallStack) import Protolude.CallStack (HasCallStack)
import GHC.Exception (errorCallWithCallStackException) import GHC.Exception (errorCallWithCallStackException)
error :: forall (r :: RuntimeRep) . forall (a :: TYPE r) . HasCallStack => Text -> a error :: forall (r :: RuntimeRep) . forall (a :: TYPE r) . HasCallStack => Text -> a
@@ -2,13 +2,13 @@
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE Trustworthy #-}
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE NoImplicitPrelude #-}
module Exceptions ( module Protolude.Exceptions (
hush, hush,
note, note,
tryIO, tryIO,
) where ) where
import Base (IO) import Protolude.Base (IO)
import Data.Function ((.)) import Data.Function ((.))
import Control.Monad.Trans (liftIO) import Control.Monad.Trans (liftIO)
import Control.Monad.IO.Class (MonadIO) import Control.Monad.IO.Class (MonadIO)
+1 -1
View File
@@ -2,7 +2,7 @@
{-# LANGUAGE Safe #-} {-# LANGUAGE Safe #-}
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE NoImplicitPrelude #-}
module Functor ( module Protolude.Functor (
Functor(..), Functor(..),
($>), ($>),
(<$>), (<$>),
+1 -1
View File
@@ -1,7 +1,7 @@
{-# LANGUAGE Safe #-} {-# LANGUAGE Safe #-}
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE NoImplicitPrelude #-}
module List ( module Protolude.List (
head, head,
ordNub, ordNub,
sortOn, sortOn,
+2 -2
View File
@@ -2,7 +2,7 @@
{-# LANGUAGE Trustworthy #-} {-# LANGUAGE Trustworthy #-}
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE NoImplicitPrelude #-}
module Monad ( module Protolude.Monad (
Monad((>>=), return) Monad((>>=), return)
, MonadPlus(..) , MonadPlus(..)
@@ -40,7 +40,7 @@ module Monad (
, (<$!>) , (<$!>)
) where ) where
import Base (seq) import Protolude.Base (seq)
import Data.List (concat) import Data.List (concat)
import Control.Monad import Control.Monad
+3 -3
View File
@@ -6,15 +6,15 @@
{-# OPTIONS_GHC -fno-warn-redundant-constraints #-} {-# OPTIONS_GHC -fno-warn-redundant-constraints #-}
#endif #endif
module Panic ( module Protolude.Panic (
FatalError(..), FatalError(..),
panic, panic,
) where ) where
import Base (Show) import Protolude.Base (Show)
import Protolude.CallStack (HasCallStack)
import Data.Text (Text) import Data.Text (Text)
import Data.Typeable (Typeable) import Data.Typeable (Typeable)
import CallStack (HasCallStack)
import Control.Exception as X import Control.Exception as X
-- | Uncatchable exceptions thrown and never caught. -- | Uncatchable exceptions thrown and never caught.
@@ -1,7 +1,7 @@
{-# LANGUAGE Safe #-} {-# LANGUAGE Safe #-}
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE NoImplicitPrelude #-}
module Semiring ( module Protolude.Semiring (
Semiring(..), Semiring(..),
zero, zero,
) where ) where
+2 -2
View File
@@ -5,7 +5,7 @@
{-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE ExtendedDefaultRules #-} {-# LANGUAGE ExtendedDefaultRules #-}
module Show ( module Protolude.Show (
Print(..), Print(..),
putText, putText,
putLText, putLText,
@@ -13,8 +13,8 @@ module Show (
putLByteString, putLByteString,
) where ) where
import qualified Base
import qualified System.IO as Base import qualified System.IO as Base
import qualified Protolude.Base as Base
import Data.Function ((.)) import Data.Function ((.))
import Control.Monad.IO.Class (MonadIO, liftIO) import Control.Monad.IO.Class (MonadIO, liftIO)
+1 -1
View File
@@ -11,7 +11,7 @@ module Unsafe (
unsafeThrow, unsafeThrow,
) where ) where
import Base (Int) import Protolude.Base (Int)
import qualified Data.List as List import qualified Data.List as List
import qualified Data.Maybe as Maybe import qualified Data.Maybe as Maybe
import qualified Control.Exception as Exc import qualified Control.Exception as Exc