Coder Social home page Coder Social logo

agocorona / mflow Goto Github PK

View Code? Open in Web Editor NEW
100.0 100.0 12.0 26.2 MB

(Haskell) Web application server with stateful, type safe user interactions and widget combinators

Home Page: http://mflowdemo.herokuapp.com

License: Other

Haskell 31.00% CSS 1.28% JavaScript 12.61% HTML 55.12%

mflow's People

Contributors

agocorona avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mflow's Issues

local image files not found

Works from within a page:
img ! src (fromString //ganglia.wikimedia.org/latest/img/spinner.gif)

but
img ! src (fromString "cornell.jpg")

does not. In code below s1 is the variable

runNavigation "" . step $ do
r <- page $ h3 << "Basic example with inputs and links "
++> img ! src (fromString s1)
++> getString (Just "text input")
<* submitButton "OK"

I've been combing the docs - but there is a lot of stuff (good stuff!) there.

Still going? Documentation

Is this project still under active development? The documentation could deal with a lot of love for new people.

does not install via cabal

cabal install mflow

results in

MFlow-0.2.0.4 depends on Workflow-0.8.0.0 which failed to install.
Workflow-0.8.0.0 failed during the building phase. The exception was:
ExitFailure 1

workflow 0.8.0.1 is installable, however mflow requires 0.8.0.0

issue with getRestParam after state recovery

when the server process times out after using getRestParam (for example in a page of the wiki in the examples) , when the page is called again, getRestParam read the previous segment of the REST path. As a result the wiki pages that have URL: "/noscript/wiki/thepage" present ever the "wiki" page instead of "thepage".

could not execute: MonadLoc

hello,
I get the following message when trying to run the demos-blaze in cabal sandbox.

$ cabal run
Preprocessing library MFlow-0.4.5.4...
In-place registering MFlow-0.4.5.4...
Preprocessing executable 'demos-blaze' for MFlow-0.4.5.4...
ghc: could not execute: MonadLoc

Building with ghc 7.8.2

Building with ghc 7.8.2 doesn't work because custom instances of Typeable aren't allowed, and they are being used in src/MFlow/Forms/Widgets.hs.

After some digging, I found this commit:
b22651c
which fixes the problem, however the changes made by this commit seem to have been overwritten?

links after pageFlow with forms dont work

after a pageFlow sentence that has form elements, if there is a link, it does not match the proper segment of the REST path It gets the previous one. The result is that a single segment it can match two pages in the flow with a pageFlow in the middle.

Build failure with newest tcache

src/MFlow/Forms/Widgets.hs:479:7:
Ambiguous occurrence Key' It could refer to eitherMFlow.Forms.Widgets.Key',
defined at src/MFlow/Forms/Widgets.hs:426:6
or Data.TCache.Defs.Key', imported fromData.TCache.Defs' at src/MFlow/Forms/Widgets.hs:53:1-23

src/MFlow/Forms/Widgets.hs:487:12:
Ambiguous occurrence Key' It could refer to eitherMFlow.Forms.Widgets.Key',
defined at src/MFlow/Forms/Widgets.hs:426:6
or Data.TCache.Defs.Key', imported fromData.TCache.Defs' at src/MFlow/Forms/Widgets.hs:53:1-23

src/MFlow/Forms/Widgets.hs:488:13:
Ambiguous occurrence Key' It could refer to eitherMFlow.Forms.Widgets.Key',
defined at src/MFlow/Forms/Widgets.hs:426:6
or Data.TCache.Defs.Key', imported fromData.TCache.Defs' at src/MFlow/Forms/Widgets.hs:53:1-23

src/MFlow/Forms/Widgets.hs:489:13:
Ambiguous occurrence Key' It could refer to eitherMFlow.Forms.Widgets.Key',
defined at src/MFlow/Forms/Widgets.hs:426:6
or Data.TCache.Defs.Key', imported fromData.TCache.Defs' at src/MFlow/Forms/Widgets.hs:53:1-23

src/MFlow/Forms/Widgets.hs:519:11:
Ambiguous occurrence Key' It could refer to eitherMFlow.Forms.Widgets.Key',
defined at src/MFlow/Forms/Widgets.hs:426:6
or Data.TCache.Defs.Key', imported fromData.TCache.Defs' at src/MFlow/Forms/Widgets.hs:53:1-23

Dependencies:

Dependency RefSerialize ==0.3.1.0: using RefSerialize-0.3.1.0
Dependency TCache ==0.10.2.4: using TCache-0.10.2.4
Dependency Workflow ==0.8.0.8: using Workflow-0.8.0.8
Dependency base ==4.5.1.0: using base-4.5.1.0
Dependency blaze-html ==0.6.1.1: using blaze-html-0.6.1.1
Dependency blaze-markup ==0.5.1.5: using blaze-markup-0.5.1.5
Dependency bytestring ==0.9.2.1: using bytestring-0.9.2.1
Dependency case-insensitive ==1.1.0.1: using case-insensitive-1.1.0.1
Dependency conduit ==1.0.8: using conduit-1.0.8
Dependency containers ==0.4.2.1: using containers-0.4.2.1
Dependency directory ==1.1.0.2: using directory-1.1.0.2
Dependency extensible-exceptions ==0.1.1.4: using
extensible-exceptions-0.1.1.4
Dependency hamlet ==1.1.7.3: using hamlet-1.1.7.3
Dependency http-types ==0.8.2: using http-types-0.8.2
Dependency monadloc ==0.7.1: using monadloc-0.7.1
Dependency mtl ==2.1.2: using mtl-2.1.2
Dependency old-time ==1.1.0.0: using old-time-1.1.0.0
Dependency parsec ==3.1.3: using parsec-3.1.3
Dependency random ==1.0.1.1: using random-1.0.1.1
Dependency stm ==2.4: using stm-2.4
Dependency text ==0.11.2.3: using text-0.11.2.3
Dependency transformers ==0.3.0.0: using transformers-0.3.0.0
Dependency utf8-string ==0.3.7: using utf8-string-0.3.7
Dependency vector ==0.10.0.1: using vector-0.10.0.1
Dependency wai ==1.4.0.2: using wai-1.4.0.2
Dependency warp ==1.3.10.1: using warp-1.3.10.1
Dependency xhtml ==3000.2.1: using xhtml-3000.2.1

Bug. Related to dField?

Description: dField bug? In the code below, the result of n+n' does not show up in browser.
Line: haskell dField( p << (n+n') ++> noWidget))
Version:

  • GHC 7.10.2
  • MFlow-0.4.5.11

Note this code was found in the tutorial and appears to apply to all dField examples in the tutorial. The code sample below is from the second to last tutorial in the link.

{-# LANGUAGE OverloadedStrings #-} 

import MFlow.Wai.Blaze.Html.All
import Data.Monoid

main= do
  userRegister "user" "user"

  runNavigation "" . step . page $ 
     wform wlogin **>
     ( pageFlow "s" . edTemplate "user" "template.html" .  witerate $ do
        (n,n') <- page $ (,) <$> dField(getInt Nothing) <++ br
                             <*> dField(getInt Nothing) <++ br
                             <** submitButton "send"

        dField( p << (n+n') ++> noWidget))

Cannot build from hackage

src/MFlow/Wai.hs:45:8:
    Could not find module ‘Data.Conduit.Lazy’
    It is a member of the hidden package ‘conduit-extra-1.1.0.2’.
    Perhaps you need to add ‘conduit-extra’ to the build-depends in your .cabal file.
    Use -v to see a list of the files searched for.
Failed to install MFlow-0.4.4

This appears to have been fixed in the source, please could you upload a new version to hackage?

validate

validate generate a empty widget when succeed
produce head empty list errors

Breakage with Warp 2.1.1

Component build order: library
creating dist/build
creating dist/build/autogen
Building MFlow-0.3.3...
Preprocessing library MFlow-0.3.3...
Building library...
'/opt/ghc-7.4.2/bin/ghc' '--info'
'/opt/ghc-7.4.2/bin/ghc' '--info'
creating dist/build
/opt/ghc-7.4.2/bin/ghc --make -fbuilding-cabal-package -O -outputdir dist/build -odir dist/build -hidir dist/build -stubdir dist/build -i -idist/build -isrc -i. -idist/build/autogen -Idist/build/autogen -Idist/build -optP-include -optPdist/build/autogen/cabal_macros.h -package-name MFlow-0.3.3 -hide-all-packages -no-user-package-conf -package-conf /var/lib/jenkins/workspace/Stackage with GHC 7.4.2/stackage/sandbox/package-db -package-conf dist/package.conf.inplace -package-id RefSerialize-0.3.1.0-23a78fe5db3ff6a6641604cb2779cb53 -package-id TCache-0.11.0.0-9236c2bceffa6f0605d892a22a61b1da -package-id Workflow-0.8.0.8-83df88676b1c94eb2d6afe9c9bb44745 -package-id base-4.5.1.0-66f22db3dfcd87541c9c7e50e7095d26 -package-id blaze-html-0.7.0.1-63dcd7ceb9ee85974e2593ccc90c7127 -package-id blaze-markup-0.6.0.0-d25ad8e3e3d117854ec9ec0d9b908a7c -package-id bytestring-0.9.2.1-503e91bb155301fdb1956cb5c26ce6e9 -package-id case-insensitive-1.1.0.3-ad03242e197646fef7502352fce72fb8 -package-id conduit-1.0.15.1-65d2e38ea13f1cb5cf6774233451bd9f -package-id containers-0.4.2.1-75f143aa39a3e77a1ce2300025bdd8ce -package-id directory-1.1.0.2-90bfc47dbd5ac1313aec9ce76cc22338 -package-id extensible-exceptions-0.1.1.4-3d9bd197c43329612c640f24179a7f19 -package-id hamlet-1.1.9.2-2a19d518742561b24c22d7a14915c6ba -package-id http-types-0.8.3-62528930d76e8c6f0a294e339f01ca67 -package-id monadloc-0.7.1-55acf3f7e7c6e7b44f6fc3e07cf277b2 -package-id mtl-2.1.2-02e701f9b1590ee88a0b5b0bd5d93a29 -package-id old-time-1.1.0.0-703543375fafbcbe67bc51a758e84f10 -package-id parsec-3.1.3-e1780f9779adb01e37c70bb6a49db393 -package-id random-1.0.1.1-c7787dee61cd418f6edd479355fe381c -package-id stm-2.4-464c94c0d4d2a3fb7bf1cd1f8648d14d -package-id text-0.11.3.1-41f05eb413a8fa91f09d91d3051e4ae4 -package-id transformers-0.3.0.0-8e66ecc7d4dae2b07b2b5406908c70e4 -package-id utf8-string-0.3.7-3aaf9898eec3e39af0177630d5dff0c3 -package-id vector-0.10.0.1-3450daae3d9f2092020075d05481123c -package-id wai-2.1.0-278eca80b020d4704c1d76e3f4ed8f6d -package-id warp-2.1.1-ea06bb7302c0d4c95e41271cf13839af -package-id xhtml-3000.2.1-290aa859a8b955ebda95b5ca3b1b69f3 -XHaskell98 MFlow MFlow.Wai.Blaze.Html.All MFlow.Forms MFlow.Forms.Admin MFlow.Cookies MFlow.Wai MFlow.Wai.XHtml.All MFlow.Forms.XHtml MFlow.Forms.Blaze.Html MFlow.Forms.Test MFlow.Forms.Widgets MFlow.Forms.Internals MFlow.Wai.Response
[ 1 of 13] Compiling MFlow.Cookies    ( src/MFlow/Cookies.hs, dist/build/MFlow/Cookies.o )
[ 2 of 13] Compiling MFlow            ( src/MFlow.hs, dist/build/MFlow.o )
[ 3 of 13] Compiling MFlow.Forms.Internals ( src/MFlow/Forms/Internals.hs, dist/build/MFlow/Forms/Internals.o )
[ 4 of 13] Compiling MFlow.Forms      ( src/MFlow/Forms.hs, dist/build/MFlow/Forms.o )
[ 5 of 13] Compiling MFlow.Forms.Blaze.Html ( src/MFlow/Forms/Blaze/Html.hs, dist/build/MFlow/Forms/Blaze/Html.o )
[ 6 of 13] Compiling MFlow.Forms.XHtml ( src/MFlow/Forms/XHtml.hs, dist/build/MFlow/Forms/XHtml.o )
[ 7 of 13] Compiling MFlow.Forms.Admin ( src/MFlow/Forms/Admin.hs, dist/build/MFlow/Forms/Admin.o )
[ 8 of 13] Compiling MFlow.Forms.Widgets ( src/MFlow/Forms/Widgets.hs, dist/build/MFlow/Forms/Widgets.o )
[ 9 of 13] Compiling MFlow.Wai.Response ( src/MFlow/Wai/Response.hs, dist/build/MFlow/Wai/Response.o )
[10 of 13] Compiling MFlow.Wai        ( src/MFlow/Wai.hs, dist/build/MFlow/Wai.o )
[11 of 13] Compiling MFlow.Wai.Blaze.Html.All ( src/MFlow/Wai/Blaze/Html/All.hs, dist/build/MFlow/Wai/Blaze/Html/All.o )

src/MFlow/Wai/Blaze/Html/All.hs:76:14:
    Ambiguous occurrence `getPort'
    It could refer to either `MFlow.Wai.Blaze.Html.All.getPort',
                             defined at src/MFlow/Wai/Blaze/Html/All.hs:56:1
                          or `Network.Wai.Handler.Warp.getPort',
                             imported from `Network.Wai.Handler.Warp' at src/MFlow/Wai/Blaze/Html/All.hs:39:1-31

can't install with demos-blaze

I would like to try MFlow but I am having real trouble building it with either ghc 7.6.3 or 7.8.2.

Strictly this may not be MFlow's fault but I suspect adding some (minimal) version bounds on the build-depends would probably help to make the build more robust wrt dep variations in Hackage.

Can someone who has successfully built MFlow recently maybe share the package-version set of dependencies it successfully built with?

Alternatively we could try to have a MFlow-platform.cabal file with explicit/exact versions of dependencies (like yesod-platform) to help with this dependency hell issue.

Here is what I am seeing for example when trying to cabal install current git:

cabal: Could not resolve dependencies:
trying: MFlow-0.4.4
trying: monad-logger-0.3.1.1/installed-d56...
trying: fast-logger-0.3.1/installed-19d...
trying: warp-tls-2.0.4
rejecting: warp-1.3.8.2/installed-97a... (conflict: warp-tls => warp>=2.1.4 &&
<2.2)
rejecting: warp-2.1.4.1, 2.1.4 (conflict: fast-logger =>
blaze-builder==0.3.1.1/installed-71a..., warp => blaze-builder>=0.3.3 && <0.4)
rejecting: warp-2.1.3.3, 2.1.3.2, 2.1.3.1, 2.1.3, 2.1.2.1, 2.1.2, 2.1.1.2,
2.1.1.1, 2.1.1, 2.1.0, 2.0.3.4, 2.0.3.3, 2.0.3.2, 2.0.3.1, 2.0.3, 2.0.2.1,
2.0.2, 2.0.1, 2.0.0.1, 2.0.0, 1.3.10.2, 1.3.10.1, 1.3.10, 1.3.9.2, 1.3.9.1,
1.3.9, 1.3.8.4, 1.3.8.3, 1.3.8.2, 1.3.8.1, 1.3.8, 1.3.7.5, 1.3.7.4, 1.3.7.3,
1.3.7.2, 1.3.7.1, 1.3.7, 1.3.6, 1.3.5.1, 1.3.5, 1.3.4.4, 1.3.4.3, 1.3.4.2,
1.3.4.1, 1.3.4, 1.3.3.3, 1.3.3.2, 1.3.3.1, 1.3.3, 1.3.2, 1.3.1.2, 1.3.1.1,
1.3.1, 1.3.0.1, 1.3.0, 1.2.2, 1.2.1.1, 1.2.1, 1.2.0.2, 1.2.0.1, 1.2.0,
1.1.0.1, 1.1.0, 1.0.0.1, 1.0.0, 0.4.6.3, 0.4.6.2, 0.4.6.1, 0.4.6, 0.4.5,
0.4.4, 0.4.3.1, 0.4.3, 0.4.2, 0.4.1.2, 0.4.1.1, 0.4.1, 0.4.0.1, 0.4.0, 0.3.3,
0.3.2.3, 0.3.2.2, 0.3.2.1, 0.3.2, 0.3.1, 0.3.0 (conflict: warp-tls =>
warp>=2.1.4 && <2.2)

Some issues with the tutorial example

Hi there, and congratulations for the amazing work in this framework! I was trying the example on the FP complete article, and i noticed two weird behaviours.

  • If i navigate up until the page with the header A mix of applicative and monadic operators can be used to create multiple pageflows within a page, and then i click back to the beginning, the browser back button does not work as expected. I will remain stuck in the first page, even though the location changes
  • if i copy the location (http://localhost/noscript/()/()/false/()/next/1false/1()/2()/2()/3()/3()/4()/4() on my machine) and paste it in another tab, i find myself one page behind, on checkboxes

I am using Chrome on Mac

I know that these could be issues in the example, and not in MFlow itself, but in my humble opinion that example is so relevant that it should be here in the repo somewhere as doc. This way you could improve it with time. It is really a good example, it is amazing to just write one Haskell file and get an application running, very different from the experience with other frameworks!

Cheers!

the solution to #16 provoke other navigation errors

Wiki links do not work in the demo because getRestParam return Nothing

Sometimes the menu does not go to the chosen option but to the home page.

the demo in heroku has been rolled back to the previous version due to these problems.

As a result the issue #16 appears in the demo. at mflowdemo.herokuapp.com. For example the acidState sample does not show the results after the first iteration.

use the monoid instance of the html format instead of list to concatenate widget formatting

Now the widget carries out its formatting and result in the following structure:

FormElm [format] (Maybe result)

so that when two widgets are appended, the resulting format is format1 ++ format2.

It is necessary to make use of the faster monoid of the blaze-html library so that concatenation could be faster and with less memory footprint.

To resume, to redefine the structure as:

FormElm view (Maybe result) and concatenation should be format1 <> format2

with
<>= mappend

Compilation failures with WAI 2.0

Component build order: library
creating dist/build
creating dist/build/autogen
Building MFlow-0.3.2.0...
Preprocessing library MFlow-0.3.2.0...
Building library...
'/opt/ghc-7.4.2/bin/ghc' '--info'
'/opt/ghc-7.4.2/bin/ghc' '--info'
creating dist/build
/opt/ghc-7.4.2/bin/ghc --make -fbuilding-cabal-package -O -outputdir dist/build -odir dist/build -hidir dist/build -stubdir dist/build -i -idist/build -isrc -i. -idist/build/autogen -Idist/build/autogen -Idist/build -optP-include -optPdist/build/autogen/cabal_macros.h -package-name MFlow-0.3.2.0 -hide-all-packages -no-user-package-conf -package-conf /var/lib/jenkins/workspace/Stackage with GHC 7.4.2/stackage/sandbox/package-db -package-conf dist/package.conf.inplace -package-id RefSerialize-0.3.1.0-23a78fe5db3ff6a6641604cb2779cb53 -package-id TCache-0.11.0.0-bf692a022ab31be2a433e040bebbd725 -package-id Workflow-0.8.0.8-01f2d84bf912efc573647f5ce4f3ed3a -package-id base-4.5.1.0-66f22db3dfcd87541c9c7e50e7095d26 -package-id blaze-html-0.6.1.1-4a20a7475f34545f787b4df9aa50edf4 -package-id blaze-markup-0.5.1.5-188062d725d6fbe3963c09c2fd67cb28 -package-id bytestring-0.9.2.1-503e91bb155301fdb1956cb5c26ce6e9 -package-id case-insensitive-1.1.0.1-280a387dad830482c0233521222ca5f0 -package-id conduit-1.0.9.3-05a2a8036d1b08641f8f9fa3c1a22e40 -package-id containers-0.4.2.1-75f143aa39a3e77a1ce2300025bdd8ce -package-id directory-1.1.0.2-90bfc47dbd5ac1313aec9ce76cc22338 -package-id extensible-exceptions-0.1.1.4-3d9bd197c43329612c640f24179a7f19 -package-id hamlet-1.1.7.4-4a9a326fd1950f9004859964a5c37273 -package-id http-types-0.8.2-fb6b1829dc73adc32416180e80c7047d -package-id monadloc-0.7.1-55acf3f7e7c6e7b44f6fc3e07cf277b2 -package-id mtl-2.1.2-02e701f9b1590ee88a0b5b0bd5d93a29 -package-id old-time-1.1.0.0-703543375fafbcbe67bc51a758e84f10 -package-id parsec-3.1.3-771f99c8818551756b6f2ec3e86ab039 -package-id random-1.0.1.1-c7787dee61cd418f6edd479355fe381c -package-id stm-2.4-464c94c0d4d2a3fb7bf1cd1f8648d14d -package-id text-0.11.2.3-db61832d0c4660614c4ceff234ed4abb -package-id transformers-0.3.0.0-8e66ecc7d4dae2b07b2b5406908c70e4 -package-id utf8-string-0.3.7-3aaf9898eec3e39af0177630d5dff0c3 -package-id vector-0.10.0.1-3450daae3d9f2092020075d05481123c -package-id wai-2.0.0-8c3c2baf46caa2412490b1253748e94b -package-id warp-2.0.0-db639541f1d2870984c21cd0923ed8d0 -package-id xhtml-3000.2.1-290aa859a8b955ebda95b5ca3b1b69f3 -XHaskell98 MFlow MFlow.Wai.Blaze.Html.All MFlow.Forms MFlow.Forms.Admin MFlow.Cookies MFlow.Wai MFlow.Wai.XHtml.All MFlow.Forms.XHtml MFlow.Forms.Blaze.Html MFlow.Forms.Test MFlow.Forms.Widgets MFlow.Forms.Internals MFlow.Wai.Response
[ 1 of 13] Compiling MFlow.Cookies ( src/MFlow/Cookies.hs, dist/build/MFlow/Cookies.o )
[ 2 of 13] Compiling MFlow ( src/MFlow.hs, dist/build/MFlow.o )
[ 3 of 13] Compiling MFlow.Forms.Internals ( src/MFlow/Forms/Internals.hs, dist/build/MFlow/Forms/Internals.o )
[ 4 of 13] Compiling MFlow.Forms ( src/MFlow/Forms.hs, dist/build/MFlow/Forms.o )
[ 5 of 13] Compiling MFlow.Forms.Blaze.Html ( src/MFlow/Forms/Blaze/Html.hs, dist/build/MFlow/Forms/Blaze/Html.o )
[ 6 of 13] Compiling MFlow.Forms.XHtml ( src/MFlow/Forms/XHtml.hs, dist/build/MFlow/Forms/XHtml.o )
[ 7 of 13] Compiling MFlow.Forms.Admin ( src/MFlow/Forms/Admin.hs, dist/build/MFlow/Forms/Admin.o )
[ 8 of 13] Compiling MFlow.Forms.Widgets ( src/MFlow/Forms/Widgets.hs, dist/build/MFlow/Forms/Widgets.o )
[ 9 of 13] Compiling MFlow.Wai.Response ( src/MFlow/Wai/Response.hs, dist/build/MFlow/Wai/Response.o )
[10 of 13] Compiling MFlow.Wai ( src/MFlow/Wai.hs, dist/build/MFlow/Wai.o )

src/MFlow/Wai.hs:113:50:
Couldn't match expected type ResourceT IO' with actual typeIO'
Expected type: Source (ResourceT IO) SB.ByteString
Actual type: Source IO SB.ByteString
In the return type of a call of requestBody' In the first argument of($$)', namely `requestBody req1'

Grid - can't remove row

Again, Grid demo - just fire it up, remove a row and then try to submit - removed row is restored after POST.

'External content' widget

Would it be doable to implement widget which renders the raw content (html), and then hooks to some URL, and when request arrives there it process it, generate some value and pass this value down the flow?

This could allow to 'escape' the nice-but-often-restricting applicative/monadic land in favour of traditional approach.

Pseudocode:

external uri = do
  sendResponse "<input type='button' onclick="this.form.submit()">foo</input"
  resp <- waitForResponse uri
  x <- processResponse resp (to produce meaningful value from raw HTTP request)
  return x -- could even loop here again to 'external'

test = page $ do
  i <- getInt Nothing
  e <- external "/baz" -- this won't pass further unless there will be request ready at the specified URI
  -- ...

MFlow compilation failure on GHC 7.10

Unpacking to MFlow-0.4.5.9/
Resolving dependencies...
Configuring MFlow-0.4.5.9...
Building MFlow-0.4.5.9...
Preprocessing library MFlow-0.4.5.9...

src/MFlow/Forms/Test.hs:14:12: Warning:
    -XOverlappingInstances is deprecated: instead use per-instance pragmas OVERLAPPING/OVERLAPPABLE/OVERLAPS

src/MFlow/Forms/Widgets.hs:10:34: Warning:
    -XOverlappingInstances is deprecated: instead use per-instance pragmas OVERLAPPING/OVERLAPPABLE/OVERLAPS

src/MFlow/Forms/Internals.hs:14:12: Warning:
    -XOverlappingInstances is deprecated: instead use per-instance pragmas OVERLAPPING/OVERLAPPABLE/OVERLAPS
[ 1 of 13] Compiling MFlow.Cookies    ( src/MFlow/Cookies.hs, dist/build/MFlow/Cookies.o )

src/MFlow/Cookies.hs:99:18:
    No instance for (Foldable t1) arising from a use of ‘Prelude.elem’
    The type variable ‘t1’ is ambiguous
    Note: there are several potential instances:
      instance Foldable (Either a) -- Defined in ‘Data.Foldable’
      instance Foldable Identity -- Defined in ‘Data.Functor.Identity’
      instance Foldable Proxy -- Defined in ‘Data.Foldable’
      ...plus 15 others
    In the first argument of ‘satisfy’, namely
      ‘(`Prelude.elem` "!*'(),/\"")’
    In the expression: satisfy (`Prelude.elem` "!*'(),/\"")
    In an equation for ‘extra’:
        extra = satisfy (`Prelude.elem` "!*'(),/\"")

src/MFlow/Cookies.hs:99:33:
    No instance for (Data.String.IsString (t1 Char))
      arising from the literal ‘"!*'(),/\""’
    The type variable ‘t1’ is ambiguous
    Note: there is a potential instance available:
      instance Data.String.IsString [Char] -- Defined in ‘Data.String’
    In the second argument of ‘Prelude.elem’, namely ‘"!*'(),/\""’
    In the first argument of ‘satisfy’, namely
      ‘(`Prelude.elem` "!*'(),/\"")’
    In the expression: satisfy (`Prelude.elem` "!*'(),/\"")

src/MFlow/Cookies.hs:102:17:
    No instance for (Foldable t0) arising from a use of ‘Prelude.elem’
    The type variable ‘t0’ is ambiguous
    Note: there are several potential instances:
      instance Foldable (Either a) -- Defined in ‘Data.Foldable’
      instance Foldable Identity -- Defined in ‘Data.Functor.Identity’
      instance Foldable Proxy -- Defined in ‘Data.Foldable’
      ...plus 15 others
    In the first argument of ‘satisfy’, namely
      ‘(`Prelude.elem` "$-_.")’
    In the expression: satisfy (`Prelude.elem` "$-_.")
    In an equation for ‘safe’: safe = satisfy (`Prelude.elem` "$-_.")

src/MFlow/Cookies.hs:102:32:
    No instance for (Data.String.IsString (t0 Char))
      arising from the literal ‘"$-_."’
    The type variable ‘t0’ is ambiguous
    Note: there is a potential instance available:
      instance Data.String.IsString [Char] -- Defined in ‘Data.String’
    In the second argument of ‘Prelude.elem’, namely ‘"$-_."’
    In the first argument of ‘satisfy’, namely
      ‘(`Prelude.elem` "$-_.")’
    In the expression: satisfy (`Prelude.elem` "$-_.")

Malformed mflow.config causing Prelude.read parse error

I originally had MFlow-0.3.3 installed but recently upgraded to MFlow-0.4.2.

I attempted to recompile a small MFlow example, "example.hs"...

{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}

import MFlow.Wai.Blaze.Html.All

main= runNavigation "navString" . step $ ask $ do
  (h1 "H1 content")
  ++> stop

...which compiled without error. However, running the example now gave me the following output:

bgeorge@server:~/mflow$ ./example 8112
using port 8112
Using configuration:
sync...examples: Prelude.read: no parse

I made a completely new directory and compiled the same code as above and it ran fine with no problems.

I eventually tracked down the offending "read" call to an attempt to print 'config', and realized that the content of .tcachedata/mflow.config was different in my recompiled directory and my new copy.

The content of the being printed upon starting the application in the new directory is:

Config {cadmin = "admin", cjqueryScript = "//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js", cjqueryCSS = "//code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css", cjqueryUI = "//code.jquery.com/ui/1.10.3/jquery-ui.js", cnicEditUrl = "//js.nicedit.com/nicEdit-latest.js"}

The content of the mflow.config file in the original directory (which produces the 'read' parse error) was simply:

Config "admin"

Manually overwriting the old mflow.config with the new Config data structure caused the application to work correctly without any recompilation necessary.

Conclusion
I believe that the original mflow.config data was from the earlier version of the MFlow library that persisted after my reinstallation. Perhaps, if possible, it would be better to regenerate the mflow.config file after every recompilation, or perhaps even on startup on an application, to ensure that the config file is generated according to the specifications current version of the MFlow library. At the least, it might be advisable to warn users that on upgrading, the mflow.config file from old programs must be removed and regenerated.

runSecureNavigation fails with submitButton widget

Description: runSecureNavigation appears to fail with submitButton widget. Behavior is after submiting data, one expects next page to load, but repeats the same page with submitButton. It has behaved differently before in that it goes to next page, but then goes back to submitButton page when user tries to go forward.
Line: haskell <** submitButton "Submit"
Version:

  • GHC 7.10.2
  • MFlow-0.4.5.11
{-# LANGUAGE OverloadedStrings #-}

module Main
where
import MFlow.Wai.Blaze.Html.All hiding(main)
import qualified MFlow.Forms as F
import Data.Typeable
import System.IO.Unsafe


sitePages :: FlowM Html IO ()
sitePages = do 
  page $ wlink () << b "Here A"
  page $ wlink () << b "Here B"
  someVal <- page  
    $   getString Nothing <! hint "Test" 
    <++ br
    <** submitButton "Submit"
  page $ wlink () << b "Here 1"
  page $ wlink () << b "Here 2"
  where
  hint x = [("placeholder", x)]

main :: IO ()
main = do 
  setAdminUser ("admin"::String) (""::String)
  runSecureNavigation "" . transientNav $ do
      sitePages

REST ful URLs

rewriting the URLs to create REST style urls . All link mavigation withing the flow must appear as restful URLs

MFlow build failure - probably WAI, conduit, maybe ghc 7.8.2.20140609

I notice that you don't have any version constraints on the yesod team stuff. I think they've made changes, and based on the errors I don't think it's ghc.
Anyways here is the errors I've got so far

[11 of 13] Compiling MFlow.Wai ( src\MFlow\Wai.hs, dist\build\MFlow\Wai.o )

src\MFlow\Wai.hs:95:6:
Couldn't match type Response' withIO ResponseReceived'
Expected type: ((Response -> IO ResponseReceived)
-> (ByteString, [Cookie]))
-> ((ByteString, [Cookie])
-> (Response -> IO ResponseReceived) -> Response)
-> (Response -> IO ResponseReceived)
-> IO ResponseReceived
Actual type: ((Response -> IO ResponseReceived)
-> (ByteString, [Cookie]))
-> ((ByteString, [Cookie])
-> (Response -> IO ResponseReceived) -> Response)
-> (Response -> IO ResponseReceived)
-> Response
In a stmt of a 'do' block:
(flowval, retcookies) <- case lookup flow cookies of {
Just fl -> return (fl, [])
Nothing
-> do { fl <- liftIO $ newFlow;
return (fl, [...]) } }
In the expression:
do { let httpreq1 = requestHeaders req1;
let cookies = getCookies httpreq1;
(flowval, retcookies) <- case lookup flow cookies of {
Just fl -> return (fl, [])
Nothing -> do { ... } };
input <- case parseMethod $ requestMethod req1 of {
Right POST -> do { ... }
Right GET
-> return . Prelude.map (\ (x, y) -> ...) $ queryString req1 };
.... }
In an equation for `waiMessageFlow':
waiMessageFlow req1
= do { let httpreq1 = ...;
let cookies = ...;
(flowval, retcookies) <- case lookup flow cookies of {
Just fl -> return ...
Nothing -> ... };
.... }

src\MFlow\Wai.hs:111:36:
Couldn't match type IO ByteString' withConduitM () ByteString IO ()'
Expected type: Source IO ByteString
Actual type: IO ByteString
In the first argument of ($$)', namelyrequestBody req1'
In the second argument of ($)', namely requestBody req1 $$ CList.consume'

src\MFlow\Wai.hs:143:10:
Could not deduce (Eq t0) arising from a use of lookup' from the context (IResource a, Data.String.IsString t1, Eq t1) bound by the inferred type of putStateCookie :: (IResource a, Data.String.IsString t1, Eq t1) => a -> [(t0, (t, String, t1, t2))] -> IO () at src\MFlow\Wai.hs:(142,1)-(148,98) The type variablet0' is ambiguous
Relevant bindings include
cookies :: [(t0, (t, String, t1, t2))](bound at srcMFlowWai.hs:142:20)
putStateCookie :: a -> [(t0, (t, String, t1, t2))] -> IO ()
(bound at src\MFlow\Wai.hs:142:1)
Note: there are several potential instances:
instance Eq Cookie -- Defined at src\MFlow\Cookies.hs:42:15
instance Eq Data.Char.GeneralCategory -- Defined in Data.Char' instance Eq a => Eq (Maybe a) -- Defined inData.Maybe'
...plus 178 others
In the expression: lookup statCookieName cookies
In the expression:
case lookup statCookieName cookies of {
Nothing -> return ()
Just (statCookieName, str, "/", )
-> modifyMVar
tvresources
$ \ mmap
-> case mmap of {
Just map -> ...
Nothing -> ... } }
In an equation for `putStateCookie':
putStateCookie req cookies
= case lookup statCookieName cookies of {
Nothing -> return ()
Just (statCookieName, str, "/", )
-> modifyMVar
tvresources $ \ mmap -> ... }

"push" function doesn't show data the first data update

Description: push function requires clicking the submit button one additional time in browser before it receives the data. In other words, push requires two data updates before it shows in browser.
Line: haskell <** push Append 0 (do
Version:

  • GHC 7.10.2
  • MFlow-0.4.5.11

Note this code was found in the tutorial.

{-# LANGUAGE OverloadedStrings #-}

import MFlow.Wai.Blaze.Html.All
import System.IO.Unsafe
import Control.Concurrent.MVar


res = unsafePerformIO $ newEmptyMVar :: MVar Int  

main= runNavigation "" . step . page $ do
   "Hi, I' m not refreshed, unless you "
     ++>  wlink () "click here" 
     <++ " in which case, a navigation happens"

    <** (autoRefresh .  pageFlow "s" $ do
          n  <- "First  "  ++> getInt Nothing   <++ br
          n' <- "Second " ++> getInt (Just n)  <++ br
          liftIO $ putMVar res $ n + n' 
          noWidget 
         <** br ++> pageFlow "button" (submitButton "submit"))

    <** push Append 0  (do
            n <- liftIO  $ takeMVar res  
            b << (show n) ++> br ++> noWidget )

AJAX - genNewId produces duplicates

Grid demo again: just add more than one row and check produced names - they are duplicated across the AJAX call.

Submitting the form seems to 'update' (for a lack of better word as I do not know the internals very well) the sequence and after that, the names generated are OK (but again, only for first ajax call).

Missing module CachingDataset

Discovered via Stackage build:

Configuring MFlow-0.4.5.5...
Dependency MFlow -any: using MFlow-0.4.5.5
Dependency RefSerialize ==0.3.1.3: using RefSerialize-0.3.1.3
Dependency TCache ==0.12.0: using TCache-0.12.0
Dependency Workflow ==0.8.1: using Workflow-0.8.1
Dependency acid-state ==0.12.2: using acid-state-0.12.2
Dependency aws ==0.9.1: using aws-0.9.1
Dependency base ==4.6.0.1: using base-4.6.0.1
Dependency blaze-html ==0.7.0.2: using blaze-html-0.7.0.2
Dependency blaze-markup ==0.6.1.0: using blaze-markup-0.6.1.0
Dependency bytestring ==0.10.0.2: using bytestring-0.10.0.2
Dependency case-insensitive ==1.2.0.0: using case-insensitive-1.2.0.0
Dependency clientsession ==0.9.0.3: using clientsession-0.9.0.3
Dependency conduit ==1.1.7: using conduit-1.1.7
Dependency conduit-extra ==1.1.2: using conduit-extra-1.1.2
Dependency containers ==0.5.0.0: using containers-0.5.0.0
Dependency directory ==1.2.0.1: using directory-1.2.0.1
Dependency extensible-exceptions ==0.1.1.4: using
extensible-exceptions-0.1.1.4
Dependency hamlet ==1.2.0: using hamlet-1.2.0
Dependency hscolour ==1.20.3: using hscolour-1.20.3
Dependency http-conduit ==2.1.4: using http-conduit-2.1.4
Dependency http-types ==0.8.5: using http-types-0.8.5
Dependency monad-logger ==0.3.7: using monad-logger-0.3.7
Dependency monadloc ==0.7.1: using monadloc-0.7.1
Dependency mtl ==2.1.3.1: using mtl-2.1.3.1
Dependency network ==2.5.0.0: using network-2.5.0.0
Dependency old-time ==1.1.0.1: using old-time-1.1.0.1
Dependency parsec ==3.1.5: using parsec-3.1.5
Dependency persistent ==1.3.1.1: using persistent-1.3.1.1
Dependency persistent-sqlite ==1.3.0.5: using persistent-sqlite-1.3.0.5
Dependency persistent-template ==1.3.1.4: using persistent-template-1.3.1.4
Dependency pwstore-fast ==2.4.1: using pwstore-fast-2.4.1
Dependency random ==1.0.1.1: using random-1.0.1.1
Dependency resourcet ==1.1.2.2: using resourcet-1.1.2.2
Dependency safecopy ==0.8.3: using safecopy-0.8.3
Dependency shakespeare ==2.0.1: using shakespeare-2.0.1
Dependency stm ==2.4.3: using stm-2.4.3
Dependency tcache-AWS ==0.0.1: using tcache-AWS-0.0.1
Dependency text ==1.1.1.3: using text-1.1.1.3
Dependency time ==1.4.0.1: using time-1.4.0.1
Dependency transformers ==0.3.0.0: using transformers-0.3.0.0
Dependency utf8-string ==0.3.8: using utf8-string-0.3.8
Dependency vector ==0.10.11.0: using vector-0.10.11.0
Dependency wai ==3.0.1: using wai-3.0.1
Dependency wai-extra ==3.0.1: using wai-extra-3.0.1
Dependency warp ==3.0.0.4: using warp-3.0.0.4
Dependency warp-tls ==3.0.0: using warp-tls-3.0.0
Using Cabal-1.20.0.0 compiled by ghc-7.6
Using compiler: ghc-7.6.3
Using install prefix: /var/lib/jenkins/.cabal
Binaries installed in:
/var/lib/jenkins/workspace/Stackage/ghcversion/7.6.3/stackage/sandbox/bin
Libraries installed in:
/var/lib/jenkins/workspace/Stackage/ghcversion/7.6.3/stackage/sandbox/lib/x86_64-linux-ghc-7.6.3/MFlow-0.4.5.5
Private binaries installed in: /var/lib/jenkins/.cabal/libexec
Data files installed in:
/var/lib/jenkins/workspace/Stackage/ghcversion/7.6.3/stackage/sandbox/share/x86_64-linux-ghc-7.6.3/MFlow-0.4.5.5
Documentation installed in:
/var/lib/jenkins/workspace/Stackage/ghcversion/7.6.3/stackage/sandbox/share/doc/MFlow-0.4.5.5
Configuration files installed in: /var/lib/jenkins/.cabal/etc
Using alex version 3.1.3 found on system at:
/var/lib/jenkins/workspace/Stackage/ghcversion/7.6.3/stackage/sandbox/bin/alex
Using ar found on system at: /usr/bin/ar
No c2hs found
Using cpphs version 1.18.5 found on system at:
/var/lib/jenkins/workspace/Stackage/ghcversion/7.6.3/stackage/sandbox/bin/cpphs
No ffihugs found
Using gcc version 4.8 found on system at: /usr/bin/gcc
Using ghc version 7.6.3 found on system at: /opt/ghc/7.6.3/bin/ghc
Using ghc-pkg version 7.6.3 found on system at: /opt/ghc/7.6.3/bin/ghc-pkg
No greencard found
Using haddock version 2.13.2 found on system at: /opt/ghc/7.6.3/bin/haddock
Using happy version 1.19.4 found on system at:
/var/lib/jenkins/workspace/Stackage/ghcversion/7.6.3/stackage/sandbox/bin/happy
Using haskell-suite found on system at: haskell-suite-dummy-location
Using haskell-suite-pkg found on system at: haskell-suite-pkg-dummy-location
No hmake found
Using hpc version 0.6 found on system at: /opt/ghc/7.6.3/bin/hpc
Using hsc2hs version 0.67 found on system at: /opt/ghc/7.6.3/bin/hsc2hs
Using hscolour version 1.20 found on system at:
/var/lib/jenkins/workspace/Stackage/ghcversion/7.6.3/stackage/sandbox/bin/HsColour
No hugs found
No jhc found
Using ld found on system at: /usr/bin/ld
No lhc found
No lhc-pkg found
No nhc98 found
Using pkg-config version 0.26 found on system at: /usr/bin/pkg-config
Using strip found on system at: /usr/bin/strip
Using tar found on system at: /bin/tar
No uhc found
Component build order: library, executable 'demos-blaze'
creating dist/build
creating dist/build/autogen
Building MFlow-0.4.5.5...
Preprocessing library MFlow-0.4.5.5...
Building library...
creating dist/build
/opt/ghc/7.6.3/bin/ghc --make -fbuilding-cabal-package -O -outputdir dist/build -odir dist/build -hidir dist/build -stubdir dist/build -i -idist/build -isrc -i. -idist/build/autogen -Idist/build/autogen -Idist/build -optP-include -optPdist/build/autogen/cabal_macros.h -package-name MFlow-0.4.5.5 -hide-all-packages -no-user-package-db -package-db /var/lib/jenkins/workspace/Stackage/ghcversion/7.6.3/stackage/sandbox/package-db -package-db dist/package.conf.inplace -package-id RefSerialize-0.3.1.3-148154176467f2542f30849f4f5ef72c -package-id TCache-0.12.0-c0f85e8cb675b2f37308cd4baae766c5 -package-id Workflow-0.8.1-17b924d3bc8bb35fdfede6190ea9c4bd -package-id base-4.6.0.1-8aa5d403c45ea59dcd2c39f123e27d57 -package-id blaze-html-0.7.0.2-767e0d2964d860facdd0b1de1feef086 -package-id blaze-markup-0.6.1.0-5afc77e4a76ce504c324cd8800b729c6 -package-id bytestring-0.10.0.2-4f93248f75667c2c3321a7a6761b576f -package-id case-insensitive-1.2.0.0-874224c99845fa0039803ad9f72c5263 -package-id clientsession-0.9.0.3-b4d52a8ff3e4862e4a41aef699d1f209 -package-id conduit-1.1.7-18dd1130d5ec08f4b74fb00d7c06af7e -package-id conduit-extra-1.1.2-9074aeee018500fdde5ad25a8dde7537 -package-id containers-0.5.0.0-ab1dae9a94cd3cc84e7b2805636ebfa2 -package-id directory-1.2.0.1-91a788fd88acd7f149f0f10f5f1e23f2 -package-id extensible-exceptions-0.1.1.4-255a395b3b026cb94b23754e1c372785 -package-id http-types-0.8.5-7c8c8f9e26d8cfdcab0349883bcdfb73 -package-id monadloc-0.7.1-58e9c91673593fb8ba84f5209eb33086 -package-id mtl-2.1.3.1-4779b0d7ec31de052f42201cd7318025 -package-id old-time-1.1.0.1-2f8ea093d0c7014780a8a5772f948883 -package-id parsec-3.1.5-6047816c6be1ed9290e2de8e2f5fca42 -package-id pwstore-fast-2.4.1-a110254fac39e13d54a23c9f541dc3e5 -package-id random-1.0.1.1-43fdc5da991685d8a0ec8cb553880cf8 -package-id resourcet-1.1.2.2-532c7664b48a244929cd6d280c710b32 -package-id stm-2.4.3-68142cec265900bbe975f859f51e58dd -package-id text-1.1.1.3-816aa0cc7f7809a2ee3486e78ab4bb4f -package-id time-1.4.0.1-10dc4804a19dc0000fab79908f1a9f50 -package-id transformers-0.3.0.0-ff2bb6ac67241ebb987351a3db564af0 -package-id utf8-string-0.3.8-1b09e92d7b62cac3793717f9d263068c -package-id vector-0.10.11.0-8692bd0af40f4c9f54115602c29cbe85 -package-id wai-3.0.1-317268f43843b26c341d12f99fab9e3e -package-id wai-extra-3.0.1-f01547eb260196ce02c9179e7f7e1ba8 -package-id warp-3.0.0.4-bb42b812e0d47559ea87f495ab4a6bab -package-id warp-tls-3.0.0-8e253b42f752b1558b31384ab191b5e9 -XHaskell98 MFlow MFlow.Wai.Blaze.Html.All MFlow.Forms MFlow.Forms.Admin MFlow.Cookies MFlow.Wai MFlow.Forms.Blaze.Html MFlow.Forms.Test MFlow.Forms.Widgets MFlow.Forms.Internals MFlow.Forms.WebApi MFlow.Forms.Cache MFlow.Wai.Response
[ 1 of 13] Compiling MFlow.Cookies    ( src/MFlow/Cookies.hs, dist/build/MFlow/Cookies.o )
[ 2 of 13] Compiling MFlow            ( src/MFlow.hs, dist/build/MFlow.o )
[ 3 of 13] Compiling MFlow.Forms.Internals ( src/MFlow/Forms/Internals.hs, dist/build/MFlow/Forms/Internals.o )
[ 4 of 13] Compiling MFlow.Forms.Cache ( src/MFlow/Forms/Cache.hs, dist/build/MFlow/Forms/Cache.o )
[ 5 of 13] Compiling MFlow.Forms      ( src/MFlow/Forms.hs, dist/build/MFlow/Forms.o )
[ 6 of 13] Compiling MFlow.Forms.Blaze.Html ( src/MFlow/Forms/Blaze/Html.hs, dist/build/MFlow/Forms/Blaze/Html.o )
[ 7 of 13] Compiling MFlow.Forms.Admin ( src/MFlow/Forms/Admin.hs, dist/build/MFlow/Forms/Admin.o )
[ 8 of 13] Compiling MFlow.Forms.WebApi ( src/MFlow/Forms/WebApi.hs, dist/build/MFlow/Forms/WebApi.o )
[ 9 of 13] Compiling MFlow.Forms.Widgets ( src/MFlow/Forms/Widgets.hs, dist/build/MFlow/Forms/Widgets.o )
[10 of 13] Compiling MFlow.Wai.Response ( src/MFlow/Wai/Response.hs, dist/build/MFlow/Wai/Response.o )
[11 of 13] Compiling MFlow.Wai        ( src/MFlow/Wai.hs, dist/build/MFlow/Wai.o )
[12 of 13] Compiling MFlow.Wai.Blaze.Html.All ( src/MFlow/Wai/Blaze/Html/All.hs, dist/build/MFlow/Wai/Blaze/Html/All.o )

src/MFlow/Wai/Blaze/Html/All.hs:99:27: Warning:
    In the use of `settingsPort'
    (imported from Network.Wai.Handler.Warp, but defined in warp-3.0.0.4:Network.Wai.Handler.Warp.Settings):
    Deprecated: "Use setPort instead"
[13 of 13] Compiling MFlow.Forms.Test ( src/MFlow/Forms/Test.hs, dist/build/MFlow/Forms/Test.o )
Linking...
/usr/bin/ar -r dist/build/libHSMFlow-0.4.5.5.a-8871/libHSMFlow-0.4.5.5.a dist/build/MFlow.o dist/build/MFlow/Wai/Blaze/Html/All.o dist/build/MFlow/Forms.o dist/build/MFlow/Forms/Admin.o dist/build/MFlow/Cookies.o dist/build/MFlow/Wai.o dist/build/MFlow/Forms/Blaze/Html.o dist/build/MFlow/Forms/Test.o dist/build/MFlow/Forms/Widgets.o dist/build/MFlow/Forms/Internals.o dist/build/MFlow/Forms/WebApi.o dist/build/MFlow/Forms/Cache.o dist/build/MFlow/Wai/Response.o
/usr/bin/ar: creating dist/build/libHSMFlow-0.4.5.5.a-8871/libHSMFlow-0.4.5.5.a
/usr/bin/strip dist/build/libHSMFlow-0.4.5.5.a-8871/libHSMFlow-0.4.5.5.a --strip-unneeded
In-place registering MFlow-0.4.5.5...
'/opt/ghc/7.6.3/bin/ghc-pkg' 'update' '-' '--global' '--no-user-package-db' '--package-db=/var/lib/jenkins/workspace/Stackage/ghcversion/7.6.3/stackage/sandbox/package-db' '--package-db=dist/package.conf.inplace'
Preprocessing executable 'demos-blaze' for MFlow-0.4.5.5...
Building executable demos-blaze...
creating dist/build/demos-blaze
creating dist/build/demos-blaze/demos-blaze-tmp
/opt/ghc/7.6.3/bin/ghc --make -no-link -fbuilding-cabal-package -O -static -outputdir dist/build/demos-blaze/demos-blaze-tmp -odir dist/build/demos-blaze/demos-blaze-tmp -hidir dist/build/demos-blaze/demos-blaze-tmp -stubdir dist/build/demos-blaze/demos-blaze-tmp -i -idist/build/demos-blaze/demos-blaze-tmp -iDemos -idist/build/autogen -Idist/build/autogen -Idist/build/demos-blaze/demos-blaze-tmp -optP-include -optPdist/build/autogen/cabal_macros.h -hide-all-packages -no-user-package-db -package-db /var/lib/jenkins/workspace/Stackage/ghcversion/7.6.3/stackage/sandbox/package-db -package-db dist/package.conf.inplace -package-id RefSerialize-0.3.1.3-148154176467f2542f30849f4f5ef72c -package-id TCache-0.12.0-c0f85e8cb675b2f37308cd4baae766c5 -package-id Workflow-0.8.1-17b924d3bc8bb35fdfede6190ea9c4bd -package-id acid-state-0.12.2-dc4ecc47634f4696c15717c8a3e04f6a -package-id aws-0.9.1-36f970132e3aa8450eddfce97e04c153 -package-id base-4.6.0.1-8aa5d403c45ea59dcd2c39f123e27d57 -package-id blaze-html-0.7.0.2-767e0d2964d860facdd0b1de1feef086 -package-id bytestring-0.10.0.2-4f93248f75667c2c3321a7a6761b576f -package-id conduit-1.1.7-18dd1130d5ec08f4b74fb00d7c06af7e -package-id containers-0.5.0.0-ab1dae9a94cd3cc84e7b2805636ebfa2 -package-id directory-1.2.0.1-91a788fd88acd7f149f0f10f5f1e23f2 -package-id hamlet-1.2.0-dcef4e1eeab8de73981ca7a7147f19d8 -package-id hscolour-1.20.3-981d778dc55cc8f94150037fce135d9b -package-id http-conduit-2.1.4-95098dfa1699fe448908eb34bfbd25be -package-id monad-logger-0.3.7-945179f6b23e3ddf854515d29198beab -package-id monadloc-0.7.1-58e9c91673593fb8ba84f5209eb33086 -package-id mtl-2.1.3.1-4779b0d7ec31de052f42201cd7318025 -package-id network-2.5.0.0-72bdf9ba8b680d168b7222a0939f0b5d -package-id old-time-1.1.0.1-2f8ea093d0c7014780a8a5772f948883 -package-id persistent-1.3.1.1-ececb0f8b9481ee4d374ccb76e214663 -package-id persistent-sqlite-1.3.0.5-99f65eb778ac31416ab11332df6debe5 -package-id persistent-template-1.3.1.4-0c1e05265543eccd3702f144b8f040dc -package-id safecopy-0.8.3-dd6a5d5eb04afab24149835e81b93da1 -package-id shakespeare-2.0.1-cfeda16a5abf46728764f0fe78ca2ead -package-id stm-2.4.3-68142cec265900bbe975f859f51e58dd -package-id tcache-AWS-0.0.1-5c4bb2d5e8fd419edbdfa272d86d057f -package-id text-1.1.1.3-816aa0cc7f7809a2ee3486e78ab4bb4f -package-id time-1.4.0.1-10dc4804a19dc0000fab79908f1a9f50 -package-id transformers-0.3.0.0-ff2bb6ac67241ebb987351a3db564af0 -package-id vector-0.10.11.0-8692bd0af40f4c9f54115602c29cbe85 -package-id MFlow-0.4.5.5-inplace -XHaskell98 Demos/demos-blaze.hs -iDemos -threaded -rtsopts

Demos/demos-blaze.hs:53:8:
    Could not find module `CachingDataset'
    Use -v to see a list of the files searched for.

Haddock documentation doesn't help new users

There is too much Haddock documentation for MFlow. The documentation tries to feed the user too much information at once. The documentation doesn't help new users quickly figure out how they can use this awesome package. This is made even worse by the numerous typos scattered in the documentation. These typos make the package seem unfit for real-world usage.

New users interested in MFlow only care about how they can use it. There is no doubt that it is built upon a great idea, but they haven't yet had the understanding needed to appreciate it.

People might adopt MFlow much more eagerly if we reduce friction for new users. We can do this by empathizing with our would-be users while we write our documentation. We can do this by seeing things from their point of view and anticipating their problems.

A separate tutorial somewhere in the Internet isn't enough; the Haddock documentation itself has to guide the new user because that documentation is what the user expects to read first after installing a package.

No instance for (Semigroup HttpData) with ghc 8.4.4

This Dockerfile reproduces the problem (after several cups of tea):

FROM gregweber/ghc-haskell-dev
USER root
RUN apt-get update
RUN apt-get install wget
USER ghc
RUN wget https://downloads.haskell.org/~ghc/8.4.4/ghc-8.4.4-src.tar.xz
RUN tar xf ghc-8.4.4-src.tar.xz
RUN cd ghc-8.4.4; ./configure; make
RUN wget https://www.haskell.org/cabal/release/cabal-2.4.0.0/Cabal-2.4.0.0.tar.gz
RUN tar xf Cabal-2.4.0.0.tar.gz
RUN cd Cabal-2.4.0.0; ghc -threaded --make Setup;
RUN cd Cabal-2.4.0.0; ./Setup configure; ./Setup build;
USER root
RUN cd Cabal-2.4.0.0; ./Setup install
RUN apt-get install libz-dev
USER ghc
RUN cabal install lens
RUN cabal install cpphs
RUN cabal install diagrams
RUN cabal install MFlow

Haddock error in latest release

Registering MFlow-0.4.5.12...
Running Haddock for MFlow-0.4.5.12...
Running hscolour for MFlow-0.4.5.12...
Preprocessing library MFlow-0.4.5.12...
Preprocessing library MFlow-0.4.5.12...
Warning: The documentation for the following packages are not installed. No
links will be generated to these packages: bytestring-builder-0.10.6.0.0,
nats-1, transformers-compat-0.4.0.4

src/MFlow/Forms/Test.hs:14:12: Warning:
    -XOverlappingInstances is deprecated: instead use per-instance pragmas OVERLAPPING/OVERLAPPABLE/OVERLAPS

src/MFlow/Forms/Widgets.hs:9:34: Warning:
    -XOverlappingInstances is deprecated: instead use per-instance pragmas OVERLAPPING/OVERLAPPABLE/OVERLAPS

src/MFlow/Forms/Internals.hs:14:12: Warning:
    -XOverlappingInstances is deprecated: instead use per-instance pragmas OVERLAPPING/OVERLAPPABLE/OVERLAPS

src/MFlow.hs:731:13: Warning: Tab character

src/MFlow.hs:732:12: Warning: Tab character

src/MFlow.hs:733:12: Warning: Tab character

src/MFlow.hs:736:13: Warning: Tab character

src/MFlow.hs:737:12: Warning: Tab character

src/MFlow.hs:738:11: Warning: Tab character

src/MFlow.hs:739:12: Warning: Tab character

src/MFlow.hs:740:12: Warning: Tab character

src/MFlow.hs:741:12: Warning: Tab character

src/MFlow.hs:742:12: Warning: Tab character

src/MFlow.hs:743:12: Warning: Tab character

src/MFlow.hs:744:12: Warning: Tab character

src/MFlow.hs:745:12: Warning: Tab character

src/MFlow.hs:746:12: Warning: Tab character

src/MFlow.hs:747:12: Warning: Tab character

src/MFlow.hs:748:13: Warning: Tab character

src/MFlow.hs:749:12: Warning: Tab character

src/MFlow.hs:750:14: Warning: Tab character

src/MFlow.hs:751:12: Warning: Tab character

src/MFlow.hs:752:12: Warning: Tab character

src/MFlow.hs:753:12: Warning: Tab character

src/MFlow.hs:754:12: Warning: Tab character

src/MFlow.hs:755:13: Warning: Tab character

src/MFlow.hs:756:12: Warning: Tab character

src/MFlow.hs:757:12: Warning: Tab character

src/MFlow.hs:758:12: Warning: Tab character

src/MFlow.hs:759:10: Warning: Tab character

src/MFlow.hs:760:12: Warning: Tab character

src/MFlow.hs:761:11: Warning: Tab character

src/MFlow.hs:762:12: Warning: Tab character

src/MFlow.hs:763:13: Warning: Tab character

src/MFlow.hs:764:13: Warning: Tab character

src/MFlow.hs:765:12: Warning: Tab character

src/MFlow.hs:766:12: Warning: Tab character

src/MFlow.hs:767:12: Warning: Tab character

src/MFlow.hs:768:11: Warning: Tab character

src/MFlow.hs:769:12: Warning: Tab character

src/MFlow.hs:770:12: Warning: Tab character

src/MFlow.hs:771:12: Warning: Tab character

src/MFlow.hs:772:14: Warning: Tab character

src/MFlow.hs:773:12: Warning: Tab character

src/MFlow.hs:774:10: Warning: Tab character

src/MFlow.hs:775:12: Warning: Tab character

src/MFlow.hs:776:12: Warning: Tab character

src/MFlow.hs:777:12: Warning: Tab character

src/MFlow.hs:778:12: Warning: Tab character

src/MFlow.hs:779:14: Warning: Tab character

src/MFlow.hs:780:12: Warning: Tab character

src/MFlow.hs:781:12: Warning: Tab character

src/MFlow.hs:782:12: Warning: Tab character

src/MFlow.hs:783:13: Warning: Tab character

src/MFlow.hs:784:12: Warning: Tab character

src/MFlow.hs:785:12: Warning: Tab character

src/MFlow.hs:786:12: Warning: Tab character

src/MFlow.hs:787:12: Warning: Tab character

src/MFlow.hs:788:12: Warning: Tab character

src/MFlow.hs:789:12: Warning: Tab character

src/MFlow.hs:790:12: Warning: Tab character

src/MFlow.hs:791:12: Warning: Tab character

src/MFlow.hs:792:12: Warning: Tab character

src/MFlow.hs:793:12: Warning: Tab character

src/MFlow.hs:794:12: Warning: Tab character

src/MFlow.hs:795:12: Warning: Tab character

src/MFlow.hs:796:12: Warning: Tab character

src/MFlow.hs:797:12: Warning: Tab character

src/MFlow.hs:798:12: Warning: Tab character

src/MFlow.hs:799:12: Warning: Tab character

src/MFlow.hs:800:12: Warning: Tab character

src/MFlow.hs:801:12: Warning: Tab character

src/MFlow.hs:802:13: Warning: Tab character

src/MFlow.hs:803:11: Warning: Tab character

src/MFlow.hs:804:10: Warning: Tab character

src/MFlow.hs:805:12: Warning: Tab character

src/MFlow.hs:806:12: Warning: Tab character

src/MFlow.hs:807:12: Warning: Tab character

src/MFlow.hs:808:12: Warning: Tab character

src/MFlow.hs:809:12: Warning: Tab character

src/MFlow.hs:810:12: Warning: Tab character

src/MFlow.hs:811:12: Warning: Tab character

src/MFlow.hs:812:12: Warning: Tab character

src/MFlow.hs:813:12: Warning: Tab character

src/MFlow.hs:814:12: Warning: Tab character

src/MFlow.hs:815:13: Warning: Tab character

src/MFlow.hs:816:12: Warning: Tab character

src/MFlow.hs:817:14: Warning: Tab character

src/MFlow.hs:818:12: Warning: Tab character

src/MFlow.hs:819:12: Warning: Tab character

src/MFlow.hs:820:12: Warning: Tab character

src/MFlow.hs:821:12: Warning: Tab character

src/MFlow.hs:822:12: Warning: Tab character

src/MFlow.hs:823:12: Warning: Tab character

src/MFlow.hs:824:12: Warning: Tab character

src/MFlow.hs:825:12: Warning: Tab character

src/MFlow.hs:826:12: Warning: Tab character

src/MFlow.hs:827:11: Warning: Tab character

src/MFlow.hs:828:12: Warning: Tab character

src/MFlow.hs:829:14: Warning: Tab character

src/MFlow.hs:830:12: Warning: Tab character

src/MFlow.hs:831:12: Warning: Tab character

src/MFlow.hs:832:13: Warning: Tab character

src/MFlow.hs:833:11: Warning: Tab character

src/MFlow.hs:834:12: Warning: Tab character

src/MFlow.hs:835:12: Warning: Tab character

src/MFlow.hs:836:11: Warning: Tab character

src/MFlow.hs:837:12: Warning: Tab character

src/MFlow.hs:838:12: Warning: Tab character

src/MFlow.hs:839:12: Warning: Tab character

src/MFlow.hs:840:12: Warning: Tab character

src/MFlow.hs:841:12: Warning: Tab character

src/MFlow.hs:842:12: Warning: Tab character

src/MFlow.hs:843:12: Warning: Tab character

src/MFlow.hs:844:12: Warning: Tab character

src/MFlow.hs:845:12: Warning: Tab character

src/MFlow.hs:847:12: Warning: Tab character

src/MFlow.hs:848:12: Warning: Tab character

src/MFlow.hs:849:12: Warning: Tab character

src/MFlow.hs:850:12: Warning: Tab character

src/MFlow.hs:851:12: Warning: Tab character

src/MFlow.hs:852:12: Warning: Tab character

src/MFlow.hs:853:12: Warning: Tab character

src/MFlow.hs:854:12: Warning: Tab character

src/MFlow.hs:855:12: Warning: Tab character

src/MFlow.hs:856:12: Warning: Tab character

src/MFlow.hs:857:12: Warning: Tab character

src/MFlow.hs:858:12: Warning: Tab character

src/MFlow.hs:859:12: Warning: Tab character

src/MFlow.hs:860:12: Warning: Tab character

src/MFlow.hs:861:12: Warning: Tab character

src/MFlow.hs:862:11: Warning: Tab character

src/MFlow.hs:863:12: Warning: Tab character

src/MFlow.hs:864:11: Warning: Tab character

src/MFlow.hs:865:11: Warning: Tab character

src/MFlow.hs:866:12: Warning: Tab character

src/MFlow.hs:867:12: Warning: Tab character

src/MFlow.hs:868:12: Warning: Tab character

src/MFlow.hs:869:12: Warning: Tab character

src/MFlow.hs:870:13: Warning: Tab character

src/MFlow.hs:871:12: Warning: Tab character

src/MFlow.hs:872:12: Warning: Tab character

src/MFlow.hs:873:12: Warning: Tab character

src/MFlow.hs:874:12: Warning: Tab character

src/MFlow.hs:875:15: Warning: Tab character

src/MFlow.hs:876:15: Warning: Tab character

src/MFlow.hs:877:11: Warning: Tab character

src/MFlow.hs:878:13: Warning: Tab character

src/MFlow.hs:879:12: Warning: Tab character

src/MFlow.hs:880:12: Warning: Tab character

src/MFlow.hs:881:12: Warning: Tab character

src/MFlow.hs:882:12: Warning: Tab character

src/MFlow.hs:883:12: Warning: Tab character

src/MFlow.hs:884:12: Warning: Tab character

src/MFlow.hs:885:12: Warning: Tab character

src/MFlow.hs:886:12: Warning: Tab character

src/MFlow.hs:887:16: Warning: Tab character

src/MFlow.hs:888:15: Warning: Tab character

src/MFlow.hs:889:12: Warning: Tab character

src/MFlow.hs:890:12: Warning: Tab character

src/MFlow.hs:891:10: Warning: Tab character

src/MFlow.hs:892:12: Warning: Tab character

src/MFlow.hs:893:12: Warning: Tab character

src/MFlow.hs:894:12: Warning: Tab character

src/MFlow.hs:895:13: Warning: Tab character

src/MFlow.hs:896:16: Warning: Tab character

src/MFlow.hs:897:12: Warning: Tab character

src/MFlow.hs:898:11: Warning: Tab character

src/MFlow.hs:899:12: Warning: Tab character

src/MFlow.hs:900:12: Warning: Tab character

src/MFlow.hs:901:12: Warning: Tab character

src/MFlow.hs:902:14: Warning: Tab character

src/MFlow.hs:903:12: Warning: Tab character

src/MFlow.hs:904:13: Warning: Tab character

src/MFlow.hs:905:12: Warning: Tab character

src/MFlow.hs:906:12: Warning: Tab character

src/MFlow.hs:907:12: Warning: Tab character

src/MFlow.hs:908:12: Warning: Tab character

src/MFlow.hs:909:12: Warning: Tab character

src/MFlow.hs:910:12: Warning: Tab character

src/MFlow.hs:911:12: Warning: Tab character

src/MFlow.hs:912:12: Warning: Tab character

src/MFlow.hs:913:12: Warning: Tab character

src/MFlow.hs:914:12: Warning: Tab character

src/MFlow.hs:915:12: Warning: Tab character

src/MFlow.hs:916:12: Warning: Tab character

src/MFlow.hs:917:12: Warning: Tab character

src/MFlow.hs:918:12: Warning: Tab character

src/MFlow.hs:919:12: Warning: Tab character

src/MFlow.hs:920:12: Warning: Tab character

src/MFlow.hs:921:12: Warning: Tab character

src/MFlow.hs:922:12: Warning: Tab character

src/MFlow.hs:923:12: Warning: Tab character

src/MFlow.hs:924:12: Warning: Tab character

src/MFlow.hs:925:10: Warning: Tab character
Haddock coverage:
   0% (  0 / 11) in 'MFlow.Cookies'
  Missing documentation for:
    Module header
    CookieT (src/MFlow/Cookies.hs:36)
    Cookie (src/MFlow/Cookies.hs:38)
    contentHtml (src/MFlow/Cookies.hs:33)
    cookieuser (src/MFlow/Cookies.hs:44)
    cookieHeaders (src/MFlow/Cookies.hs:52)
    getCookies (src/MFlow/Cookies.hs:47)
    paranoidEncryptCookie (src/MFlow/Cookies.hs:120)
    paranoidDecryptCookie (src/MFlow/Cookies.hs:136)
    encryptCookie (src/MFlow/Cookies.hs:149)
    decryptCookie (src/MFlow/Cookies.hs:114)
  50% ( 30 / 60) in 'MFlow'
  Missing documentation for:
    Flow (src/MFlow.hs:181)
    Params (src/MFlow.hs:196)
    HttpData (src/MFlow.hs:183)
    Processable (src/MFlow.hs:198)
    flushRec (src/MFlow.hs:271)
    flushResponse (src/MFlow.hs:268)
    receive (src/MFlow.hs:265)
    receiveReq (src/MFlow.hs:273)
    receiveReqTimeout (src/MFlow.hs:285)
    sendFlush (src/MFlow.hs:254)
    sendEndFragment (src/MFlow.hs:261)
    sendToMF (src/MFlow.hs:341)
    delMessageFlow (src/MFlow.hs:338)
    noScript (src/MFlow.hs:235)
    getNotFoundResponse (src/MFlow.hs:641)
    Attribs (src/MFlow.hs:646)
    addAttrs (src/MFlow.hs:667)
    getAdminName (src/MFlow.hs:606)
    Auth (src/MFlow.hs:459)
    getAuthMethod (src/MFlow.hs:469)
    config (src/MFlow.hs:557)
    addTokenToList (src/MFlow.hs:157)
    deleteTokenInList (src/MFlow.hs:161)
    serveFile (src/MFlow.hs:686)
    mimeTable (src/MFlow.hs:730)
    newFlow (src/MFlow.hs:722)
    UserStr (src/MFlow.hs:593)
    PasswdStr (src/MFlow.hs:594)
    User (src/MFlow.hs:472)
    eUser (src/MFlow.hs:478)
  30% ( 41 /136) in 'MFlow.Forms.Internals'
  Missing documentation for:
    !> (src/MFlow/Forms/Internals.hs:66)
    FailBack (src/MFlow/Forms/Internals.hs:70)
     (src/MFlow/Forms/Internals.hs:72)
     (src/MFlow/Forms/Internals.hs:77)
     (src/MFlow/Forms/Internals.hs:83)
     (src/MFlow/Forms/Internals.hs:88)
    iCanFailBack (src/MFlow/Forms/Internals.hs:99)
    repeatPlease (src/MFlow/Forms/Internals.hs:100)
    noFailBack (src/MFlow/Forms/Internals.hs:101)
    Sup (src/MFlow/Forms/Internals.hs:103)
    Supervise (src/MFlow/Forms/Internals.hs:105)
     (src/MFlow/Forms/Internals.hs:114)
    fromFailBack (src/MFlow/Forms/Internals.hs:132)
    toFailBack (src/MFlow/Forms/Internals.hs:134)
     (src/MFlow/Forms/Internals.hs:136)
     (src/MFlow/Forms/Internals.hs:143)
     (src/MFlow/Forms/Internals.hs:172)
     (src/MFlow/Forms/Internals.hs:175)
    liftSup (src/MFlow/Forms/Internals.hs:184)
     (src/MFlow/Forms/Internals.hs:185)
     (src/MFlow/Forms/Internals.hs:189)
    WState (src/MFlow/Forms/Internals.hs:193)
    FlowMM (src/MFlow/Forms/Internals.hs:194)
    FormElm (src/MFlow/Forms/Internals.hs:196)
     (src/MFlow/Forms/Internals.hs:198)
     (src/MFlow/Forms/Internals.hs:244)
     (src/MFlow/Forms/Internals.hs:258)
     (src/MFlow/Forms/Internals.hs:294)
     (src/MFlow/Forms/Internals.hs:320)
     (src/MFlow/Forms/Internals.hs:323)
     (src/MFlow/Forms/Internals.hs:327)
     (src/MFlow/Forms/Internals.hs:334)
     (src/MFlow/Forms/Internals.hs:355)
     (src/MFlow/Forms/Internals.hs:379)
     (src/MFlow/Forms/Internals.hs:407)
     (src/MFlow/Forms/Internals.hs:410)
     (src/MFlow/Forms/Internals.hs:413)
     (src/MFlow/Forms/Internals.hs:422)
    valid (src/MFlow/Forms/Internals.hs:494)
    Lang (src/MFlow/Forms/Internals.hs:626)
    NeedForm (src/MFlow/Forms/Internals.hs:635)
    MFlowState (src/MFlow/Forms/Internals.hs:637)
    Void (src/MFlow/Forms/Internals.hs:675)
    mFlowState0 (src/MFlow/Forms/Internals.hs:677)
    delSessionData (src/MFlow/Forms/Internals.hs:702)
    getToken (src/MFlow/Forms/Internals.hs:730)
    getEnv (src/MFlow/Forms/Internals.hs:735)
    stdHeader (src/MFlow/Forms/Internals.hs:738)
    setParanoidCookie (src/MFlow/Forms/Internals.hs:811)
    setEncryptedCookie (src/MFlow/Forms/Internals.hs:819)
    setEncryptedCookie' (src/MFlow/Forms/Internals.hs:827)
    getWFName (src/MFlow/Forms/Internals.hs:863)
    getCurrentUser (src/MFlow/Forms/Internals.hs:868)
    Name (src/MFlow/Forms/Internals.hs:873)
    Type (src/MFlow/Forms/Internals.hs:874)
    Value (src/MFlow/Forms/Internals.hs:875)
    Checked (src/MFlow/Forms/Internals.hs:876)
    OnClick (src/MFlow/Forms/Internals.hs:877)
    normalize (src/MFlow/Forms/Internals.hs:879)
    inRecovery (src/MFlow/Forms/Internals.hs:1028)
    runFlowOnce (src/MFlow/Forms/Internals.hs:1030)
    runFlowOnce1 (src/MFlow/Forms/Internals.hs:1034)
    startState (src/MFlow/Forms/Internals.hs:1036)
    runFlowOnce2 (src/MFlow/Forms/Internals.hs:1042)
    runFlowOnceReturn (src/MFlow/Forms/Internals.hs:1065)
     (src/MFlow/Forms/Internals.hs:1121)
    ParamResult (src/MFlow/Forms/Internals.hs:1231)
    valToMaybe (src/MFlow/Forms/Internals.hs:1233)
    isValidated (src/MFlow/Forms/Internals.hs:1236)
    fromValidated (src/MFlow/Forms/Internals.hs:1239)
    getParam1 (src/MFlow/Forms/Internals.hs:1245)
    getRestParam (src/MFlow/Forms/Internals.hs:1253)
    readParam (src/MFlow/Forms/Internals.hs:1282)
    unfold (src/MFlow/Forms/Internals.hs:1321)
    Requirement (src/MFlow/Forms/Internals.hs:1324)
    Requirements (src/MFlow/Forms/Internals.hs:1326)
     (src/MFlow/Forms/Internals.hs:1329)
    installAllRequirements (src/MFlow/Forms/Internals.hs:1332)
    loadjsfile (src/MFlow/Forms/Internals.hs:1359)
    loadScript (src/MFlow/Forms/Internals.hs:1363)
    loadCallback (src/MFlow/Forms/Internals.hs:1386)
    loadcssfile (src/MFlow/Forms/Internals.hs:1393)
    loadcss (src/MFlow/Forms/Internals.hs:1401)
    WebRequirement (src/MFlow/Forms/Internals.hs:1409)
     (src/MFlow/Forms/Internals.hs:1418)
     (src/MFlow/Forms/Internals.hs:1421)
     (src/MFlow/Forms/Internals.hs:1423)
     (src/MFlow/Forms/Internals.hs:1426)
    installWebRequirements (src/MFlow/Forms/Internals.hs:1431)
    strRequirement (src/MFlow/Forms/Internals.hs:1443)
    strRequirement' (src/MFlow/Forms/Internals.hs:1448)
    ajaxScript (src/MFlow/Forms/Internals.hs:1483)
    formPrefix (src/MFlow/Forms/Internals.hs:1514)
    controlForms (src/MFlow/Forms/Internals.hs:1548)
    currentPath (src/MFlow/Forms/Internals.hs:1560)
 100% ( 15 / 15) in 'MFlow.Forms.Cache'
  81% (124 /154) in 'MFlow.Forms'
  Missing documentation for:
    FormElm (src/MFlow/Forms/Internals.hs:196)
    Auth (src/MFlow.hs:459)
    getAdminName (src/MFlow.hs:606)
    getCurrentUser (src/MFlow/Forms/Internals.hs:868)
    logout (src/MFlow/Forms.hs:943)
    paranoidLogout (src/MFlow/Forms.hs:945)
    encryptedLogout (src/MFlow/Forms.hs:947)
    paranoidLogin (src/MFlow/Forms.hs:921)
    encryptedLogin (src/MFlow/Forms.hs:923)
    userName (src/MFlow.hs:473)
    ask (src/MFlow/Forms.hs:1027)
    getTextBox (src/MFlow/Forms.hs:542)
    wlabel (src/MFlow/Forms.hs:1269)
    getCheckBoxes (src/MFlow/Forms.hs:521)
    submitButton (src/MFlow/Forms.hs:1204)
    resetButton (src/MFlow/Forms.hs:1200)
    whidden (src/MFlow/Forms.hs:511)
    getRestParam (src/MFlow/Forms/Internals.hs:1253)
    notValid (src/MFlow/Forms.hs:830)
    >:> (src/MFlow/Forms.hs:1420)
    normalize (src/MFlow/Forms/Internals.hs:879)
    runFlowOnce (src/MFlow/Forms/Internals.hs:1030)
    delSessionData (src/MFlow/Forms/Internals.hs:702)
    setParanoidCookie (src/MFlow/Forms/Internals.hs:811)
    setEncryptedCookie (src/MFlow/Forms/Internals.hs:819)
    Requirements (src/MFlow/Forms/Internals.hs:1326)
    WebRequirement (src/MFlow/Forms/Internals.hs:1409)
    FailBack (src/MFlow/Forms/Internals.hs:70)
    fromFailBack (src/MFlow/Forms/Internals.hs:132)
    toFailBack (src/MFlow/Forms/Internals.hs:134)
  67% (  2 /  3) in 'MFlow.Forms.Blaze.Html'
  Missing documentation for:
     (src/MFlow/Forms/Blaze/Html.hs:39)
  75% (  3 /  4) in 'MFlow.Forms.Admin'
  Missing documentation for:
    Module header
  83% (  5 /  6) in 'MFlow.Forms.WebApi'
  Missing documentation for:
    Module header
  89% ( 40 / 45) in 'MFlow.Forms.Widgets'
  Missing documentation for:
    UpdateMethod (src/MFlow/Forms/Widgets.hs:1111)
    setEdited (src/MFlow/Forms/Widgets.hs:214)
    tfieldKey (src/MFlow/Forms/Widgets.
src/MFlow/Wai.hs:129:32:
    parse error in let binding: missing required 'in'
hs:479)
    readtField (src/MFlow/Forms/Widgets.hs:498)
    writetField (src/MFlow/Forms/Widgets.hs:495)
   0% (  0 / 11) in 'MFlow.Wai.Response'
  Missing documentation for:
    Module header
    ToResponse (src/MFlow/Wai/Response.hs:24)
    TResp (src/MFlow/Wai/Response.hs:29)
     (src/MFlow/Wai/Response.hs:31)
    mkParams (src/MFlow/Wai/Response.hs:39)
    mkparam (src/MFlow/Wai/Response.hs:40)
     (src/MFlow/Wai/Response.hs:42)
     (src/MFlow/Wai/Response.hs:46)
     (src/MFlow/Wai/Response.hs:49)
     (src/MFlow/Wai/Response.hs:52)
     (src/MFlow/Wai/Response.hs:55)

Monad Formlet & Factoring Out Button

Description: After the 1st number is entered in the First field, the Second field is populated with "submit". As seen in picture below. The code sample is below too. Note that changing "(Just n1)" to "Nothing" does not change the behavior.
image

Line: n2 <- "Second " ++> getInt (Just n1) <++ br

Version

  • GHC 7.10.2
  • MFlow-0.4.5.11

Code

{-# LANGUAGE OverloadedStrings #-}
module Main
where
import MFlow.Wai.Blaze.Html.All hiding(main)

main = runNavigation "" . step . page . pageFlow "s" $ 
  do  n1 <- "First "  ++> getInt Nothing   <++ br
      n2 <- "Second " ++> getInt (Just n1) <++ br
      p  << (n1 + n2) ++> noWidget

  <** br ++> submitButton "submit"

Undeclared dependency on cpphs

MFlow needs cpphs to compile, but that dependency is not declared in the Cabal file. This causes build failures on NixOS and probably on other distributions, too.

AJAX - multiple buttons/choices

Hello,

Sorry for using issues for questions (what could be better place, anyway?), but I've got troubles finding best way to handle following scenario.

Say I have a record which contains an array, and I want to have form in which I can add the elements to the array, but also any time I can just hit some 'Create' button and finish the formlet.

Snippet:

{-# LANGUAGE DeriveDataTypeable, OverloadedStrings #-}
module Main where

import MFlow.Wai.Blaze.Html.All hiding(head)
import qualified MFlow.Wai.Blaze.Html.All as El

data Foo = MkFoo { name :: String, nums :: [Int] } 
           deriving Show

foo = do
  MkFoo <$> (wlabel "str" $ getString Nothing)
        <*> (wlabel "nums" $ getNums [])
        <++ br

getNums is = do
  b <- getBool True "Add Int" "Done"
       <** submitButton "ok" -- nevermind this, it could be autosubmitting
  case b of
    True -> do
      i <- getInt Nothing
        <** submitButton "add"
      getNums $ i:is
    False -> return is

test = page $ do
  autoRefresh $ do
    f <- foo
    p << (show f) ++> wlink () ""

main :: IO ()
main = do
  runNavigation "" $ transientNav test

Using above code I can add the numbers, but every time I need to make a choice - whether I want to add more, or I want to finish (using ugly Yes/No select, but that's not the point).

Ideally, I would just want getNums widget to loop infinitely, but also some Create button available at foo so that I can just use it to obtain foo value.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.