Giter Club home page Giter Club logo

base-noprelude's Introduction

base-noprelude - base package sans Prelude

This package is, as the title gives away, a base-replacement that allows to define and/or use custom Preludes without having to use the -XNoImplicitePrelude language extension (or use import Prelude ()). I.e. instead of

{-# LANGUAGE NoImplicitPrelude #-}

module Main where

import CustomPrelude
import OtherStuff

by having a build-depends on base-noprelude instead of base and having a Prelude module in scope (can be provided by the current package or a 3rd package from build-depends), one can just write

module Main where

import OtherStuff

base-noprelude's People

Contributors

hvr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

base-noprelude's Issues

Doesn't work with `stack ghci`

(Demo Gist)

stack ghci fails with this pattern, says

$ stack ghci
Configuring GHCi with the following packages: bnp-test
GHCi, version 7.10.3: http://www.haskell.org/ghc/  :? for help

<interactive>:1:1:
    attempting to use module ‘Prelude’ (/Users/mike/Development/sandbox/basenoprelude/Prelude.hs) which is not loaded

This is an unfortunate deal breaker for using base-noprelude. Might be nice to mention it in the README.

Cannot compile with Cabal-1.22

With GHC-7.4.2 I get

[1 of 1] Compiling Main             ( /tmp/cabal-tmp-15698/base-noprelude-4.5.1.0/dist/setup/setup.hs, /tmp/cabal-tmp-15698/base-noprelude-4.5.1.0/dist/setup/Main.o )
Linking /tmp/cabal-tmp-15698/base-noprelude-4.5.1.0/dist/setup/setup ...
setup: base-noprelude cannot be built with Cabal versions newer than 1.20
(`Setup.hs` imported Cabal library version 1.22.4.0)
Failed to install base-noprelude-4.5.1.0

Similar result for GHC-7.8.4.

any downside to using mixins instead of this?

eg. mixins: base hiding (Prelude)

If there is no downside, might it be recommended to use mixins for those cabal versions which support it? AFAIK base-noprelude isnt an official Haskell project so failure for upkeep means potential for breakage, while the mixins does not.

Add myself as a maintainer

Hi @hvr ,

Seems there is not a lot of active maintenance on this package. I'd happy to help maintain it in terms of responding to issues, keeping it up to date with new releases of base if you like?

I haven't released a package to hackage before, but I'm assuming that is something I will be able to figure out. I might need permissions or an account to do this?

Thanks

Reexport Prelude with a different name

I had problem using base-noprelude in my codebase because my custom Prelude was importing functions from the original prelude. Hence my codebase was depending on both base and base-noprelude which was leading to conflict in a few scenarios (for example, when building a repl with all the modules of the codebase).

In guibou@c548104 I experimented with reexporting Prelude as a different name (here, BasePrelude).

This way, a codebase which just want to override the basic Prelude can simply import it as long as base-noprelude is available, for example:

module Prelude (module BasePrelude) where

import BasePrelude hiding (head)

-- | A safer head
head :: [a] -> Maybe a
head = ...

Instead of importing from base which will pull base in the dependencies of this module.

I'm mostly opening this issue for reference about my problem (and workaround), but if you release a new version of base-noprelude, I think it may be convenient to reexporte Prelude with a different name inside it.

GHCJS doesn't like GHC.Event

When trying to compile base-noprelude with GHCJS, it fails on the GHC.Event reexport. Is it possible to disable it for ghcjs?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.