From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MXiOJ-0002z0-9t for qemu-devel@nongnu.org; Sun, 02 Aug 2009 17:14:51 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MXiOE-0002u7-5I for qemu-devel@nongnu.org; Sun, 02 Aug 2009 17:14:50 -0400 Received: from [199.232.76.173] (port=54238 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MXiOE-0002u1-0A for qemu-devel@nongnu.org; Sun, 02 Aug 2009 17:14:46 -0400 Received: from mx2.redhat.com ([66.187.237.31]:53317) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MXiOD-0002bf-Kb for qemu-devel@nongnu.org; Sun, 02 Aug 2009 17:14:45 -0400 From: Juan Quintela Date: Sun, 2 Aug 2009 23:11:20 +0200 Message-Id: <1249247483-6329-2-git-send-email-quintela@redhat.com> In-Reply-To: <1249247483-6329-1-git-send-email-quintela@redhat.com> References: <1249247483-6329-1-git-send-email-quintela@redhat.com> Subject: [Qemu-devel] Copyright (c) 2009, Lyle Kopnicky List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com runhaskell Setup.hs configure runhaskell Setup.hs build To run unit tests: runhaskell Setup.hs test To install: runhaskell Setup.hs install You can then run the resulting program as vintbas [<.bas source file> ...] The monad transformer I created is CPST. Monad transformers are basically monad building-blocks. You start with the identity monad and stack monad transformers on top of it to build a combined monad. The ordering is very important. There are monad transformers in the Control.Monad.Trans library, so I used them. Unfortunately you can't stack any more monad transformers on top of CPST. It has to be on top, because of the type of the shift morphism. The standard ContT transformer is similar to my CPST, but defines callCC, not shift. Take a look at the type of callCC in my code. Notice every time you see a CPST, it is followed by an o. Notice that every other morphism in CPST has the same property, except shift. That is the key to why it's no longer stackable - monad transformers can take only two type parameters, not three. But I like shift and think it's neat that I can define callCC in terms of it and reset, but not vice-versa. So there. Plus, my shift and callCC are rank-3 polymorphic! Nobody else achieves that flexibility. Other things we could do: * Pre-check types * Pre-check labels, generate code in place of labels * Convert variable references to IORefs Is it easiest to do these with staging? * Consider sending errors to stderr. * On syntax error, consider printing line with marked error.