1
Fork 0

Setup default Prelude and basic documentation.

master
Joshua Potter 2017-11-25 18:49:55 -08:00
parent 86570d48a5
commit ebb1806c4a
4 changed files with 143 additions and 9 deletions

View File

@ -1 +1,23 @@
# postlude # Postlude
A replacement to the default Prelude.
## Usage
Disable the built-in prelude at the top of your file:
```haskell
{-# LANGUAGE NoImplicitPrelude #-}
```
Or directly in your project cabal file:
```haskell
default-extensions: NoImplicitPrelude
```
Then in your modules:
```haskell
import Postlude
```

View File

@ -13,8 +13,9 @@ build-type: Simple
cabal-version: >=1.10 cabal-version: >=1.10
extra-source-files: README.md extra-source-files: README.md
executable postlude library
exposed-modules: Postlude
hs-source-dirs: src hs-source-dirs: src
main-is: Main.hs
default-language: Haskell2010 default-language: Haskell2010
build-depends: base >= 4.7 && < 5 build-depends: base >= 4.7 && < 5,
mtl == 2.2.1

View File

@ -1,5 +0,0 @@
module Main where
main :: IO ()
main = do
putStrLn "hello world"

116
src/Postlude.hs Normal file
View File

@ -0,0 +1,116 @@
{-# LANGUAGE NoImplicitPrelude #-}
module Postlude (module X) where
import Control.Applicative as X
( (*>)
, (<$>)
, (<*)
, (<*>)
, Applicative
, pure
)
import Control.Arrow as X
( (&&&)
, (***)
, Arrow
, arr
, first
, returnA
, second
)
import Control.Monad as X
( Functor
, Monad
, MonadPlus
, (>>)
, (>>=)
, fail
, fmap
, return
)
import Control.Monad.Trans as X
( MonadIO
, lift
, liftIO
)
import Data.Bool as X
( Bool(..)
)
import Data.Char as X
( Char
)
import Data.Either as X
( Either(Left, Right)
)
import Data.Eq as X
( Eq(..)
)
import Data.Function as X
( ($)
, (.)
, id
)
import Data.Int as X
( Int
, Int8
, Int16
, Int32
, Int64
)
import Data.Foldable as X
( foldl1
, foldr1
)
import Data.Maybe as X
( Maybe(Just, Nothing)
)
import Data.Monoid as X
( Monoid
, mappend
, mconcat
, mempty
)
import Data.Ord as X
( Ord(..)
)
import Data.Traversable as X
( Traversable
, for
, forM
, mapM
, sequence
, sequenceA
, traverse
)
import System.Environment as X
( getArgs
)
import System.IO as X
( FilePath
, Handle
, IO
, IOMode(..)
, openFile
, print
, stderr
, stdin
, stdout
, withFile
)