├── .gitignore ├── LICENSE ├── README.md ├── Setup.hs ├── helium-overture.cabal └── src └── Overture.hs /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .stack-work 3 | stack.yaml 4 | dist 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # overture 2 | 3 | This is Helium's custom Haskell Prelude. It is backwards-compatible with the existing Haskell 98 Prelude, but depends on a few packages so as to provide the easiest and lowest-friction approach for including commonly-used packages. 4 | 5 | It exports the following identifiers: 6 | * strict `Text` and `ByteString` types, from their respective packages 7 | * lifted `try`, `catch`, and `throw`, from [lifted-base](https://hackage.haskell.org/package/lifted-base) 8 | * `Control.Monad.Trans`, from [mtl](https://hackage.haskell.org/package/mtl) 9 | * `NFData`, from the [deepseq](https://hackage.haskell.org/package/deepseq) package 10 | * generalized `(.)` and `id` from [Control.Category](https://hackage.haskell.org/package/base-4.9.0.0/docs/Control-Category.html) 11 | 12 | All other operators from the Prelude are exported from the most generalized module possible. 13 | 14 | Please see [this](https://medium.com/@pthomson/overture-a-haskell-prelude-bc94a948febf#.qtexlki76) blog post for more information on why Overture exists and the reasoning behind its structure. 15 | 16 | It is released under the no-rights-reserved Unlicense, so you can do whatever you want with it. 17 | -------------------------------------------------------------------------------- /Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /helium-overture.cabal: -------------------------------------------------------------------------------- 1 | name: helium-overture 2 | version: 1.0.0 3 | synopsis: A backwards-compatible, modern replacement for the Prelude. 4 | license: PublicDomain 5 | author: Patrick Thomson 6 | maintainer: patrick@helium.com 7 | category: Web 8 | build-type: Simple 9 | cabal-version: >=1.10 10 | 11 | library 12 | hs-source-dirs: src 13 | exposed-modules: Overture 14 | default-language: Haskell2010 15 | build-depends: base < 6 16 | , bytestring 17 | , deepseq 18 | , lifted-base 19 | , text 20 | , transformers 21 | , mtl 22 | , random 23 | -------------------------------------------------------------------------------- /src/Overture.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE NoImplicitPrelude #-} 2 | -- | This is a convenience module that reexports the Prelude in terms of 3 | -- the generalized versions provided by the packages we use. 4 | module Overture 5 | ( module X 6 | ) 7 | where 8 | 9 | -- Haskell 98 stuff is easier to get at through the Prelude 10 | -- than through the GHC-specific modules 11 | import Prelude as X (Bounded (..), Double, Enum (..), 12 | Float, Floating (..), 13 | Fractional (..), Integer, 14 | Integral (..), Num (..), 15 | Real (..), RealFloat (..), 16 | RealFrac (..), asTypeOf, error, 17 | even, fromIntegral, gcd, lcm, 18 | odd, realToFrac, subtract, 19 | undefined, until, ($!), (^), 20 | (^^)) 21 | 22 | -- The important components of the base package 23 | import Control.Applicative as X hiding (liftA) 24 | import Control.Category as X 25 | import Control.DeepSeq as X (NFData) 26 | import Control.Exception.Lifted as X hiding (Handler) 27 | import Control.Monad as X hiding (forM, forM_, mapM, mapM_, 28 | msum, sequence, sequence_) 29 | import Control.Monad.Fix as X 30 | import Control.Monad.IO.Class as X 31 | import Control.Monad.Trans as X 32 | import Data.Bool as X 33 | import Data.ByteString as X (ByteString) 34 | import Data.Char as X 35 | import Data.Data as X hiding (Fixity (..), Infix (..), 36 | Prefix (..)) 37 | import Data.Either as X 38 | import Data.Eq as X 39 | import Data.Foldable as X 40 | import Data.Function as X hiding (id, (.)) 41 | import Data.Functor as X 42 | import Data.Int as X 43 | import Data.List as X hiding (all, and, any, concat, 44 | concatMap, elem, find, foldl, 45 | foldl', foldl1, foldr, foldr1, 46 | mapAccumL, mapAccumR, maximum, 47 | maximumBy, minimum, minimumBy, 48 | notElem, or, product, sum) 49 | import Data.Maybe as X 50 | import Data.Monoid as X 51 | import Data.Ord as X 52 | import Data.Ratio as X 53 | import Data.String as X 54 | import Data.Text as X (Text) 55 | import Data.Traversable as X 56 | import Data.Tuple as X 57 | import Data.Word as X 58 | 59 | import GHC.Float as X (roundTo) 60 | import GHC.Generics as X hiding (to) 61 | 62 | -- System facilities 63 | import System.Environment as X 64 | import System.Exit as X 65 | import System.IO as X hiding (utf8) 66 | import System.IO.Error as X (userError) 67 | import System.Random as X 68 | 69 | -- Read, Show, and printf 70 | import Text.Printf as X 71 | import Text.Read as X (Read (..), lex, read, readParen, 72 | reads) 73 | import Text.Show as X 74 | --------------------------------------------------------------------------------