@hackage incipit-core0.5.1.0

A Prelude for Polysemy

About

This library provides a Prelude for Polysemy libraries, building upon incipit-base and exporting most of Polysemy's core modules. For a more comprehensive variant that includes some basic libraries, consider incipit.

Usage

Using a custom Prelude requires the use of Cabal mixins to hide the module from base and replace it with IncipitCore:

For hpack:

dependencies:
  - name: base
    version: '>= 4 && < 5'
    mixin:
      - hiding (Prelude)
  - name: incipit-core
    version: '>= 0.3'
    mixin:
      - (IncipitCore as Prelude)
      - hiding (IncipitCore)

For cabal:

build-depends:
    base >=4 && <5, incipit-core >= 0.3
mixins:
    base hiding (Prelude), incipit-core (IncipitCore as Prelude), incipit-core hiding (IncipitCore)

incipit-core used to export Prelude, but stack can't deal with that.

Custom Prelude

In order to extend incipit-core with a local Prelude, the module IncipitCore has to be reexported:

dependencies:
  - name: base
    version: '>= 4 && < 5'
    mixin:
      - hiding (Prelude)
  - incipit-core >= 0.3
module Prelude (
  module Prelude,
  module IncipitCore,
) where

import IncipitCore

projectName :: Text
projectName =
  "spaceship"