zio 0.1.0.0 → 0.1.0.2
raw patch · 5 files changed
+191/−30 lines, 5 filesdep ~basedep ~mtldep ~transformersPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: base, mtl, transformers, unexceptionalio, unexceptionalio-trans
API changes (from Hackage documentation)
+ ZIO.Trans: (<$) :: Functor f => a -> f b -> f a
+ ZIO.Trans: class Monad m => MonadFail (m :: Type -> Type)
- ZIO.Trans: ReaderT :: (r -> m a) -> ReaderT r a
+ ZIO.Trans: ReaderT :: (r -> m a) -> ReaderT r (m :: Type -> Type) a
- ZIO.Trans: [runReaderT] :: ReaderT r a -> r -> m a
+ ZIO.Trans: [runReaderT] :: ReaderT r (m :: Type -> Type) a -> r -> m a
- ZIO.Trans: fail :: Monad m => String -> m a
+ ZIO.Trans: fail :: MonadFail m => String -> m a
- ZIO.Trans: fix :: () => (a -> a) -> a
+ ZIO.Trans: fix :: (a -> a) -> a
- ZIO.Trans: fromIO :: Unexceptional m => IO a -> ExceptT SomeNonPseudoException m a
+ ZIO.Trans: fromIO :: forall (m :: Type -> Type) a. Unexceptional m => IO a -> ExceptT SomeNonPseudoException m a
- ZIO.Trans: infixl 1 >>
+ ZIO.Trans: infixl 1 >>=
- ZIO.Trans: mapReader :: () => (a -> b) -> Reader r a -> Reader r b
+ ZIO.Trans: mapReader :: (a -> b) -> Reader r a -> Reader r b
- ZIO.Trans: mapReaderT :: () => (m a -> n b) -> ReaderT r m a -> ReaderT r n b
+ ZIO.Trans: mapReaderT :: (m a -> n b) -> ReaderT r m a -> ReaderT r n b
- ZIO.Trans: runReader :: () => Reader r a -> r -> a
+ ZIO.Trans: runReader :: Reader r a -> r -> a
- ZIO.Trans: withReader :: () => (r' -> r) -> Reader r a -> Reader r' a
+ ZIO.Trans: withReader :: (r' -> r) -> Reader r a -> Reader r' a
- ZIO.Trans: withReaderT :: () => (r' -> r) -> ReaderT r m a -> ReaderT r' m a
+ ZIO.Trans: withReaderT :: forall r' r (m :: Type -> Type) a. (r' -> r) -> ReaderT r m a -> ReaderT r' m a
Files
- README.md +67/−11
- docs/BuildNotes.md +57/−0
- package-shell.nix +37/−0
- shell.nix +5/−0
- zio.cabal +25/−19
README.md view
@@ -61,15 +61,71 @@ so we'd prefer to have e.g. `uelift :: ∀ e a. UIO a -> EIO e a`, not `uelift :: UIO a -> UEIO a`. -[//]: # (Table generated from docs/type_aliases.csv using https://www.tablesgenerator.com/markdown_tables)+[//]: # (`nix-shell -p pandoc` then `pandoc TypesTable.md -o TypesTable.html`) -| Haskell Type | Alias for | Scala Type | Notes |-|-------------- |------------------------------------- |-------------- |------------------------------------------------------------------------------------------------------- |-| `ZIO r e a` | | `ZIO[R,E,A]` | |-| `UIO a` | | `UIO[A]` | This is a type alias in Scala but a concrete type in Haskell due to UIO being an inner monadic type. |-| `EIO e a` | | `IO[E, A]` | This is a type alias in Scala but a concrete type in Haskell due to EIO being an inner monadic type. |-| `RIO r a` | `ZIO r SomeNonPseudoException a` | `RIO[R, A]` | Same idea as in Scala. Not to be confused with the RIO library's `RIO` monad, but they are isomorphic. |-| `Task a` | `ZIO Void SomeNonPseudoException a` | `Task[A]` | |-| `UEIO a` | `EIO Void a` | `UIO[A]` | |-| `URIO r a` | `ZIO r Void a` | `URIO[R, A]` | Same idea as in Scala; a ZIO value isomorphic to a RIO value (can be projected to the RIO value). |-| `UZIO a` | `ZIO Void Void a` | `UIO[A]` | |+<table>+<colgroup>+<col style="width: 8%" />+<col style="width: 22%" />+<col style="width: 8%" />+<col style="width: 61%" />+</colgroup>+<thead>+<tr class="header">+<th>Haskell Type</th>+<th>Alias for</th>+<th>Scala Type</th>+<th>Notes</th>+</tr>+</thead>+<tbody>+<tr class="odd">+<td><code>ZIO r e a</code></td>+<td></td>+<td><code>ZIO[R,E,A]</code></td>+<td></td>+</tr>+<tr class="even">+<td><code>UIO a</code></td>+<td></td>+<td><code>UIO[A]</code></td>+<td>This is a type alias in Scala but a concrete type in Haskell due to UIO being an inner monadic type.</td>+</tr>+<tr class="odd">+<td><code>EIO e a</code></td>+<td></td>+<td><code>IO[E, A]</code></td>+<td>This is a type alias in Scala but a concrete type in Haskell due to EIO being an inner monadic type.</td>+</tr>+<tr class="even">+<td><code>RIO r a</code></td>+<td><code>ZIO r SomeNonPseudoException a</code></td>+<td><code>RIO[R, A]</code></td>+<td>Same idea as in Scala. Not to be confused with the RIO library’s <code>RIO</code> monad, but they are isomorphic.</td>+</tr>+<tr class="odd">+<td><code>Task a</code></td>+<td><code>ZIO Void SomeNonPseudoException a</code></td>+<td><code>Task[A]</code></td>+<td></td>+</tr>+<tr class="even">+<td><code>UEIO a</code></td>+<td><code>EIO Void a</code></td>+<td><code>UIO[A]</code></td>+<td></td>+</tr>+<tr class="odd">+<td><code>URIO r a</code></td>+<td><code>ZIO r Void a</code></td>+<td><code>URIO[R, A]</code></td>+<td>Same idea as in Scala; a ZIO value isomorphic to a RIO value (can be projected to the RIO value).</td>+</tr>+<tr class="even">+<td><code>UZIO a</code></td>+<td><code>ZIO Void Void a</code></td>+<td><code>UIO[A]</code></td>+<td></td>+</tr>+</tbody>+</table>
+ docs/BuildNotes.md view
@@ -0,0 +1,57 @@+# Building++Many of the notes below should work outside of Nix,+by omitting the nix-specific commands or flags.++## Updating cabal build file++```+$ nix-shell -p haskellPackages.hpack cabal2nix+$ hpack --force # force may not be necessary+$ cabal2nix --shell . > package-shell.nix+```++## Build the project++### Cabal++Note, if things go poorly, it is always worth trying+`cabal --enable-nix clean` or maybe `cabal clean` as well.++At this point, you can exit the shell used to generate+the `.cabal` and `.nix` file if you haven't already.++First, make cabal-install available if it isn't, then+run the build.++```+$ nix-shell -p cabal-install+$ nix-shell shell.nix --run "cabal build"+```++Note that `shell.nix` is a wrapper for the generated +`package-shell.nix` that only servers to pin nixpkgs,+so you could either change the version on nixpkgs in+`shell.nix` or run `nix-shell shell.nix --run "cabal build"`+directly, which would use your existing nixpkgs channel.+Of course, this is less likely to work due to potential version+bound conflicts, but may be useful.++#### Package and release++```+$ nix-shell shell.nix --run "cabal sdist"+```++### Stack++```+$ nix-shell -p stack+$ stack --nix build+```++#### Generate documentation (haddocks)++```+$ stack --nix build --haddock+```
+ package-shell.nix view
@@ -0,0 +1,37 @@+{ nixpkgs ? import <nixpkgs> {}, compiler ? "default", doBenchmark ? false }:++let++ inherit (nixpkgs) pkgs;++ f = { mkDerivation, base, hpack, mtl, stdenv, transformers+ , unexceptionalio, unexceptionalio-trans+ }:+ mkDerivation {+ pname = "zio";+ version = "0.1.0.2";+ src = ./.;+ libraryHaskellDepends = [+ base mtl transformers unexceptionalio unexceptionalio-trans+ ];+ libraryToolDepends = [ hpack ];+ testHaskellDepends = [+ base mtl transformers unexceptionalio unexceptionalio-trans+ ];+ prePatch = "hpack";+ homepage = "https://github.com/bbarker/haskell-zio#readme";+ description = "App-centric Monad-transformer based on Scala ZIO (UIO + ReaderT + ExceptT)";+ license = stdenv.lib.licenses.mpl20;+ };++ haskellPackages = if compiler == "default"+ then pkgs.haskellPackages+ else pkgs.haskell.packages.${compiler};++ variant = if doBenchmark then pkgs.haskell.lib.doBenchmark else pkgs.lib.id;++ drv = variant (haskellPackages.callPackage f {});++in++ if pkgs.lib.inNixShell then drv.env else drv
+ shell.nix view
@@ -0,0 +1,5 @@+let+ pkgShell = (import ./package-shell.nix);+ # 20.09 on 11/20/2020+ pkgs = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/58f9c4c7d3a42c912362ca68577162e38ea8edfb.tar.gz") {};+ in pkgShell {nixpkgs = pkgs;}
zio.cabal view
@@ -1,29 +1,35 @@-cabal-version: 1.12+cabal-version: 1.18 --- This file has been generated from package.yaml by hpack version 0.33.0.+-- This file has been generated from package.yaml by hpack version 0.34.2. -- -- see: https://github.com/sol/hpack ----- hash: 6be80043f3a5bef1bd4f8f34b4c51639fdb74962f2377876443eab74c7fd669e+-- hash: a6a90a815ae55d95b260ad12add3e1bffdb398a6a256d8dd04c752cc7864f805 name: zio-version: 0.1.0.0-description: Please see the README on GitHub at <https://github.com/githubuser/haskell-zio#readme>-homepage: https://github.com/githubuser/haskell-zio#readme-bug-reports: https://github.com/githubuser/haskell-zio/issues+version: 0.1.0.2+synopsis: App-centric Monad-transformer based on Scala ZIO (UIO + ReaderT + ExceptT).+description: Please see the README on GitHub at <https://github.com/bbarker/haskell-zio#readme>+category: Control+homepage: https://github.com/bbarker/haskell-zio#readme+bug-reports: https://github.com/bbarker/haskell-zio/issues author: Brandon Elam Barker-maintainer: brandon.barker@cornell.edu+maintainer: brandon.barker@gmail.com copyright: 2020 Brandon Elam Barker license: MPL-2.0 license-file: LICENSE build-type: Simple extra-source-files: README.md+ shell.nix+ package-shell.nix ChangeLog.md+extra-doc-files:+ docs/BuildNotes.md source-repository head type: git- location: https://github.com/githubuser/haskell-zio+ location: https://github.com/bbarker/haskell-zio library exposed-modules:@@ -34,11 +40,11 @@ src ghc-options: -Wall -Wtabs -Wincomplete-record-updates build-depends:- base >=4.7 && < 5- , mtl >= 2.2 && < 2.3- , transformers >= 0.5.6 && < 0.6- , unexceptionalio >= 0.5.1 && < 0.6- , unexceptionalio-trans >= 0.5.1 && < 0.6+ base >=4.7 && <5+ , mtl >=2.2.2 && <2.3+ , transformers >=0.5.6 && <0.6+ , unexceptionalio >=0.5.1 && <0.6+ , unexceptionalio-trans >=0.5.1 && <0.6 default-language: Haskell2010 test-suite zio-test@@ -50,10 +56,10 @@ test ghc-options: -threaded -rtsopts -with-rtsopts=-N build-depends:- base- , mtl- , transformers- , unexceptionalio- , unexceptionalio-trans+ base >=4.7 && <5+ , mtl >=2.2.2 && <2.3+ , transformers >=0.5.6 && <0.6+ , unexceptionalio >=0.5.1 && <0.6+ , unexceptionalio-trans >=0.5.1 && <0.6 , zio default-language: Haskell2010