[Haskell-cafe] Identity of indiscernibles

Kim-Ee Yeoh ky3 at atamo.com
Thu Aug 8 19:38:45 CEST 2013


On Thu, Aug 8, 2013 at 11:05 PM, Tom Ellis <
tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk> wrote:

> On Thu, Aug 08, 2013 at 03:38:41PM +0200, Jerzy Karczmarczuk wrote:
> > >One could simply implement IO as a free monad
> > Interesting. I wonder how.
>
> See [1] for an explanation of free monads in general.  For IO in
> particular,
> define a functor
>
>     data IOF a = GetChar (Char -> a) | PutChar Char a | ...
>
> with constructors for all elementary IO operations.


If I understand correctly, you're proposing equality of (IO a) based on the
AST of imperatives, similar to what comes out of GCC's front-end for C [1].

In what way is this syntactical equality "reasonable"? Useful perhaps for
detecting C&P coding from befuddled undergrads?

[1]
http://digitocero.com/es/blog/exportar-y-visualizar-el-arbol-sintactico-abstractoast-de-gcc

-- Kim-Ee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130809/a41efd04/attachment.htm>


More information about the Haskell-Cafe mailing list