agocorona / MFlow

(Haskell) Web application server with stateful, type safe user interactions and widget combinators
http://mflowdemo.herokuapp.com
Other
100 stars 12 forks source link

Correct order for updateParams #53

Closed BartAdv closed 10 years ago

BartAdv commented 10 years ago

The fix introduced by cf610f5 broke the validation/submission - after submitting invalid value, it was not possible to update it, as the old value was taking a precedence.

I do not know if it is optimal fix, but it does the trick.

BartAdv commented 10 years ago

Ah sorry, this breaks what was previously fixed again...

agocorona commented 10 years ago

Bartosz: That is a failure from my side.

It is necesary to use span instead of break: Almos surely that solves the problem

updateParams ∷ Bool → Params → Params → Params

 updateParams False _ req= req

 updateParams True env req=
    let old= takeWhile isparam  env
        (new,rest)= Data.List.*span *isparam  req
        parms= new⊕ old⊕ rest

2014-08-05 14:56 GMT+02:00 Bartosz notifications@github.com:

Ah sorry, this breaks what was previously fixed again...

— Reply to this email directly or view it on GitHub https://github.com/agocorona/MFlow/pull/53#issuecomment-51193176.

Alberto.

agocorona commented 10 years ago

Can you check it and send me a new pull request?.

2014-08-05 15:01 GMT+02:00 Alberto G. Corona agocorona@gmail.com:

Bartosz: That is a failure from my side.

It is necesary to use span instead of break: Almos surely that solves the problem

updateParams ∷ Bool → Params → Params → Params

 updateParams False _ req= req

 updateParams True env req=
    let old= takeWhile isparam  env
        (new,rest)= Data.List.*span *isparam  req
        parms= new⊕ old⊕ rest

2014-08-05 14:56 GMT+02:00 Bartosz notifications@github.com:

Ah sorry, this breaks what was previously fixed again...

— Reply to this email directly or view it on GitHub https://github.com/agocorona/MFlow/pull/53#issuecomment-51193176.

Alberto.

Alberto.

BartAdv commented 10 years ago

Yes, you were right:)

Added fixing commit to this PR (unless you want it squashed?)

agocorona commented 10 years ago

Send me the pull request. I can not fix it now.

2014-08-05 15:19 GMT+02:00 Bartosz notifications@github.com:

Yes, you were right:)

Added fixing commit to this PR (unless you want it squashed?)

— Reply to this email directly or view it on GitHub https://github.com/agocorona/MFlow/pull/53#issuecomment-51195675.

Alberto.

BartAdv commented 10 years ago

Well, it's in this pull request - just as another commit.