shivers-cfg 0.1 → 0.1.1
raw patch · 3 files changed
+40/−3 lines, 3 files
Files
- CPSPrint.hs +1/−1
- Common.hs +37/−0
- shivers-cfg.cabal +2/−2
CPSPrint.hs view
@@ -8,7 +8,7 @@ import Data.Char import Control.Arrow ((***)) import Data.Map (unions, singleton)-import Data.Monoid+import Data.Monoid hiding ((<>)) import CPSScheme import Common
+ Common.hs view
@@ -0,0 +1,37 @@+{-|+ Some convenience definitions.+ -}+{-# LANGUAGE TypeOperators #-}+module Common where++import qualified Data.Map as M+import qualified Data.Set as S+import Control.Monad (liftM)++-- * Type aliases++-- | Convenient alias for a partial map+type a :⇀ b = M.Map a b+infixl 8 :⇀++-- | Convenient alias for a product type+type a :× b = (a,b)+infixl 9 :×++-- * Partial map functions++-- | A function used to write map updates resembling the mathematical syntax m [ k ↦ v] as m `upd` [k ↦ v]+upd :: (Ord k) => k :⇀a -> [k :× a] -> k :⇀ a+upd map list = M.union (M.fromList list) map++-- | A functorial variant of 'upd'+upd' :: (Ord k, Functor f) => f (k :⇀ a) -> [k :× a] -> f (k :⇀ a)+upd' map list = fmap (`upd` list) map++-- | For use in the argument list of 'upd'+(↦) :: k -> v -> k :× v+k ↦ v = (k,v)++-- | A monadically lifted unions+unionsM :: (Monad m, Ord k) => [m (k :⇀ a)] -> m (k :⇀ a)+unionsM = liftM M.unions . sequence
shivers-cfg.cabal view
@@ -1,5 +1,5 @@ Name: shivers-cfg-Version: 0.1+Version: 0.1.1 Synopsis: Implementation of Shivers' Control-Flow Analysis Description: In his 1991 dissertation, Olin Shivers introduces a concept@@ -25,4 +25,4 @@ Library Build-depends: containers, base >=4 && <5, mtl, process, directory, pretty, HPDF, language-dot- Exposed-modules: Eval, CPSScheme, ExCF, AbsCF, CPSPrint, CFGraph+ Exposed-modules: Eval, CPSScheme, ExCF, AbsCF, CPSPrint, CFGraph, Common