control-dsl 0.2.1.0 → 0.2.1.1
raw patch · 3 files changed
+14/−13 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- control-dsl.cabal +2/−2
- src/Control/Dsl.hs +9/−9
- src/Control/Dsl/Return.hs +3/−2
control-dsl.cabal view
@@ -2,10 +2,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: f05825e0fb61758589eb055402af39aa7e945df86d2b987417ec5f74ecd2f3ab+-- hash: 17ddc07e76440e405a2ac39604537ed62560c5bb90aa95d930e09770037ad0ad name: control-dsl-version: 0.2.1.0+version: 0.2.1.1 synopsis: An alternative to monads description: This \"control-dsl\" package is a toolkit to create extensible Domain Specific Languages in @do@-notation. .
src/Control/Dsl.hs view
@@ -58,7 +58,7 @@ Keywords and the result statement 'return' and 'fail' are ad-hoc polymorphic delimited continuations,-interpreted by 'Contro.Dsl.PolyCont.PolyCont',+interpreted by 'Control.Dsl.PolyCont.PolyCont', which can be automatically inferred: >>> :type dslBlock@@ -70,8 +70,8 @@ === Creating a pure interpreter -The type @r@ varies from different 'Contro.Dsl.PolyCont.PolyCont' instances.-By defining 'Contro.Dsl.PolyCont.PolyCont' instances for @PureInterpreter@,+The type @r@ varies from different 'Control.Dsl.PolyCont.PolyCont' instances.+By defining 'Control.Dsl.PolyCont.PolyCont' instances for @PureInterpreter@, you can make @r@ be a @PureInterpreter@: >>> type PureInterpreter = Int -> [String] -> Cont [String] IOError@@ -91,7 +91,7 @@ runPolyCont (Return ()) = runPolyCont Empty :} -The above three 'Contro.Dsl.PolyCont.PolyCont' instances are implemented as+The above three 'Control.Dsl.PolyCont.PolyCont' instances are implemented as forwarders to other existing keywords. >>> :{@@ -103,8 +103,8 @@ :} ... -The 'Contro.Dsl.PolyCont.PolyCont' instance for @GetLine@ is implemented as a-'Contro.Dsl.Cont' that contains a DSL @do@ block of atomic statements.+The 'Control.Dsl.PolyCont.PolyCont' instance for @GetLine@ is implemented as a+'Control.Dsl.Cont.Cont' that contains a DSL @do@ block of atomic statements. === Running the DSL purely @@ -124,7 +124,7 @@ === Creating an effectful interpreter Alternatively, @dslBlock@ can run effectfully by providing effectful-'Contro.Dsl.PolyCont.PolyCont' instances.+'Control.Dsl.PolyCont.PolyCont' instances. >>> type EffectfulInterpreter = Handle -> IO () @@ -136,10 +136,10 @@ return line :} -'Contro.Dsl.Monadic.Monadic' is a built-in keyword to perform old-fashioned+'Control.Dsl.Monadic.Monadic' is a built-in keyword to perform old-fashioned monadic action in a DSL @do@ block. -Other keywords can be used together with 'Contro.Dsl.Monadic.Monadic'.+Other keywords can be used together with 'Control.Dsl.Monadic.Monadic'. No monad transformer is required. >>> :{
src/Control/Dsl/Return.hs view
@@ -23,9 +23,10 @@ This 'return' function aims to be used as the last statement of a @do@ block. -When 'return' is present in a nested @do@ block for 'when' or 'unless',+When 'return' is present in a nested @do@ block for+'Control.Dsl.Cont.when' or 'Control.Dsl.Cont.unless', if the @r@ is not @()@,-it will create a 'Cont' that performs early return,+it will create a 'Control.Dsl.Cont.Cont' that performs early return, skipping the rest statements of the outer @do@ notation. ==== __Examples__