hfusion 0.0.2 → 0.0.3
raw patch · 4 files changed
+7/−15 lines, 4 files
Files
- HFusion/HFusion.hs +2/−2
- HFusion/Internal/HyloRep.lhs +1/−9
- HFusion/Internal/Inline.lhs +2/−2
- hfusion.cabal +2/−2
HFusion/HFusion.hs view
@@ -48,8 +48,8 @@ import HFusion.Internal.HyloFace import HFusion.Internal.Utils import Control.Monad.Trans(lift)+import Control.Monad(liftM2) import Control.Arrow(first,(&&&))-import Control.Applicative(liftA2) -- | Transforms a composition of two recursive functions into an equivalent -- recursive function.@@ -71,7 +71,7 @@ -- the result of fusion. fuse' :: String -> Int -> String -> [String] -> [HyloT] -> FusionState ([Def],String) fuse' nombre1 inArg nombre2 resultNames hylos = - env2FusionState fuseHylos >>= uncurry (liftA2 (,)) . (lift . inline &&& lift . showHT)+ env2FusionState fuseHylos >>= lift . uncurry (liftM2 (,)) . (inline &&& showHT) >>= return . first (map polishDef) where fuseHylos :: Env HyloT fuseHylos = do mapM_ insertFuseEnv hylos
HFusion/Internal/HyloRep.lhs view
@@ -1,13 +1,5 @@ -- Please, see the file LICENSE for copyright and license information. -% ------------------------------------------------------------------------------% $Id: HyloRep.lhs,v 1.63 2005/07/20 14:23:23 fdomin Exp $-%-% Aqui se encuentra la implementacion del la interfase HyloFace.-% Por los detalles de la especificacion ver HyloFace.lhs.-% ------------------------------------------------------------------------------- >module HFusion.Internal.HyloRep( > module HFusion.Internal.HyloFace > ,module HFusion.Internal.HsSyn,Hylo(..)) where@@ -60,7 +52,7 @@ Hylo ((a,eta,ca),(bvs,v)) bvs son todas las variables que el hilomorfismo recibe menos la- última que es bv.+ ultima que es bv. v es el nombre del hilomorfismo. a es el algebra eta es la transformacion natural
HFusion/Internal/Inline.lhs view
@@ -18,7 +18,7 @@ > import HFusion.Internal.HsSyn > import HFusion.Internal.Utils > import Data.Char(isAlpha,isLower,isDigit)-> import Control.Monad.State(get,put,State,StateT(StateT),runState,evalState)+> import Control.Monad.State(get,put,State,StateT,runState,evalState) > import Control.Monad.Reader(Reader,runReader,ask,local) > import Control.Monad.Identity(Identity(..)) > import qualified Data.Map as M(lookup)@@ -746,7 +746,7 @@ > inF2Term:: InF -> [Term] -> [(Variable,Term)] -> State [(Constructor,Int)] Term > inF2Term (InF (c,_)) ts _ = do i<-geti c; return$ Ttuple False [Tlit $ Lint $ c++show i,Ttuple False ts] > geti :: Constructor->State [(Constructor,Int)] Int-> geti c = StateT (\st->Identity$ maybe (1,(c,1):st) (\i->(i+1,upd c st)) $ lookup c st)+> geti c = get >>= \st-> maybe (put ((c,1):st) >> return 1) (\i->put (upd c st) >> return (i+1)) $ lookup c st > upd c ((c',i):cs) = (c,i+1):cs > upd c [] = [(c,1)]
hfusion.cabal view
@@ -1,5 +1,5 @@ name: hfusion-version: 0.0.2+version: 0.0.3 build-type: Simple cabal-version: >= 1.6 license: BSD3@@ -45,5 +45,5 @@ source-repository this type: darcs location: http://www.fing.edu.uy/inco/proyectos/fusion/darcs/hfusion/- tag: 0.0.2+ tag: 0.0.3