control-dsl 0.2.0.0 → 0.2.0.1
raw patch · 5 files changed
+73/−69 lines, 5 filesdep ~containersdep ~doctestdep ~doctest-discoverPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: containers, doctest, doctest-discover, temporary
API changes (from Hackage documentation)
Files
- README.md +0/−3
- control-dsl.cabal +61/−57
- src/Control/Dsl.hs +2/−2
- src/Control/Dsl/Cont.hs +4/−4
- src/Control/Dsl/Dsl.hs +6/−3
− README.md
@@ -1,3 +0,0 @@-# `Control.Dsl`: An alternative to monads--See [`Control.Dsl` on Hackage](https://hackage.haskell.org/package/control-dsl/docs/Control-Dsl.html) for more information.
control-dsl.cabal view
@@ -1,65 +1,69 @@-cabal-version: >=1.10-name: control-dsl-version: 0.2.0.0-license: BSD3-license-file: LICENSE-copyright: 2018 Yang Bo-maintainer: pop.atry@gmail.com-author: Yang Bo-homepage: https://github.com/Atry/Control.Dsl#readme-bug-reports: https://github.com/Atry/Control.Dsl/issues-synopsis: An alternative to monads-description:- This \"control-dsl\" package is a toolkit to create extensible Domain Specific Languages in @do@-notation.- .- See "Control.Dsl" for more information.-category: Control, DSL, Effect, General, Language, Mutable State, IO, Polymorphism-build-type: Simple+-- This file has been generated from package.yaml by hpack version 0.28.2.+--+-- see: https://github.com/sol/hpack+--+-- hash: fc82e777d97572d734e72a654633c712086ba0638376cc070e09e2e22c4831aa++name: control-dsl+version: 0.2.0.1+synopsis: An alternative to monads+description: This \"control-dsl\" package is a toolkit to create extensible Domain Specific Languages in @do@-notation.+ .+ See "Control.Dsl" for more information.+category: Control, DSL, Effect, General, Language, Mutable State, IO, Polymorphism+homepage: https://github.com/Atry/Control.Dsl#readme+bug-reports: https://github.com/Atry/Control.Dsl/issues+author: Yang Bo+maintainer: pop.atry@gmail.com+copyright: 2018 Yang Bo+license: BSD3+license-file: LICENSE+build-type: Simple+cabal-version: >= 1.10 extra-source-files: ChangeLog.md- README.md source-repository head- type: git- location: https://github.com/Atry/Control.Dsl+ type: git+ location: https://github.com/Atry/Control.Dsl library- exposed-modules:- Control.Dsl- Control.Dsl.Cont- Control.Dsl.Empty- Control.Dsl.Monadic- Control.Dsl.PolyCont- Control.Dsl.Return- Control.Dsl.Shift- Control.Dsl.State- Control.Dsl.State.Get- Control.Dsl.State.Put- Control.Dsl.Yield- hs-source-dirs: src- other-modules:- Control.Dsl.Dsl- Control.Dsl.State.State- default-language: Haskell2010- other-extensions: RebindableSyntax MultiParamTypeClasses- TypeOperators FlexibleInstances FlexibleContexts- UndecidableInstances RankNTypes GADTs- build-depends:- base >=4.8 && <5+ exposed-modules:+ Control.Dsl+ Control.Dsl.Cont+ Control.Dsl.Empty+ Control.Dsl.Monadic+ Control.Dsl.PolyCont+ Control.Dsl.Return+ Control.Dsl.Shift+ Control.Dsl.State+ Control.Dsl.State.Get+ Control.Dsl.State.Put+ Control.Dsl.Yield+ other-modules:+ Control.Dsl.Dsl+ Control.Dsl.State.State+ hs-source-dirs:+ src+ other-extensions: RebindableSyntax MultiParamTypeClasses TypeOperators FlexibleInstances FlexibleContexts UndecidableInstances RankNTypes GADTs+ build-depends:+ base >=4.8 && <5+ default-language: Haskell2010 test-suite doctests- type: exitcode-stdio-1.0- main-is: doctest-driver.hs- hs-source-dirs: test- other-modules:- Paths_control_dsl- default-language: Haskell2010- other-extensions: TypeApplications- ghc-options: -threaded -rtsopts -with-rtsopts=-N- build-depends:- base >=4.8 && <5,- containers >=0.5.11.0 && <0.6,- control-dsl -any,- doctest >=0.16.0.1 && <0.17,- doctest-discover >=0.1.0.9 && <0.2,- temporary ==1.3.*+ type: exitcode-stdio-1.0+ main-is: doctest-driver.hs+ other-modules:+ Paths_control_dsl+ hs-source-dirs:+ test+ other-extensions: TypeApplications+ ghc-options: -threaded -rtsopts -with-rtsopts=-N+ build-depends:+ base >=4.8 && <5+ , containers+ , control-dsl+ , doctest+ , doctest-discover+ , temporary+ default-language: Haskell2010
src/Control/Dsl.hs view
@@ -8,7 +8,7 @@ A DSL @do@ block contains heterogeneous statements from different vendors. A statement can be defined as a GADT,-interpreted by a 'Dsl' type class instance, either effectful or purely.+interpreted by a 'Dsl' type class instance, either effectfully or purely. A DSL @do@ block is abstract. When creating the block, the type class requirements is automatically inferred.@@ -70,7 +70,7 @@ === Creating a pure interpreter -The type of @r@ varies from different 'Contro.Dsl.PolyCont.PolyCont' instances.+The type @r@ varies from different 'Contro.Dsl.PolyCont.PolyCont' instances. By defining 'Contro.Dsl.PolyCont.PolyCont' instances for @PureInterpreter@, you can make @r@ be a @PureInterpreter@:
src/Control/Dsl/Cont.hs view
@@ -41,11 +41,11 @@ when True k = k when False _ = Cont ($ ()) -unless True _ = Cont $ \f -> f ()-unless False (Cont k) = Cont k+unless True _ = Cont ($ ())+unless False k = k -guard True = Cont $ \f -> f ()-guard False = Cont $ \f -> empty+guard True = Cont ($ ())+guard False = Cont (const empty) instance {-# OVERLAPS #-} PolyCont k r a => PolyCont k (Cont r a') a where runPolyCont k f = Cont $ \g -> runPolyCont k $ \a -> runCont (f a) g
src/Control/Dsl/Dsl.hs view
@@ -14,9 +14,12 @@ == Allowed statements in DSL @do@ blocks -A statement in a DSL @do@ block is a delimited continuation,-which can be a GADT keyword, a control flow operator,-or the final result:+Statements in a DSL @do@ block is a delimited continuation+(except the last statement),+which can be a GADT keyword, a control flow operator.++The last statement is the final result of the @do@ block,+or the /answer type/ of other delimited continuation statements. +-------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------------+----------------------------------------------------------------------------------------------+ | | Keywords | Control flow operators | Results |