packages feed

pregame 1.0.0.0 → 1.0.0.1

raw patch · 19 files changed

+820/−1 lines, 19 files

Files

pregame.cabal view
@@ -1,7 +1,7 @@ name:   pregame version:-  1.0.0.0+  1.0.0.1 synopsis:   Prelude for applications description:@@ -33,6 +33,25 @@ library   exposed-modules:     Pregame+  other-modules:+    Pregame.Aeson+    Pregame.Array+    Pregame.Base+    Pregame.Bytestring+    Pregame.Containers+    Pregame.DataDefault+    Pregame.Deepseq+    Pregame.Either+    Pregame.GhcPrim+    Pregame.IntegerGmp+    Pregame.Lens+    Pregame.Mtl+    Pregame.Safe+    Pregame.Stm+    Pregame.Text+    Pregame.Time+    Pregame.UnorderedContainers+    Pregame.Vector   default-extensions:     NoImplicitPrelude   build-depends:
+ src/Pregame/Aeson.hs view
@@ -0,0 +1,31 @@+module Pregame.Aeson+  ( module X+  , noPrefixDeriveOptions+  , tailDeriveOptions+  ) where++import Data.Aeson as X+  ( ToJSON+  , FromJSON+  )+import Data.Aeson.TH as X+  ( deriveJSON+  )++import Data.Aeson.Types+  ( defaultOptions+  , Options(fieldLabelModifier)+  )+import Pregame.Base++noPrefixDeriveOptions :: String -> Options+noPrefixDeriveOptions prefix = defaultOptions+  { fieldLabelModifier = lowerFirstChar . drop (length prefix)+  }+  where+    lowerFirstChar :: String -> String+    lowerFirstChar [] = []+    lowerFirstChar (x:xs) = toLower x : xs++tailDeriveOptions :: Options+tailDeriveOptions = defaultOptions { fieldLabelModifier = drop 1 }
+ src/Pregame/Array.hs view
@@ -0,0 +1,29 @@+module Pregame.Array+  ( module X+  ) where++import Data.Array as X+  ( Array+  )+import Data.Array.IArray as X+  ( IArray+  )+import Data.Array.IO as X+  ( IOArray+  , IOUArray+  , hGetArray+  , hPutArray+  )+import Data.Array.ST as X+  ( STArray+  , STUArray+  )+import Data.Array.MArray as X+  ( MArray+  )+import Data.Array.Storable as X+  ( StorableArray+  )+import Data.Array.Unboxed as X+  ( UArray+  )
+ src/Pregame/Base.hs view
@@ -0,0 +1,380 @@+{-# LANGUAGE BangPatterns #-}+module Pregame.Base+  ( module X+  , done+  , ($!)+  ) where++import Control.Category as X+  ( Category(id, (.))+  , (<<<)+  , (>>>)+  )+import Data.Function as X+  ( ($)+  , (&)+  , const+  , flip+  , fix+  )+import Data.Bool as X+  ( Bool(True, False)+  , (&&)+  , (||)+  , not+  , otherwise+  )+import Data.Bifunctor as X+  ( Bifunctor(bimap, first, second)+  )+import Data.Bits as X+  ( Bits+  )+import Data.Int as X+  ( Int8+  , Int16+  , Int32+  , Int64+  )+import Data.Char as X+  ( isSpace+  , isLower+  , isUpper+  , isAlpha+  , isAlphaNum+  , isDigit+  , isOctDigit+  , isHexDigit+  , isLetter+  , toLower+  , toUpper+  )+import Data.Word as X+  ( Word8+  , Word16+  , Word32+  , Word64+  )+import Data.String as X+  ( String+  , IsString+  )+import Foreign.C.Types as X+  ( CChar(CChar)+  , CSChar(CSChar)+  , CUChar(CUChar)+  , CShort(CShort)+  , CUShort(CUShort)+  , CInt(CInt)+  , CUInt(CUInt)+  , CLong(CLong)+  , CULong(CULong)+  , CPtrdiff(CPtrdiff)+  , CSize(CSize)+  , CWchar(CWchar)+  , CSigAtomic(CSigAtomic)+  , CLLong(CLLong)+  , CULLong(CULLong)+  , CIntPtr(CIntPtr)+  , CUIntPtr(CUIntPtr)+  , CIntMax(CIntMax)+  , CUIntMax(CUIntMax)+  , CClock(CClock)+  , CTime(CTime)+  , CUSeconds(CUSeconds)+  , CSUSeconds(CSUSeconds)+  , CFloat(CFloat)+  , CDouble(CDouble)+  , CFile+  , CFpos+  , CJmpBuf+  )+import Foreign.Ptr as X+  ( Ptr+  , nullPtr+  , castPtr+  , plusPtr+  , alignPtr+  , minusPtr+  , FunPtr+  , nullFunPtr+  , castFunPtr+  , castFunPtrToPtr+  , castPtrToFunPtr+  , IntPtr+  , ptrToIntPtr+  , intPtrToPtr+  , WordPtr+  , ptrToWordPtr+  , wordPtrToPtr+  )+import Foreign.Storable as X+  ( Storable+  , sizeOf+  , alignment+  , peekElemOff+  , pokeElemOff+  , peekByteOff+  , pokeByteOff+  , peek+  , poke+  )+import Data.Void as X+  ( Void+  )+import Data.Ord as X+  ( Ord+  , compare+  , (<=)+  , (>=)+  , (<)+  , (>)+  )+import Data.Proxy as X+  ( Proxy(Proxy)+  )+import GHC.Enum as X+  ( Enum+  , Bounded(minBound, maxBound)+  )+import GHC.Num as X+  ( Num(..)+  )+import Data.Fixed as X+  ( div'+  , mod'+  , divMod'+  , Fixed(MkFixed)+  , HasResolution+  )+import GHC.Real as X+  ( Real(..)+  , Integral(..)+  , Fractional(..)+  , Ratio(..)+  , (^)+  , (^^)+  , fromIntegral+  , realToFrac+  )+import Data.Eq as X+  ( Eq((==))+  )+import Data.Monoid as X+  ( Monoid+  , mempty+  , mappend+  , mconcat+  , Dual(Dual)+  , Endo(Endo)+  , All(All)+  , Any(Any)+  , Sum(Sum)+  , Product(Product)+  , First(First)+  , Last(Last)+  , Alt(Alt)+  )+import Data.Semigroup as X+  ( Semigroup+  , (<>)+  , sconcat+  )+import Data.Functor as X+  ( Functor+  , fmap+  , ($>)+  , (<$>)+  , void+  )+import Data.Foldable as X+  ( Foldable+  , foldMap+  , foldr+  , foldl'+  , null+  , length+  , elem+  , foldrM+  , foldlM+  , traverse_+  , for_+  , sequenceA_+  , asum+  , mapM_+  , forM_+  , sequence_+  , msum+  , concat+  , concatMap+  , and+  , or+  , any+  , all+  , notElem+  , find+  )+import Data.Tuple as X+  ( fst+  , snd+  )+import GHC.List as X+  ( map+  , (++)+  , filter+  , cycle+  , replicate+  , repeat+  , iterate+  , drop+  , take+  )+import Data.List.NonEmpty as X+  ( NonEmpty((:|))+  , nonEmpty+  )+import Control.Applicative as X+  ( Applicative+  , pure+  , (<*>)+  , Alternative+  , (<|>)+  , some+  , many+  )+import Control.Exception as X+  ( SomeException+  , IOException+  )+import Data.Maybe as X+  ( Maybe(Just, Nothing)+  , maybe+  , fromMaybe+  , isJust+  , isNothing+  , catMaybes+  )+import Data.Either as X+  ( Either(Left, Right)+  , either+  , lefts+  , rights+  , isLeft+  , isRight+  , partitionEithers+  )+import Data.Traversable as X+  ( Traversable+  , traverse+  , sequenceA+  , mapM+  , sequence+  , for+  , forM+  , mapAccumL+  , mapAccumR+  )+import Control.Monad as X+  ( Monad+  , return+  , (>>=)+  , MonadPlus+  , mzero+  , mplus+  , join+  , (>>)+  , (=<<)+  , (>=>)+  , (<=<)+  , forever+  , guard+  , when+  , unless+  )+import Control.Monad.Fix as X+  ( MonadFix+  , mfix+  )+import GHC.IORef as X+  ( IORef+  , newIORef+  , readIORef+  , writeIORef+  , atomicModifyIORef+  )+import Control.Concurrent.MVar as X+  ( MVar+  , newMVar+  , newEmptyMVar+  , readMVar+  , putMVar+  , takeMVar+  , modifyMVar+  )+import Control.Concurrent.Chan as X+  ( Chan+  , newChan+  , readChan+  , writeChan+  , dupChan+  )+import System.Posix.Types+  ( CDev(CDev)+  , CIno(CIno)+  , CMode(CMode)+  , COff(COff)+  , CPid(CPid)+  , CSsize(CSsize)+  , CGid(CGid)+  , CNlink(CNlink)+  , CUid(CUid)+  , CCc(CCc)+  , CSpeed(CSpeed)+  , CTcflag(CTcflag)+  , CRLim(CRLim)+  , Fd(Fd)+  , LinkCount+  , UserID+  , GroupID+  , ByteCount+  , ClockTick+  , EpochTime+  , FileOffset+  , ProcessID+  , DeviceID+  , FileID+  , FileMode+  , Limit+  )+import System.IO as X+  ( fixIO+  , FilePath+  , Handle+  , stdin+  , stdout+  , stderr+  , withFile+  , openFile+  , IOMode(ReadMode, WriteMode, AppendMode, ReadWriteMode)+  , hClose+  , hIsOpen+  , hIsClosed+  , hIsReadable+  , hIsWritable+  )+import Text.Read as X+  ( Read+  )+import Text.Show as X+  ( Show(show)+  )+import GHC.Generics as X+  ( Generic+  )++done :: Monad m => m ()+done = return ()++infixr 0 $!+($!) :: (a -> b) -> a -> b+x $! y = let !y' = y in x y'
+ src/Pregame/Bytestring.hs view
@@ -0,0 +1,12 @@+module Pregame.Bytestring+  ( module X+  , LazyByteString+  ) where++import Data.ByteString as X+  ( ByteString+  )++import qualified Data.ByteString.Lazy as Lazy (ByteString)++type LazyByteString = Lazy.ByteString
+ src/Pregame/Containers.hs view
@@ -0,0 +1,32 @@+module Pregame.Containers+  ( module X+  ) where++import Data.Graph as X+  ( Graph+  , Table+  , Bounds+  , Edge+  , Vertex+  )+import Data.Map as X+  ( Map+  )+import Data.Sequence as X+  ( Seq+  )+import Data.IntSet as X+  ( IntSet+  )+import Data.Set as X+  ( Set+  )+import Data.Tree as X+  ( Tree+  , Forest+  )+import qualified Data.Map.Strict as Strict (Map)+import qualified Data.IntMap.Strict as Strict (IntMap)++type StrictMap = Strict.Map+type StrictIntMap = Strict.IntMap
+ src/Pregame/DataDefault.hs view
@@ -0,0 +1,8 @@+module Pregame.DataDefault+  ( module X+  ) where++import Data.Default as X+  ( Default+  , def+  )
+ src/Pregame/Deepseq.hs view
@@ -0,0 +1,8 @@+module Pregame.Deepseq+  ( module X+  ) where++import Control.DeepSeq as X+  ( NFData+  , deepseq+  )
+ src/Pregame/Either.hs view
@@ -0,0 +1,20 @@+module Pregame.Either+  ( module X+  , maybeToLeft+  , maybeToRight+  ) where++import Data.Either.Combinators as X+  ( leftToMaybe+  , rightToMaybe+  )++import Pregame.Base++maybeToLeft :: b -> Maybe a -> Either a b+maybeToLeft _ (Just x) = Left x+maybeToLeft y Nothing  = Right y++maybeToRight :: b -> Maybe a -> Either b a+maybeToRight _ (Just x) = Right x+maybeToRight y Nothing  = Left y
+ src/Pregame/GhcPrim.hs view
@@ -0,0 +1,14 @@+module Pregame.GhcPrim+  ( module X+  ) where++import GHC.Types as X+  ( Bool(False, True)+  , Char+  , Int+  , Word+  , Float+  , Double+  , Ordering(LT, GT, EQ)+  , IO+  )
+ src/Pregame/IntegerGmp.hs view
@@ -0,0 +1,7 @@+module Pregame.IntegerGmp+  ( module X+  ) where++import GHC.Integer as X+  ( Integer+  )
+ src/Pregame/Lens.hs view
@@ -0,0 +1,27 @@+module Pregame.Lens+  ( module X+  ) where++import Control.Lens as X+  ( Lens+  , Lens'+  , makeLenses+  , lens+  , _1+  , _2+  , _3+  , _4+  , _5+  , _6+  , _7+  , _8+  , _9+  , to+  , (^.)+  , set+  , (.~)+  , over+  , (%~)+  , view+  , use+  )
+ src/Pregame/Mtl.hs view
@@ -0,0 +1,110 @@+module Pregame.Mtl+  ( module X+  , io+  ) where++import Control.Monad.Reader as X+  ( MonadReader+  , ask+  , reader+  , asks+  , ReaderT+  , runReaderT+  , mapReaderT+  , withReaderT+  , Reader+  , runReader+  , mapReader+  , withReader+  )+import Control.Monad.State as X+  ( MonadState+  , get+  , put+  , state+  , modify+  , modify'+  , gets+  , StateT+  , runStateT+  , evalStateT+  , execStateT+  , mapStateT+  , withStateT+  , State+  , runState+  , evalState+  , execState+  , mapState+  , withState+  )+import Control.Monad.Writer as X+  ( MonadWriter+  , writer+  , tell+  , WriterT+  , runWriterT+  , execWriterT+  , mapWriterT+  , Writer+  , runWriter+  , execWriter+  , mapWriter+  )+import Control.Monad.RWS as X+  ( MonadRWS+  , RWST+  , runRWST+  , evalRWST+  , execRWST+  , mapRWST+  , withRWST+  , RWS+  , rws+  , runRWS+  , evalRWS+  , execRWS+  , mapRWS+  , withRWS+  )+import Control.Monad.Trans as X+  ( MonadTrans+  , lift+  , MonadIO+  , liftIO+  )+import Control.Monad.List as X+  ( ListT+  , runListT+  , mapListT+  )+import Control.Monad.Except as X+  ( MonadError+  , throwError+  , catchError+  , ExceptT+  , runExceptT+  , mapExceptT+  , withExceptT+  , Except+  , runExcept+  , mapExcept+  , withExcept+  )+import Control.Monad.Cont as X+  ( MonadCont+  , callCC+  , ContT+  , runContT+  , mapContT+  , withContT+  , Cont+  , cont+  , runCont+  , mapCont+  , withCont+  )+import Pregame.GhcPrim++io :: MonadIO m => IO a -> m a+io = liftIO
+ src/Pregame/Safe.hs view
@@ -0,0 +1,27 @@+module Pregame.Safe+  ( module X+  ) where++import Safe as X+  ( readMay+  , tailMay+  , headMay+  , initMay+  , lastMay+  , minimumMay+  , maximumMay+  , foldr1May+  , foldl1May'+  , scanl1May+  , scanr1May+  , cycleMay+  , atMay+  , toEnumMay+  )+import Safe.Exact as X+  ( takeExactMay+  , dropExactMay+  , splitAtExactMay+  , zipExactMay+  , zipWithExactMay+  ) 
+ src/Pregame/Stm.hs view
@@ -0,0 +1,31 @@+module Pregame.Stm+  ( module X+  , writeTVarIO+  , modifyTVarIO+  , modifyTVarIO'+  ) where++import Control.Concurrent.STM as X+  ( STM+  , TVar+  , atomically+  , newTVar+  , newTVarIO+  , readTVar+  , readTVarIO+  , writeTVar+  , modifyTVar+  , modifyTVar'+  , swapTVar+  )++import Pregame.GhcPrim++writeTVarIO :: TVar a -> a -> IO ()+writeTVarIO tvar a = atomically (writeTVar tvar a)++modifyTVarIO :: TVar a -> (a -> a) -> IO ()+modifyTVarIO tvar f = atomically (modifyTVar tvar f)++modifyTVarIO' :: TVar a -> (a -> a) -> IO ()+modifyTVarIO' tvar f = atomically (modifyTVar' tvar f)
+ src/Pregame/Text.hs view
@@ -0,0 +1,31 @@+module Pregame.Text+  ( module X+  , LazyText+  ) where++import Data.Text as X+  ( Text+  , pack+  , unpack+  , lines+  , words+  , unlines+  , unwords+  )+import Data.Text.IO as X+  ( hGetContents+  , hGetLine+  , hPutStr+  , hPutStrLn+  , readFile+  , writeFile+  , appendFile+  , interact+  , getContents+  , getLine+  , putStr+  , putStrLn+  )+import qualified Data.Text.Lazy as Lazy (Text)++type LazyText = Lazy.Text
+ src/Pregame/Time.hs view
@@ -0,0 +1,12 @@+module Pregame.Time+  ( module X+  ) where++import Data.Time.Clock.POSIX as X+  ( POSIXTime+  , getPOSIXTime+  )+import Data.Time.Clock as X+  ( UTCTime+  , getCurrentTime+  )
+ src/Pregame/UnorderedContainers.hs view
@@ -0,0 +1,14 @@+module Pregame.UnorderedContainers+  ( module X+  , LazyHashMap+  , StrictHashMap+  ) where++import Data.HashSet as X+  ( HashSet+  )+import qualified Data.HashMap.Lazy as Lazy (HashMap)+import qualified Data.HashMap.Strict as Strict (HashMap)++type LazyHashMap = Lazy.HashMap+type StrictHashMap = Strict.HashMap
+ src/Pregame/Vector.hs view
@@ -0,0 +1,7 @@+module Pregame.Vector+  ( module X+  ) where++import Data.Vector as X+  ( Vector+  )