packages feed

atelier-prelude (empty) → 0.1.0.0

raw patch · 5 files changed

+259/−0 lines, 5 filesdep +basedep +effectful-coredep +relude

Dependencies added: base, effectful-core, relude

Files

+ CHANGELOG.md view
@@ -0,0 +1,18 @@+# Changelog++All notable changes to `atelier-prelude` will be documented in this file.++The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),+and this project adheres to the [PVP](https://pvp.haskell.org/).++## [Unreleased]++### Added++- Initial release: a relude-based custom prelude adapted for Effectful+  conventions, extracted from the atelier toolkit.+- Lifted system, environment, handle, terminal and file operations+  (`Relude.Lifted.*` and `Relude.File`) and console output (`Relude.Print`)+  are intentionally not re-exported; the corresponding `atelier-core` effects+  (e.g. `Atelier.Effects.Env`, `Atelier.Effects.File`, `Atelier.Effects.Console`)+  should be used instead.
+ LICENSE view
@@ -0,0 +1,21 @@+MIT License++Copyright (c) 2025 Christian Georgii++Permission is hereby granted, free of charge, to any person obtaining a copy+of this software and associated documentation files (the "Software"), to deal+in the Software without restriction, including without limitation the rights+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell+copies of the Software, and to permit persons to whom the Software is+furnished to do so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in all+copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE+SOFTWARE.
+ README.md view
@@ -0,0 +1,47 @@+# atelier-prelude++A custom prelude based on [relude](https://github.com/kowainik/relude), adapted for [Effectful](https://github.com/haskell-effectful/effectful) conventions. Part of the **atelier** toolkit.++## Usage++`atelier-prelude` exposes a module named `Prelude`. To make it the implicit prelude, hide `base`'s `Prelude` with a mixin — GHC's automatic `import Prelude` then resolves to this one, with no `NoImplicitPrelude` and no per-module imports.++In `package.yaml` (hpack):++```yaml+dependencies:+- name: base+  mixin:+  - hiding (Prelude)+- atelier-prelude+```++or in a `.cabal` file:++```cabal+build-depends: base, atelier-prelude+mixins:        base hiding (Prelude)+```++Add `-Wno-implicit-prelude` to your `ghc-options` to silence the implicit-prelude warning.++## What's different from relude++Lifted, `IO`-based operations from relude are intentionally **not** re-exported, so that effects are threaded explicitly through Effectful rather than performed in `IO`:++- `Relude.Lifted.*` (system, environment, handle, terminal, file operations)+- `Relude.File`+- `Relude.Print` (console output)++Use the corresponding `atelier-core` effects instead — e.g. `Atelier.Effects.Env`, `Atelier.Effects.File`, `Atelier.Effects.Console`.++## Part of atelier++- [`atelier-prelude`](https://github.com/atelier-hub/tricorder/tree/main/atelier-prelude) — this package+- [`atelier-core`](https://github.com/atelier-hub/tricorder/tree/main/atelier-core) — foundational effects and utilities+- [`atelier-db`](https://github.com/atelier-hub/tricorder/tree/main/atelier-db) — relational database effect (Hasql/Rel8)+- [`atelier-testing`](https://github.com/atelier-hub/tricorder/tree/main/atelier-testing) — database-backed test utilities++## License++MIT — see [LICENSE](LICENSE).
+ atelier-prelude.cabal view
@@ -0,0 +1,56 @@+cabal-version: 1.18++-- This file has been generated from package.yaml by hpack version 0.38.2.+--+-- see: https://github.com/sol/hpack++name:           atelier-prelude+version:        0.1.0.0+synopsis:       Custom relude-based prelude with Effectful conventions+description:    A custom prelude based on relude, adapted for Effectful — part of the atelier toolkit.+category:       Prelude+homepage:       https://github.com/atelier-hub/tricorder/tree/main/atelier-prelude+bug-reports:    https://github.com/atelier-hub/tricorder/issues+author:         Christian Georgii+maintainer:     christian.georgii@tweag.io+license:        MIT+license-file:   LICENSE+build-type:     Simple+extra-doc-files:+    CHANGELOG.md+    README.md++source-repository head+  type: git+  location: https://github.com/atelier-hub/tricorder++library+  exposed-modules:+      Prelude+  other-modules:+      Paths_atelier_prelude+  hs-source-dirs:+      src+  default-extensions:+      BlockArguments+      DataKinds+      DeriveAnyClass+      DerivingStrategies+      DerivingVia+      DuplicateRecordFields+      FlexibleContexts+      GADTs+      LambdaCase+      MultiWayIf+      OverloadedLabels+      OverloadedRecordDot+      OverloadedStrings+      StrictData+      TemplateHaskell+      TypeFamilies+  ghc-options: -Weverything -Wno-unsafe -Wno-missing-safe-haskell-mode -Wno-monomorphism-restriction -Wno-missing-kind-signatures -Wno-missing-poly-kind-signatures -Wno-missing-role-annotations -Wno-missing-local-signatures -Wno-missing-import-lists -Wno-implicit-prelude -Wno-unticked-promoted-constructors -Wno-unused-packages -Wno-all-missed-specialisations -Wno-missed-specialisations+  build-depends:+      base ==4.20.*+    , effectful-core ==2.6.*+    , relude ==1.2.*+  default-language: GHC2021
+ src/Prelude.hs view
@@ -0,0 +1,117 @@+-- | This Prelude is meant to mimic the @relude@ package's "Relude" module,+-- with the following exceptions:+--+-- - No MTL classes or monads.+-- - No functions for manipulating IORefs, MVars and STM-based vars.+-- - No lifted system, environment, handle, terminal or file operations+--   (@Relude.Lifted.*@ and @Relude.File@), and no console output+--   (@Relude.Print@). These overlap with the effects provided by+--   @atelier-core@ (e.g. @Atelier.Effects.Env@, @Atelier.Effects.File@,+--   @Atelier.Effects.Console@); use those instead.+module Prelude+    ( -- * Reexports from Effectful+      module Effectful++      -- * Reexports from Relude.Monad+    , module Control.Monad+    , module Control.Monad.Fail+    , module Data.Either+    , module Data.Maybe+    , module Relude.Monad+    , module Relude.Monad.Either+    , module Relude.Monad.Maybe++      -- * Reexports from Relude+    , module Relude.Applicative+    , module Relude.Base+    , module Relude.Bool+    , module Relude.Container+    , module Relude.Debug+    , module Relude.DeepSeq+    , module Relude.Enum+    , module Relude.Exception+    , module Relude.Foldable+    , module Relude.Function+    , module Relude.Functor+    , module Relude.List+    , module Relude.Monoid+    , module Relude.Nub+    , module Relude.Numeric+    , module Relude.String+    ) where++import Effectful (Eff, MonadIO (liftIO), (:>))+import Effectful.Error.Static+++{- FOURMOLU_DISABLE -}+-- Get all exports from Relude except the Relude.Lifted, Relude.Monad and+-- Relude.Print modules.+import Relude.Applicative+import Relude.Base+import Relude.Bool+import Relude.Container+import Relude.Debug+import Relude.DeepSeq+import Relude.Enum+import Relude.Exception+import Relude.Foldable+import Relude.Function+import Relude.Functor+import Relude.List+import Relude.Monoid+import Relude.Nub+import Relude.Numeric+import Relude.String++-- From Relude.Monad, we don't want Relude.Monad.Reexport and Relude.Monad.Trans.+import Relude.Monad.Either+import Relude.Monad.Maybe+import Relude.Monad (chainedTo, infinitely)++-- From Relude.Monad.Reexport, we don't want any transformer modules, like the following:+-- Control.Monad.Except+-- Control.Monad.Reader+-- Control.Monad.State.Strict+-- Control.Monad.Trans+-- Control.Monad.Trans.Identity+-- Control.Monad.Trans.Maybe +import Control.Monad+    ( Monad (return, (>>), (>>=))+    , MonadPlus (..)+    , filterM+    , forever+    , join+    , mapAndUnzipM+    , mfilter+    , replicateM+    , replicateM_+    , zipWithM+    , zipWithM_+    , (<$!>)+    , (<=<)+    , (=<<)+    , (>=>)+    )+import Control.Monad.Fail (MonadFail (..))+import Data.Either+    ( Either (..)+    , either+    , isLeft+    , isRight+    , lefts+    , partitionEithers+    , rights+    )+import Data.Maybe+    ( Maybe (..)+    , catMaybes+    , fromMaybe+    , isJust+    , isNothing+    , listToMaybe+    , mapMaybe+    , maybe+    , maybeToList+    )+{- FOURMOLU_ENABLE -}