mirror of
https://github.com/lexi-lambda/freer-simple.git
synced 2024-12-23 22:23:27 +03:00
Renaming to freer-effects; updating copyright and package description
Addresses #4
This commit is contained in:
parent
52340b7e56
commit
252c183469
2
LICENSE
2
LICENSE
@ -1,4 +1,4 @@
|
|||||||
Copyright (c) 2016, Allele Dev
|
Copyright (c) 2016, Allele Dev; 2017 Ixperta Solutions s.r.o.
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
72
README.md
72
README.md
@ -1,4 +1,4 @@
|
|||||||
# Freer: Extensible Effects with Freer Monads
|
# Freer Effects: Extensible Effects with Freer Monads
|
||||||
|
|
||||||
[![Haskell Programming Language](https://img.shields.io/badge/language-Haskell-blue.svg)](http://www.haskell.org)
|
[![Haskell Programming Language](https://img.shields.io/badge/language-Haskell-blue.svg)](http://www.haskell.org)
|
||||||
[![BSD3 License](http://img.shields.io/badge/license-BSD3-brightgreen.svg)](https://tldrlegal.com/license/bsd-3-clause-license-%28revised%29)
|
[![BSD3 License](http://img.shields.io/badge/license-BSD3-brightgreen.svg)](https://tldrlegal.com/license/bsd-3-clause-license-%28revised%29)
|
||||||
@ -7,25 +7,33 @@
|
|||||||
[![Hackage Dependencies](https://img.shields.io/hackage-deps/v/freer.svg)](http://packdeps.haskellers.com/reverse/freer)
|
[![Hackage Dependencies](https://img.shields.io/hackage-deps/v/freer.svg)](http://packdeps.haskellers.com/reverse/freer)
|
||||||
[![Build](https://travis-ci.org/IxpertaSolutions/freer.svg)](https://travis-ci.org/IxpertaSolutions/freer)
|
[![Build](https://travis-ci.org/IxpertaSolutions/freer.svg)](https://travis-ci.org/IxpertaSolutions/freer)
|
||||||
|
|
||||||
Freer is an implementation of
|
|
||||||
["Freer Monads, More Extensible Effects"](http://okmij.org/ftp/Haskell/extensible/more.pdf). Much
|
# Description
|
||||||
of the implementation is a repackaging and cleaning up of the
|
|
||||||
reference materials provided
|
Library `freer-effects` is an implementation of effect system for Haskell,
|
||||||
[here](http://okmij.org/ftp/Haskell/extensible/).
|
which is based on the work of Oleg Kiselyov et al.:
|
||||||
|
|
||||||
|
* [Freer Monads, More Extensible Effects](http://okmij.org/ftp/Haskell/extensible/more.pdf)
|
||||||
|
* [Extensible Effects](http://okmij.org/ftp/Haskell/extensible/exteff.pdf)
|
||||||
|
|
||||||
|
Much of the implementation is a repackaging and cleaning up of the reference
|
||||||
|
materials provided [here](http://okmij.org/ftp/Haskell/extensible/).
|
||||||
|
|
||||||
|
|
||||||
# Features
|
# Features
|
||||||
|
|
||||||
The key features of Freer are:
|
The key features of Freer are:
|
||||||
|
|
||||||
* An efficient effect system for Haskell as a library
|
* An efficient effect system for Haskell as a library.
|
||||||
* Implementations for several common Haskell monad instances:
|
* Implementations for several common Haskell monads as effects:
|
||||||
* Reader
|
* `Reader`
|
||||||
* Writer
|
* `Writer`
|
||||||
* State
|
* `State`
|
||||||
* StateRW: State in terms of Reader/Writer
|
* `StateRW`: State in terms of Reader/Writer.
|
||||||
* Trace
|
* `Trace`
|
||||||
* Exception
|
* `Exception`
|
||||||
* Core components for defining your own Effects
|
* Core components for defining your own Effects.
|
||||||
|
|
||||||
|
|
||||||
# Example: Teletype DSL
|
# Example: Teletype DSL
|
||||||
|
|
||||||
@ -86,10 +94,12 @@ runTeletypePure inputs req =
|
|||||||
go (_, os) ExitSuccess _ = pure ([], os)
|
go (_, os) ExitSuccess _ = pure ([], os)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
# Contributing
|
# Contributing
|
||||||
|
|
||||||
Contributions are welcome! Documentation, examples, code, and
|
Contributions are welcome! Documentation, examples, code, and feedback - they
|
||||||
feedback - they all help.
|
all help.
|
||||||
|
|
||||||
|
|
||||||
## Developer Setup
|
## Developer Setup
|
||||||
|
|
||||||
@ -99,26 +109,34 @@ GHC/Haskell for you, and automates common developer tasks.
|
|||||||
|
|
||||||
The key commands are:
|
The key commands are:
|
||||||
|
|
||||||
* stack setup : install GHC
|
* `stack setup`: install GHC
|
||||||
* stack build
|
* `stack build`
|
||||||
* stack clean
|
* `stack clean`
|
||||||
* stack haddock : builds documentation
|
* `stack haddock`: builds documentation
|
||||||
* stack test
|
* `stack test`
|
||||||
* stack bench
|
* `stack bench`
|
||||||
* stack ghci : start a REPL instance
|
* `stack ghci`: start a REPL instance
|
||||||
|
|
||||||
|
|
||||||
# Licensing
|
# Licensing
|
||||||
|
|
||||||
This project is distrubted under a BSD3 license. See the included
|
This project is distrubted under a BSD3 license. See the included
|
||||||
LICENSE file for more details.
|
LICENSE file for more details.
|
||||||
|
|
||||||
|
|
||||||
# Acknowledgements
|
# Acknowledgements
|
||||||
|
|
||||||
|
Package `freer-effects` started as a fork of
|
||||||
|
[freer](http://hackage.haskell.org/package/freer) authored by Allele Dev.
|
||||||
|
|
||||||
This package would not be possible without the paper and the reference
|
This package would not be possible without the paper and the reference
|
||||||
implementation. In particular:
|
implementation. In particular:
|
||||||
|
|
||||||
* Data.Open.Union maps to [OpenUnion41.hs](http://okmij.org/ftp/Haskell/extensible/OpenUnion41.hs)
|
* `Data.Open.Union` maps to
|
||||||
* Data.FTCQueue maps to [FTCQueue1](http://okmij.org/ftp/Haskell/extensible/FTCQueue1.hs)
|
[OpenUnion41.hs](http://okmij.org/ftp/Haskell/extensible/OpenUnion41.hs)
|
||||||
* Control.Monad.Freer* maps to [Union1.hs](http://okmij.org/ftp/Haskell/extensible/Eff1.hs)
|
* `Data.FTCQueue` maps to
|
||||||
|
[FTCQueue1](http://okmij.org/ftp/Haskell/extensible/FTCQueue1.hs)
|
||||||
|
* `Control.Monad.Freer*` maps to
|
||||||
|
[Union1.hs](http://okmij.org/ftp/Haskell/extensible/Eff1.hs)
|
||||||
|
|
||||||
There will be deviations from the source.
|
There will be deviations from the source.
|
||||||
|
139
freer-effects.cabal
Normal file
139
freer-effects.cabal
Normal file
@ -0,0 +1,139 @@
|
|||||||
|
name: freer-effects
|
||||||
|
version: 0.2.4.1
|
||||||
|
synopsis: Implementation of effect system for Haskell.
|
||||||
|
description:
|
||||||
|
Implementation of effect system for Haskell, which is based on the work of
|
||||||
|
Oleg Kiselyov et al.:
|
||||||
|
.
|
||||||
|
* <http://okmij.org/ftp/Haskell/extensible/more.pdf Freer Monads, More Extensible Effects>
|
||||||
|
* <http://okmij.org/ftp/Haskell/extensible/exteff.pdf Extensible Effects>
|
||||||
|
.
|
||||||
|
The key features are:
|
||||||
|
.
|
||||||
|
* An efficient effect system for Haskell - as a library!
|
||||||
|
.
|
||||||
|
* Reimplementations of several common Haskell monad transformers as effects.
|
||||||
|
.
|
||||||
|
* Core components for defining your own Effects.
|
||||||
|
|
||||||
|
license: BSD3
|
||||||
|
license-file: LICENSE
|
||||||
|
author: Allele Dev, Ixcom Core Team, and other contributors
|
||||||
|
maintainer: ixcom-core@ixperta.com
|
||||||
|
copyright: (c) 2016 Allele Dev; 2017 Ixperta Solutions s.r.o.
|
||||||
|
homepage: https://github.com/IxpertaSolutions/freer
|
||||||
|
bug-reports: https://github.com/IxpertaSolutions/freer/issues
|
||||||
|
category: Control
|
||||||
|
|
||||||
|
build-type: Simple
|
||||||
|
cabal-version: >=1.10
|
||||||
|
tested-with: GHC==7.10.3, GHC==8.0.1, GHC==7.8.4
|
||||||
|
|
||||||
|
extra-source-files:
|
||||||
|
README.md
|
||||||
|
changelog.md
|
||||||
|
|
||||||
|
source-repository head
|
||||||
|
type: git
|
||||||
|
location: git clone https://github.com/IxpertaSolutions/freer.git
|
||||||
|
|
||||||
|
flag pedantic
|
||||||
|
description: Pass additional warning flags and -Werror to GHC.
|
||||||
|
default: False
|
||||||
|
manual: True
|
||||||
|
|
||||||
|
library
|
||||||
|
hs-source-dirs: src
|
||||||
|
exposed-modules:
|
||||||
|
Control.Monad.Freer
|
||||||
|
, Control.Monad.Freer.Coroutine
|
||||||
|
, Control.Monad.Freer.Cut
|
||||||
|
, Control.Monad.Freer.Exception
|
||||||
|
, Control.Monad.Freer.Fresh
|
||||||
|
, Control.Monad.Freer.Internal
|
||||||
|
, Control.Monad.Freer.Reader
|
||||||
|
, Control.Monad.Freer.State
|
||||||
|
, Control.Monad.Freer.StateRW
|
||||||
|
, Control.Monad.Freer.Trace
|
||||||
|
, Control.Monad.Freer.Writer
|
||||||
|
, Data.FTCQueue
|
||||||
|
, Data.Open.Union
|
||||||
|
, Data.Open.Union.Internal
|
||||||
|
|
||||||
|
default-language: Haskell2010
|
||||||
|
|
||||||
|
build-depends: base >=4.7 && <5
|
||||||
|
|
||||||
|
ghc-options: -Wall
|
||||||
|
|
||||||
|
if flag(pedantic)
|
||||||
|
ghc-options: -Werror
|
||||||
|
|
||||||
|
executable freer-examples
|
||||||
|
hs-source-dirs: examples/src
|
||||||
|
main-is: Main.hs
|
||||||
|
other-modules:
|
||||||
|
Common
|
||||||
|
, Coroutine
|
||||||
|
, Cut
|
||||||
|
, Fresh
|
||||||
|
, NonDetEff
|
||||||
|
, Teletype
|
||||||
|
, Trace
|
||||||
|
|
||||||
|
default-language: Haskell2010
|
||||||
|
|
||||||
|
build-depends: base, freer-effects
|
||||||
|
|
||||||
|
ghc-options: -Wall
|
||||||
|
|
||||||
|
if flag(pedantic)
|
||||||
|
ghc-options: -Werror
|
||||||
|
|
||||||
|
test-suite test
|
||||||
|
type: exitcode-stdio-1.0
|
||||||
|
hs-source-dirs: tests
|
||||||
|
main-is: Tests.hs
|
||||||
|
other-modules:
|
||||||
|
Tests.Common
|
||||||
|
, Tests.Coroutine
|
||||||
|
, Tests.Exception
|
||||||
|
, Tests.Fresh
|
||||||
|
, Tests.NonDetEff
|
||||||
|
, Tests.Reader
|
||||||
|
, Tests.State
|
||||||
|
, Tests.StateRW
|
||||||
|
|
||||||
|
default-language: Haskell2010
|
||||||
|
|
||||||
|
build-depends:
|
||||||
|
base
|
||||||
|
, freer-effects
|
||||||
|
, tasty
|
||||||
|
, tasty-hunit
|
||||||
|
, tasty-quickcheck
|
||||||
|
, QuickCheck
|
||||||
|
|
||||||
|
ghc-options: -Wall
|
||||||
|
|
||||||
|
if flag(pedantic)
|
||||||
|
ghc-options: -Werror
|
||||||
|
|
||||||
|
benchmark core
|
||||||
|
type: exitcode-stdio-1.0
|
||||||
|
hs-source-dirs: bench
|
||||||
|
main-is: Core.hs
|
||||||
|
|
||||||
|
default-language: Haskell2010
|
||||||
|
|
||||||
|
build-depends:
|
||||||
|
base
|
||||||
|
, criterion
|
||||||
|
, free
|
||||||
|
, freer-effects
|
||||||
|
, mtl
|
||||||
|
|
||||||
|
ghc-options: -Wall -O2
|
||||||
|
|
||||||
|
if flag(pedantic)
|
||||||
|
ghc-options: -Werror
|
105
freer.cabal
105
freer.cabal
@ -1,105 +0,0 @@
|
|||||||
name: freer
|
|
||||||
version: 0.2.4.1
|
|
||||||
synopsis: Implementation of the Freer Monad
|
|
||||||
license: BSD3
|
|
||||||
license-file: LICENSE
|
|
||||||
author: TBA
|
|
||||||
maintainer: TBA
|
|
||||||
copyright: Allele Dev 2016
|
|
||||||
homepage: https://github.com/IxpertaSolutions/freer
|
|
||||||
bug-reports: https://github.com/IxpertaSolutions/freer/issues
|
|
||||||
category: Control
|
|
||||||
build-type: Simple
|
|
||||||
cabal-version: >=1.10
|
|
||||||
tested-with: GHC==7.10.3, GHC==8.0.1, GHC==7.8.4
|
|
||||||
description:
|
|
||||||
|
|
||||||
Freer is an implementation of "Freer Monads, More Extensible
|
|
||||||
Effects"
|
|
||||||
.
|
|
||||||
The key features of Freer are:
|
|
||||||
.
|
|
||||||
* An efficient effect system for Haskell - as a library!
|
|
||||||
.
|
|
||||||
* Implementations for several common Haskell monad instances:
|
|
||||||
.
|
|
||||||
* Core components for defining your own Effects
|
|
||||||
|
|
||||||
extra-source-files:
|
|
||||||
README.md
|
|
||||||
changelog.md
|
|
||||||
|
|
||||||
source-repository head
|
|
||||||
type: git
|
|
||||||
location: git clone https://github.com/IxpertaSolutions/freer.git
|
|
||||||
|
|
||||||
library
|
|
||||||
exposed-modules: Control.Monad.Freer
|
|
||||||
, Control.Monad.Freer.Coroutine
|
|
||||||
, Control.Monad.Freer.Cut
|
|
||||||
, Control.Monad.Freer.Exception
|
|
||||||
, Control.Monad.Freer.Fresh
|
|
||||||
, Control.Monad.Freer.Internal
|
|
||||||
, Control.Monad.Freer.Reader
|
|
||||||
, Control.Monad.Freer.State
|
|
||||||
, Control.Monad.Freer.StateRW
|
|
||||||
, Control.Monad.Freer.Trace
|
|
||||||
, Control.Monad.Freer.Writer
|
|
||||||
, Data.FTCQueue
|
|
||||||
, Data.Open.Union
|
|
||||||
, Data.Open.Union.Internal
|
|
||||||
|
|
||||||
build-depends: base >=4.7 && <5
|
|
||||||
hs-source-dirs: src
|
|
||||||
ghc-options: -Wall
|
|
||||||
default-language: Haskell2010
|
|
||||||
|
|
||||||
executable freer-examples
|
|
||||||
main-is: Main.hs
|
|
||||||
other-modules: Common
|
|
||||||
, Coroutine
|
|
||||||
, Cut
|
|
||||||
, Fresh
|
|
||||||
, NonDetEff
|
|
||||||
, Teletype
|
|
||||||
, Trace
|
|
||||||
build-depends: base
|
|
||||||
, freer
|
|
||||||
hs-source-dirs: examples/src
|
|
||||||
ghc-options: -Wall
|
|
||||||
default-language: Haskell2010
|
|
||||||
|
|
||||||
test-suite test
|
|
||||||
default-language: Haskell2010
|
|
||||||
type: exitcode-stdio-1.0
|
|
||||||
hs-source-dirs: tests
|
|
||||||
main-is: Tests.hs
|
|
||||||
other-modules: Tests.Common
|
|
||||||
, Tests.Coroutine
|
|
||||||
, Tests.Exception
|
|
||||||
, Tests.Fresh
|
|
||||||
, Tests.NonDetEff
|
|
||||||
, Tests.Reader
|
|
||||||
, Tests.State
|
|
||||||
, Tests.StateRW
|
|
||||||
build-depends: base
|
|
||||||
, freer
|
|
||||||
, tasty
|
|
||||||
, tasty-hunit
|
|
||||||
, tasty-quickcheck
|
|
||||||
, QuickCheck
|
|
||||||
|
|
||||||
ghc-options: -Wall
|
|
||||||
|
|
||||||
benchmark core
|
|
||||||
default-language: Haskell2010
|
|
||||||
type: exitcode-stdio-1.0
|
|
||||||
hs-source-dirs: bench
|
|
||||||
main-is: Core.hs
|
|
||||||
build-depends: base
|
|
||||||
, freer
|
|
||||||
, criterion
|
|
||||||
, mtl
|
|
||||||
, free
|
|
||||||
|
|
||||||
ghc-options: -Wall -O2
|
|
@ -2,16 +2,14 @@
|
|||||||
{-# LANGUAGE TypeOperators #-}
|
{-# LANGUAGE TypeOperators #-}
|
||||||
{-# LANGUAGE RankNTypes #-}
|
{-# LANGUAGE RankNTypes #-}
|
||||||
{-# LANGUAGE CPP #-}
|
{-# LANGUAGE CPP #-}
|
||||||
{-|
|
-- |
|
||||||
Module : Control.Monad.Freer
|
-- Module: Control.Monad.Freer
|
||||||
Description : Freer - an extensible effects library
|
-- Description: Freer - an extensible effects library
|
||||||
Copyright : Allele Dev 2016
|
-- Copyright: (c) 2016 Allele Dev; 2017 Ixperta Solutions s.r.o.
|
||||||
License : BSD-3
|
-- License: BSD3
|
||||||
Maintainer : allele.dev@gmail.com
|
-- Maintainer: ixcom-core@ixperta.com
|
||||||
Stability : experimental
|
-- Stability: experimental
|
||||||
Portability : POSIX
|
-- Portability: POSIX
|
||||||
|
|
||||||
-}
|
|
||||||
module Control.Monad.Freer (
|
module Control.Monad.Freer (
|
||||||
Member,
|
Member,
|
||||||
Members,
|
Members,
|
||||||
|
@ -2,22 +2,18 @@
|
|||||||
{-# LANGUAGE FlexibleContexts #-}
|
{-# LANGUAGE FlexibleContexts #-}
|
||||||
{-# LANGUAGE TypeOperators #-}
|
{-# LANGUAGE TypeOperators #-}
|
||||||
{-# LANGUAGE DataKinds #-}
|
{-# LANGUAGE DataKinds #-}
|
||||||
|
-- |
|
||||||
{-|
|
-- Module: Control.Monad.Freer.Coroutine
|
||||||
Module : Control.Monad.Freer.Coroutine
|
-- Description: Composable coroutine effects layer.
|
||||||
Description : Composable coroutine effects layer.
|
-- Copyright: (c) 2016 Allele Dev; 2017 Ixperta Solutions s.r.o.
|
||||||
Copyright : Allele Dev 2016
|
-- License: BSD3
|
||||||
License : BSD-3
|
-- Maintainer: ixcom-core@ixperta.com
|
||||||
Maintainer : allele.dev@gmail.com
|
-- Stability: broken
|
||||||
Stability : broken
|
-- Portability: POSIX
|
||||||
Portability : POSIX
|
--
|
||||||
|
-- An effect to compose functions with the ability to yield.
|
||||||
An effect to compose functions with the ability to yield.
|
--
|
||||||
|
-- Using <http://okmij.org/ftp/Haskell/extensible/Eff1.hs> as a starting point.
|
||||||
Using <http://okmij.org/ftp/Haskell/extensible/Eff1.hs> as a
|
|
||||||
starting point.
|
|
||||||
|
|
||||||
-}
|
|
||||||
module Control.Monad.Freer.Coroutine (
|
module Control.Monad.Freer.Coroutine (
|
||||||
Yield(..),
|
Yield(..),
|
||||||
yield,
|
yield,
|
||||||
|
@ -1,23 +1,19 @@
|
|||||||
{-# LANGUAGE FlexibleContexts #-}
|
{-# LANGUAGE FlexibleContexts #-}
|
||||||
{-# LANGUAGE TypeOperators #-}
|
{-# LANGUAGE TypeOperators #-}
|
||||||
{-# LANGUAGE DataKinds #-}
|
{-# LANGUAGE DataKinds #-}
|
||||||
|
-- |
|
||||||
{-|
|
-- Module: Control.Monad.Freer.Cut
|
||||||
Module : Control.Monad.Freer.Cut
|
-- Description: An implementation of logical Cut.
|
||||||
Description : An implementation of logical Cut
|
-- Copyright: (c) 2016 Allele Dev; 2017 Ixperta Solutions s.r.o.
|
||||||
Copyright : Allele Dev 2016
|
-- License: BSD3
|
||||||
License : BSD-3
|
-- Maintainer: ixcom-core@ixperta.com
|
||||||
Maintainer : allele.dev@gmail.com
|
-- Stability: broken
|
||||||
Stability : broken
|
-- Portability: POSIX
|
||||||
Portability : POSIX
|
--
|
||||||
|
-- Composable handler for logical Cut effects. Implemented in terms of 'Exc'
|
||||||
Composable handler for logical Cut effects. Implemented in terms of
|
-- effect.
|
||||||
Exc effect.
|
--
|
||||||
|
-- Using <http://okmij.org/ftp/Haskell/extensible/Eff1.hs> as a starting point.
|
||||||
Using <http://okmij.org/ftp/Haskell/extensible/Eff1.hs> as a
|
|
||||||
starting point.
|
|
||||||
|
|
||||||
-}
|
|
||||||
module Control.Monad.Freer.Cut (
|
module Control.Monad.Freer.Cut (
|
||||||
CutFalse(..),
|
CutFalse(..),
|
||||||
cutFalse,
|
cutFalse,
|
||||||
|
@ -1,23 +1,19 @@
|
|||||||
{-# LANGUAGE TypeOperators #-}
|
{-# LANGUAGE TypeOperators #-}
|
||||||
{-# LANGUAGE DataKinds #-}
|
{-# LANGUAGE DataKinds #-}
|
||||||
{-# LANGUAGE FlexibleContexts #-}
|
{-# LANGUAGE FlexibleContexts #-}
|
||||||
|
-- |
|
||||||
{-|
|
-- Module: Control.Monad.Freer.Exception
|
||||||
Module : Control.Monad.Freer.Exception
|
-- Description: An Exception effect and handler.
|
||||||
Description : An Exception effect and handler.
|
-- Copyright: (c) 2016 Allele Dev; 2017 Ixperta Solutions s.r.o.
|
||||||
Copyright : Allele Dev 2016
|
-- License: BSD3
|
||||||
License : BSD-3
|
-- Maintainer: ixcom-core@ixperta.com
|
||||||
Maintainer : allele.dev@gmail.com
|
-- Stability: experimental
|
||||||
Stability : experimental
|
-- Portability: POSIX
|
||||||
Portability : POSIX
|
--
|
||||||
|
-- Composable handler for Exception effects. Communicates success\/failure
|
||||||
Composable handler for Exception effects. Communicates success/failure
|
-- via an 'Either' type.
|
||||||
via an Either type.
|
--
|
||||||
|
-- Using <http://okmij.org/ftp/Haskell/extensible/Eff1.hs> as a starting point.
|
||||||
Using <http://okmij.org/ftp/Haskell/extensible/Eff1.hs> as a
|
|
||||||
starting point.
|
|
||||||
|
|
||||||
-}
|
|
||||||
module Control.Monad.Freer.Exception (
|
module Control.Monad.Freer.Exception (
|
||||||
Exc(..),
|
Exc(..),
|
||||||
throwError,
|
throwError,
|
||||||
|
@ -2,23 +2,19 @@
|
|||||||
{-# LANGUAGE DataKinds #-}
|
{-# LANGUAGE DataKinds #-}
|
||||||
{-# LANGUAGE FlexibleContexts #-}
|
{-# LANGUAGE FlexibleContexts #-}
|
||||||
{-# LANGUAGE GADTs #-}
|
{-# LANGUAGE GADTs #-}
|
||||||
|
-- |
|
||||||
{-|
|
-- Module: Control.Monad.Freer.Fresh
|
||||||
Module : Control.Monad.Freer.Fresh
|
-- Description: Generation of fresh integers as an effect.
|
||||||
Description : Generation of fresh integers as an effect.
|
-- Copyright: (c) 2016 Allele Dev; 2017 Ixperta Solutions s.r.o.
|
||||||
Copyright : Allele Dev 2016
|
-- License: BSD3
|
||||||
License : BSD-3
|
-- Maintainer: ixcom-core@ixperta.com
|
||||||
Maintainer : allele.dev@gmail.com
|
-- Stability: broken
|
||||||
Stability : broken
|
-- Portability: POSIX
|
||||||
Portability : POSIX
|
--
|
||||||
|
-- Composable handler for 'Fresh' effects. This is likely to be of use when
|
||||||
Composable handler for Fresh effects. This is likely to be of use when
|
-- implementing De Bruijn naming/scopes.
|
||||||
implementing De Bruijn naming/scopes.
|
--
|
||||||
|
-- Using <http://okmij.org/ftp/Haskell/extensible/Eff1.hs> as a starting point.
|
||||||
Using <http://okmij.org/ftp/Haskell/extensible/Eff1.hs> as a
|
|
||||||
starting point.
|
|
||||||
|
|
||||||
-}
|
|
||||||
module Control.Monad.Freer.Fresh (
|
module Control.Monad.Freer.Fresh (
|
||||||
Fresh(..),
|
Fresh(..),
|
||||||
fresh,
|
fresh,
|
||||||
|
@ -11,25 +11,22 @@
|
|||||||
-- TODO: remove once GHC can deduce the decidability of this instance
|
-- TODO: remove once GHC can deduce the decidability of this instance
|
||||||
{-# LANGUAGE UndecidableInstances #-}
|
{-# LANGUAGE UndecidableInstances #-}
|
||||||
|
|
||||||
{-|
|
-- |
|
||||||
Module : Control.Monad.Freer.Internal
|
-- Module: Control.Monad.Freer.Internal
|
||||||
Description : Mechanisms to make effects work
|
-- Description: Mechanisms to make effects work.
|
||||||
Copyright : Allele Dev 2016
|
-- Copyright: (c) 2016 Allele Dev; 2017 Ixperta Solutions s.r.o.
|
||||||
License : BSD-3
|
-- License: BSD3
|
||||||
Maintainer : allele.dev@gmail.com
|
-- Maintainer: ixcom-core@ixperta.com
|
||||||
Stability : experimental
|
-- Stability: experimental
|
||||||
Portability : POSIX
|
-- Portability: POSIX
|
||||||
|
--
|
||||||
Internal machinery for this effects library. This includes:
|
-- Internal machinery for this effects library. This includes:
|
||||||
|
--
|
||||||
* Eff data type, for expressing effects
|
-- * 'Eff' data type, for expressing effects.
|
||||||
* NonDetEff data type, for nondeterministic effects
|
-- * 'NonDetEff' data type, for nondeterministic effects.
|
||||||
* Functions for facilitating the construction of effects and their handlers
|
-- * Functions for facilitating the construction of effects and their handlers.
|
||||||
|
--
|
||||||
Using <http://okmij.org/ftp/Haskell/extensible/Eff1.hs> as a
|
-- Using <http://okmij.org/ftp/Haskell/extensible/Eff1.hs> as a starting point.
|
||||||
starting point.
|
|
||||||
|
|
||||||
-}
|
|
||||||
module Control.Monad.Freer.Internal (
|
module Control.Monad.Freer.Internal (
|
||||||
Eff(..),
|
Eff(..),
|
||||||
Member(..),
|
Member(..),
|
||||||
|
@ -3,23 +3,19 @@
|
|||||||
{-# LANGUAGE FlexibleContexts #-}
|
{-# LANGUAGE FlexibleContexts #-}
|
||||||
{-# LANGUAGE DataKinds #-}
|
{-# LANGUAGE DataKinds #-}
|
||||||
{-# LANGUAGE ScopedTypeVariables #-}
|
{-# LANGUAGE ScopedTypeVariables #-}
|
||||||
|
-- |
|
||||||
{-|
|
-- Module: Control.Monad.Freer.Reader
|
||||||
Module : Control.Monad.Freer.Reader
|
-- Description: Reader effects, for encapsulating an environment.
|
||||||
Description : Reader effects, for encapsulating an environment
|
-- Copyright: (c) 2016 Allele Dev; 2017 Ixperta Solutions s.r.o.
|
||||||
Copyright : Allele Dev 2016
|
-- License: BSD3
|
||||||
License : BSD-3
|
-- Maintainer: ixcom-core@ixperta.com
|
||||||
Maintainer : allele.dev@gmail.com
|
-- Stability: experimental
|
||||||
Stability : experimental
|
-- Portability: POSIX
|
||||||
Portability : POSIX
|
--
|
||||||
|
-- Composable handler for 'Reader' effects. Handy for encapsulating an
|
||||||
Composable handler for Reader effects. Handy for encapsulating an
|
-- environment with immutable state for interpreters.
|
||||||
environment with immutable state for interpreters.
|
--
|
||||||
|
-- Using <http://okmij.org/ftp/Haskell/extensible/Eff1.hs> as a starting point.
|
||||||
Using <http://okmij.org/ftp/Haskell/extensible/Eff1.hs> as a
|
|
||||||
starting point.
|
|
||||||
|
|
||||||
-}
|
|
||||||
module Control.Monad.Freer.Reader (
|
module Control.Monad.Freer.Reader (
|
||||||
Reader(..),
|
Reader(..),
|
||||||
|
|
||||||
|
@ -4,22 +4,18 @@
|
|||||||
{-# LANGUAGE NoImplicitPrelude #-}
|
{-# LANGUAGE NoImplicitPrelude #-}
|
||||||
{-# LANGUAGE ScopedTypeVariables #-}
|
{-# LANGUAGE ScopedTypeVariables #-}
|
||||||
{-# LANGUAGE TypeOperators #-}
|
{-# LANGUAGE TypeOperators #-}
|
||||||
|
-- |
|
||||||
{-|
|
-- Module: Control.Monad.Freer.State
|
||||||
Module : Control.Monad.Freer.State
|
-- Description: State effects, for state-carrying computations.
|
||||||
Description : State effects, for state-carrying computations.
|
-- Copyright: (c) 2016 Allele Dev; 2017 Ixperta Solutions s.r.o.
|
||||||
Copyright : Allele Dev 2016
|
-- License: BSD3
|
||||||
License : BSD-3
|
-- Maintainer: ixcom-core@ixperta.com
|
||||||
Maintainer : allele.dev@gmail.com
|
-- Stability: experimental
|
||||||
Stability : experimental
|
-- Portability: POSIX
|
||||||
Portability : POSIX
|
--
|
||||||
|
-- Composable handler for 'State' effects.
|
||||||
Composable handler for State effects.
|
--
|
||||||
|
-- Using <http://okmij.org/ftp/Haskell/extensible/Eff1.hs> as a starting point.
|
||||||
Using <http://okmij.org/ftp/Haskell/extensible/Eff1.hs> as a
|
|
||||||
starting point.
|
|
||||||
|
|
||||||
-}
|
|
||||||
module Control.Monad.Freer.State (
|
module Control.Monad.Freer.State (
|
||||||
State(..),
|
State(..),
|
||||||
get,
|
get,
|
||||||
|
@ -2,24 +2,20 @@
|
|||||||
{-# LANGUAGE DataKinds #-}
|
{-# LANGUAGE DataKinds #-}
|
||||||
{-# LANGUAGE FlexibleContexts #-}
|
{-# LANGUAGE FlexibleContexts #-}
|
||||||
{-# LANGUAGE GADTs #-}
|
{-# LANGUAGE GADTs #-}
|
||||||
|
-- |
|
||||||
{-|
|
-- Module: Control.Monad.Freer.StateRW
|
||||||
Module : Control.Monad.Freer.StateRW
|
-- Description: State effects in terms of Reader and Writer.
|
||||||
Description : State effects in terms of Reader/Writer
|
-- Copyright: (c) 2016 Allele Dev; 2017 Ixperta Solutions s.r.o.
|
||||||
Copyright : Allele Dev 2016
|
-- License: BSD3
|
||||||
License : BSD-3
|
-- Maintainer: ixcom-core@ixperta.com
|
||||||
Maintainer : allele.dev@gmail.com
|
-- Stability: experimental
|
||||||
Stability : experimental
|
-- Portability: POSIX
|
||||||
Portability : POSIX
|
--
|
||||||
|
-- Composable handler for 'State' effects in terms of 'Reader' and 'Writer'
|
||||||
Composable handler for State effects in terms of Reader/Writer
|
-- effects. This module is more a tutorial on how to compose handlers. It is
|
||||||
effects. This module is more a tutorial on how to compose handlers. It
|
-- slightly slower than a dedicated 'State' handler.
|
||||||
is slightly slower than a dedicated State handler.
|
--
|
||||||
|
-- Using <http://okmij.org/ftp/Haskell/extensible/Eff1.hs> as a starting point.
|
||||||
Using <http://okmij.org/ftp/Haskell/extensible/Eff1.hs> as a
|
|
||||||
starting point.
|
|
||||||
|
|
||||||
-}
|
|
||||||
module Control.Monad.Freer.StateRW (
|
module Control.Monad.Freer.StateRW (
|
||||||
runStateR,
|
runStateR,
|
||||||
Reader,
|
Reader,
|
||||||
|
@ -2,23 +2,19 @@
|
|||||||
{-# LANGUAGE DataKinds #-}
|
{-# LANGUAGE DataKinds #-}
|
||||||
{-# LANGUAGE FlexibleContexts #-}
|
{-# LANGUAGE FlexibleContexts #-}
|
||||||
{-# LANGUAGE GADTs #-}
|
{-# LANGUAGE GADTs #-}
|
||||||
|
-- |
|
||||||
{-|
|
-- Module: Control.Monad.Freer.Trace
|
||||||
Module : Control.Monad.Freer.Trace
|
-- Description: Composable Trace effects.
|
||||||
Description : Composable Trace effects
|
-- Copyright: (c) 2016 Allele Dev; 2017 Ixperta Solutions s.r.o.
|
||||||
Copyright : Allele Dev 2016
|
-- License: BSD3
|
||||||
License : BSD-3
|
-- Maintainer: ixcom-core@ixperta.com
|
||||||
Maintainer : allele.dev@gmail.com
|
-- Stability: experimental
|
||||||
Stability : experimental
|
-- Portability: POSIX
|
||||||
Portability : POSIX
|
--
|
||||||
|
-- Composable handler for 'Trace' effects. Trace allows one to debug the
|
||||||
Composable handler for Trace effects. Trace allows one to debug the
|
-- operation of sequences of effects by outputing to the console.
|
||||||
operation of sequences of effects by outputing to the console.
|
--
|
||||||
|
-- Using <http://okmij.org/ftp/Haskell/extensible/Eff1.hs> as a starting point.
|
||||||
Using <http://okmij.org/ftp/Haskell/extensible/Eff1.hs> as a
|
|
||||||
starting point.
|
|
||||||
|
|
||||||
-}
|
|
||||||
module Control.Monad.Freer.Trace (
|
module Control.Monad.Freer.Trace (
|
||||||
Trace(..),
|
Trace(..),
|
||||||
trace,
|
trace,
|
||||||
|
@ -3,21 +3,18 @@
|
|||||||
{-# LANGUAGE FlexibleContexts #-}
|
{-# LANGUAGE FlexibleContexts #-}
|
||||||
{-# LANGUAGE DataKinds #-}
|
{-# LANGUAGE DataKinds #-}
|
||||||
{-# LANGUAGE CPP #-}
|
{-# LANGUAGE CPP #-}
|
||||||
{-|
|
-- |
|
||||||
Module : Control.Monad.Freer.Writer
|
-- Module: Control.Monad.Freer.Writer
|
||||||
Description : Composable Writer effects -
|
-- Description: Composable Writer effects.
|
||||||
Copyright : Allele Dev 2016
|
-- Copyright: (c) 2016 Allele Dev; 2017 Ixperta Solutions s.r.o.
|
||||||
License : BSD-3
|
-- License: BSD3
|
||||||
Maintainer : allele.dev@gmail.com
|
-- Maintainer: ixcom-core@ixperta.com
|
||||||
Stability : experimental
|
-- Stability: experimental
|
||||||
Portability : POSIX
|
-- Portability: POSIX
|
||||||
|
--
|
||||||
Writer effects, for writing changes to an attached environment.
|
-- 'Writer' effects, for writing changes to an attached environment.
|
||||||
|
--
|
||||||
Using <http://okmij.org/ftp/Haskell/extensible/Eff1.hs> as a
|
-- Using <http://okmij.org/ftp/Haskell/extensible/Eff1.hs> as a starting point.
|
||||||
starting point.
|
|
||||||
|
|
||||||
-}
|
|
||||||
module Control.Monad.Freer.Writer (
|
module Control.Monad.Freer.Writer (
|
||||||
Writer(..),
|
Writer(..),
|
||||||
tell,
|
tell,
|
||||||
|
Loading…
Reference in New Issue
Block a user