[Haskell-cafe] manage effects in a DSL
Jacques Carette
carette at mcmaster.ca
Tue Jan 28 12:29:51 UTC 2014
The simplest way would be to add a phantom type parameter to Exp, i.e.
data Exp e a where
The 'e' variable would be used to track (and propagate) effects. It is
then up to you to design your 'effect system' as you wish.
Jacques
On 2014-01-28 6:03 AM, Corentin Dupont wrote:
> -> In short, my question is: how can I semantically separate
> instructions with effect from the others? i.e. how can I mark down and
> track those effects?
> This is the DSL:
>
> > data Exp a where
> > ReadAccount :: Exp Int
> > WriteAccount :: Exp Int -> Exp ()
> > SetVictory :: Exp Bool -> Exp ()
> > OnTimer :: Exp () -> Exp ()
> > Return :: a -> Exp a
> > Bind :: Exp a -> (a -> Exp b) -> Exp b
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140128/7f624378/attachment.html>
More information about the Haskell-Cafe
mailing list