Michael,
I think what you're trying to do is perfectly doable in Haskell and I think
the right tool for it is arrows, as Tomasz Zielonka mentioned before. I
suggest you take a look at the following paper which uses arrows to enforce
security levels in the code:
http://www.cis.upenn.edu/~stevez/pa
I wrote:
> If you want to stick to monads, there is another possibility: carry around
> the necessary checks *at the type level*. Below is a sketch of how you
> could do this.
Importantly, the given code still requires you to specify the checks "by
hand", when running the action; it only checks t
As others have explained, you can't analyse your do-constructs, because
functions are opaque -- at the value level.
The canonical option would indeed seem to be to use arrows (or applicative
functors), instead of monads.
--
If you want to stick to monads, there is another possibility: carry
On Monday 25 June 2007, Michael T. Richter wrote:
> On Mon, 2007-25-06 at 01:05 -0500, Jon Cast wrote:
> > What exactly are you trying to do?
>
> I'm trying to model a transactional system which could fail
> mid-transaction without an easy rollback on conditions which could be
> checked in advance.
Hello Michael,
Monday, June 25, 2007, 2:10:28 PM, you wrote:
> Does this make more sense now? And can it be done somehow in Haskell?
runCheckedCode = checkBeforeRun [actionA x y, actionB z t, actionC]
actionA x y b | b = -- check conditions
| otherwise = -- perform action
On Mon, 2007-25-06 at 12:19 +0300, Benja Fallenstein wrote:
> 2007/6/25, Michael T. Richter <[EMAIL PROTECTED]>:
>
> OK, just to prevent this getting side-tracked: I'm absolutely
> uninterested in the results of performActionA before
> determining if performActionB is perm
Now I've got a situation I can't figure out how to resolve. I want to
have a set of actions which are executed sequentially, but which, before
I even start to execute the first one, have been inspected for legality
and/or plausibility. Consider this kind of sequence:
do
x <- performActionA
y
On Mon, 25 Jun 2007, Michael T. Richter wrote:
> OK, just to prevent this getting side-tracked: I'm absolutely
> uninterested in the results of performActionA before determining if
> performActionB is permitted/possible/whatever. Think more in terms of
> security permissions or resource availabi
Micheal, I think you mean
do
x <- if .. then ..
else ..
y <- if ... then..
else...
etc etc
On 6/25/07, Michael T. Richter <[EMAIL PROTECTED]> wrote:
Now I've got a situation I can't figure out how to resolve. I want to
have a set of actions which are executed sequentially,
On Mon, Jun 25, 2007 at 10:58:16AM +0200, Henning Thielemann wrote:
>
> On Mon, 25 Jun 2007, Tomasz Zielonka wrote:
>
> > On Mon, Jun 25, 2007 at 10:29:14AM +0200, Henning Thielemann wrote:
> > > Imagine all performActions contain their checks somehow. Let
> > > performActionB take an argument.
>
2007/6/25, Michael T. Richter <[EMAIL PROTECTED]>:
OK, just to prevent this getting side-tracked: I'm absolutely
uninterested in the results of performActionA before determining if
performActionB is permitted/possible/whatever. Think more in terms of
security permissions or resource availabili
nt: Monday, June 25, 2007 10:43 AM
To: Henning Thielemann
Cc: haskell-cafe@haskell.org
Subject: Re: [Haskell-cafe] Practical Haskell question.
On Mon, Jun 25, 2007 at 10:29:14AM +0200, Henning Thielemann wrote:
Imagine all performActions contain their checks somehow. Let
performActionB take a
Hi Michael,
On 25 Jun 2007, at 06:39, Michael T. Richter wrote:
do
x <- performActionA
y <- performActionB
z <- performActionC
return $ calculateStuff x y z
I don't know about you're exact example, but here's what I'd do.
Control.Monad has functions like when, unless, and guard that
On Mon, 25 Jun 2007, Tomasz Zielonka wrote:
> On Mon, Jun 25, 2007 at 10:29:14AM +0200, Henning Thielemann wrote:
> > Imagine all performActions contain their checks somehow. Let
> > performActionB take an argument.
> >
> > > do
> > >x <- performActionA
> > >y <- performActionB x
> > >
> Sent: Monday, June 25, 2007 10:43 AM
> To: Henning Thielemann
> Cc: haskell-cafe@haskell.org
> Subject: Re: [Haskell-cafe] Practical Haskell question.
>
> On Mon, Jun 25, 2007 at 10:29:14AM +0200, Henning Thielemann wrote:
> > Imagine all performActions contain their checks s
Hi Peter,
2007/6/25, peterv <[EMAIL PROTECTED]>:
I'm baffled. So using the Arrow abstraction (which I don't know yet) would
solve this problem? How can (perfectActionB x) be checked with without ever
executing performActionA which evaluates to x? This can only be done when x
is a constant expres
om: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Tomasz Zielonka
Sent: Monday, June 25, 2007 10:43 AM
To: Henning Thielemann
Cc: haskell-cafe@haskell.org
Subject: Re: [Haskell-cafe] Practical Haskell question.
On Mon, Jun 25, 2007 at 10:29:14AM +0200, Henning Thielemann wrote:
>
On Mon, Jun 25, 2007 at 10:29:14AM +0200, Henning Thielemann wrote:
> Imagine all performActions contain their checks somehow. Let
> performActionB take an argument.
>
> > do
> >x <- performActionA
> >y <- performActionB x
> >z <- performActionC
> >return $ calculateStuff x y z
>
On Mon, 25 Jun 2007, Daniil Elovkov wrote:
> 2007/6/25, Michael T. Richter <[EMAIL PROTECTED]>:
> >
> > Now I've got a situation I can't figure out how to resolve. I want to
> > have a set of actions which are executed sequentially, but which, before I
> > even start to execute the first one,
2007/6/25, Michael T. Richter <[EMAIL PROTECTED]>:
Now I've got a situation I can't figure out how to resolve. I want to have a
set of actions which are executed sequentially, but which, before I even start
to execute the first one, have been inspected for legality and/or plausibility.
Con
Now I've got a situation I can't figure out how to resolve. I want to
have a set of actions which are executed sequentially, but which, before
I even start to execute the first one, have been inspected for legality
and/or plausibility. Consider this kind of sequence:
do
x <- performActionA
y
21 matches
Mail list logo