Send Beginners mailing list submissions to
        beginners@haskell.org

To subscribe or unsubscribe via the World Wide Web, visit
        http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
        beginners-requ...@haskell.org

You can reach the person managing the list at
        beginners-ow...@haskell.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1.  Relation between Effects, Indexed monads,        Free monads (PY)


----------------------------------------------------------------------

Message: 1
Date: Wed, 15 Nov 2017 14:15:13 +0200
From: PY <aqua...@gmail.com>
To: beginners@haskell.org
Subject: [Haskell-beginners] Relation between Effects, Indexed monads,
        Free monads
Message-ID: <f34c805e-bad4-845e-d09b-43d9a9bae...@gmail.com>
Content-Type: text/plain; charset=utf-8; format=flowed

Hello, All!

I'm not sure is it question for Cafe or Beginners List, so first I'll 
try here.

There are kind of errors related to wrong execution sequence. They are 
good known in OOP: object keeps state internally and check it before to 
execute got message - to prevent wrong execution sequence. Best 
implementation is: state machine, also can be used Markov's algorithm, 
more complex can be done with Petri nets, etc.

Example: if I have complex inserting into DB (consisting of several 
inserts), I can check done of previous step before to start next, etc. 
After read of different Haskell resources I found solution for it: 
Indexed Monads. They (if I got it rightly) are monads with additional 
type parameter which "marks" monad, gives it more specific 
qualification, for example instead of monad "Opening" (action) we have 
monad "Opening-of-closed", exactly what I'm talking: type-level check of 
correct actions sequence (allowed transition).

After more research I found Free Monads and Effects and something like  
"free monad can be used to proof your program". How?! Free monads  make 
"active" (executable) code into "passive" code (data instead of code), 
which can be interpreted separately, so program becomes like Lisp 
program: code is a data (so, can be modified, checked, etc, etc) and 
what exactly will be executing - decides interpreter of such code. But 
do they allow to proof right sequence of actions in such data-like code?

What are the Effects I don't understand yet.

Somewhere I find something like: Eff = Free Monad + indexed monad (may 
be I'm not right here). So  my questions are:

- how Effects, Free Monad, Indexed Monads are related?

- can effects replace indexed monads?

- are indexed monad yet usable/modern concept or they are abandoned and 
replaced by Effects or something else? Do you use indexed monads in real 
projects?

- can I (and how) to use both of them? Or: can I use only FreeMonads / 
Effects to solve the same problem (control of correct sequence of 
actions) like with indexed monads help?


===

Best regards, Paul



------------------------------

Subject: Digest Footer

_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners


------------------------------

End of Beginners Digest, Vol 113, Issue 10
******************************************

Reply via email to