diff --git a/DDC/Build/Builder.hs b/DDC/Build/Builder.hs
--- a/DDC/Build/Builder.hs
+++ b/DDC/Build/Builder.hs
@@ -10,7 +10,7 @@
         , determineDefaultBuilderHost)
 where
 import DDC.Build.Platform
-import DDC.Base.Pretty                          hiding ((</>))
+import DDC.Data.Pretty                          hiding ((</>))
 import Data.List
 import System.FilePath                         
 import System.Exit                              hiding (die)
diff --git a/DDC/Build/Interface/Load.hs b/DDC/Build/Interface/Load.hs
--- a/DDC/Build/Interface/Load.hs
+++ b/DDC/Build/Interface/Load.hs
@@ -8,7 +8,7 @@
 import DDC.Build.Interface.Base
 import DDC.Core.Check                           (AnTEC)
 import DDC.Core.Module
-import DDC.Base.Pretty
+import DDC.Data.Pretty
 import DDC.Core.Transform.Reannotate
 import Data.Time.Clock
 import Control.Monad
diff --git a/DDC/Build/Interface/Store.hs b/DDC/Build/Interface/Store.hs
--- a/DDC/Build/Interface/Store.hs
+++ b/DDC/Build/Interface/Store.hs
@@ -11,7 +11,7 @@
         , Super (..)
         , findSuper)
 where
-import DDC.Base.Pretty
+import DDC.Data.Pretty
 import DDC.Build.Interface.Base         
 import DDC.Build.Interface.Load
 import DDC.Core.Call
@@ -86,7 +86,7 @@
           -- | Import source for the super.
           --
           --   This can be used to refer to the super from a client module.
-        , superImportValue      :: ImportValue E.Name }
+        , superImportValue      :: ImportValue E.Name (Type E.Name) }
 
 
 ---------------------------------------------------------------------------------------------------
diff --git a/DDC/Build/Language/Base.hs b/DDC/Build/Language/Base.hs
--- a/DDC/Build/Language/Base.hs
+++ b/DDC/Build/Language/Base.hs
@@ -9,13 +9,13 @@
 import DDC.Core.Simplifier
 import DDC.Core.Transform.Namify
 import DDC.Core.Transform.Rewrite
-import DDC.Base.Pretty
-import DDC.Base.Name
+import DDC.Data.Pretty
+import DDC.Data.Name
 import Control.DeepSeq
 import Data.Typeable
 import Data.Map                         (Map)
 import DDC.Type.Env                     (Env)
-import qualified DDC.Base.Parser        as BP
+import qualified DDC.Control.Parser     as BP
 
 
 -- | Existential container for a language fragment, and the dictionaries
diff --git a/DDC/Build/Language/Flow.hs b/DDC/Build/Language/Flow.hs
--- a/DDC/Build/Language/Flow.hs
+++ b/DDC/Build/Language/Flow.hs
@@ -14,7 +14,7 @@
 import DDC.Core.Fragment                hiding (Error(..))
 import DDC.Core.Flow                    as Flow
 import DDC.Core.Flow.Profile            as Flow
-import DDC.Base.Pretty
+import DDC.Data.Pretty
 import qualified Data.Map               as Map
 
 
diff --git a/DDC/Build/Language/Zero.hs b/DDC/Build/Language/Zero.hs
--- a/DDC/Build/Language/Zero.hs
+++ b/DDC/Build/Language/Zero.hs
@@ -12,9 +12,8 @@
 import DDC.Build.Language.Base
 import DDC.Core.Fragment                hiding (Error)
 import DDC.Core.Transform.Namify
-import DDC.Base.Pretty
-import DDC.Base.Name
-import DDC.Data.Token
+import DDC.Data.Pretty
+import DDC.Data.Name
 import DDC.Type.Exp
 import Data.Typeable
 import DDC.Type.Env                     (Env)
@@ -94,25 +93,27 @@
 -- | Lex a string to tokens, using primitive names.
 --
 --   The first argument gives the starting source line number.
-lexModuleZero :: String -> Int -> String -> [Token (Tok Name)]
+lexModuleZero :: String -> Int -> String -> [Located (Token Name)]
 lexModuleZero srcName srcLine str
  = map rn $ Core.lexModuleWithOffside srcName srcLine str
- where rn (Token t sp) 
-        = case renameTok (Just . Name) t of
-                Just t' -> Token t' sp
-                Nothing -> Token (KErrorJunk "lexical error") sp
+ where
+        rn (Located sp t) 
+         = case renameToken (Just . Name) t of
+                Just t' -> Located sp t'
+                Nothing -> Located sp (KErrorJunk "lexical error")
 
 
 -- | Lex a string to tokens, using primitive names.
 --
 --   The first argument gives the starting source line number.
-lexExpZero :: String -> Int -> String -> [Token (Tok Name)]
+lexExpZero :: String -> Int -> String -> [Located (Token Name)]
 lexExpZero srcName srcLine str
  = map rn $ Core.lexExp srcName srcLine str
- where rn (Token t sp) 
-        = case renameTok (Just . Name) t of
-                Just t' -> Token t' sp
-                Nothing -> Token (KErrorJunk "lexical error") sp
+ where
+        rn (Located sp t) 
+         = case renameToken (Just . Name) t of
+                Just t' -> Located sp t'
+                Nothing -> Located sp (KErrorJunk "lexical error")
 
 
 -- | Create a new type variable name that is not in the given environment.
diff --git a/DDC/Build/Pipeline/Core.hs b/DDC/Build/Pipeline/Core.hs
--- a/DDC/Build/Pipeline/Core.hs
+++ b/DDC/Build/Pipeline/Core.hs
@@ -15,8 +15,8 @@
 import DDC.Build.Pipeline.Salt
 import DDC.Build.Language
 import DDC.Core.Simplifier
-import DDC.Base.Pretty
-import DDC.Base.Name
+import DDC.Data.Pretty
+import DDC.Data.Name
 import DDC.Data.Canned
 import DDC.Llvm.Pretty                                  ()
 
@@ -141,7 +141,7 @@
 --
 --   Returns empty list on success.
 pipeCore
-        :: (NFData a, Show a, NFData n, Eq n, Ord n, Show n, Pretty n)
+        :: (NFData a, Show a, NFData n, Ord n, Show n, Pretty n)
         => C.Module a n
         -> PipeCore a n
         -> IO [Error]
@@ -231,7 +231,7 @@
                 pipeCores mm' pipes
 
 
-pipeCores :: (NFData a, Show a, NFData n, Eq n, Ord n, Show n, Pretty n)
+pipeCores :: (NFData a, Show a, NFData n, Ord n, Show n, Pretty n)
           => C.Module a n -> [PipeCore a n] -> IO [Error]
 
 pipeCores !mm !pipes 
@@ -255,7 +255,8 @@
         -- Manage currying of functions.
         PipeTetraCurry
          :: (NFData a, Show a)
-         => ![PipeCore () Tetra.Name]
+         => !Sink               -- Sink for unshared code.
+         -> ![PipeCore () Tetra.Name]
          -> PipeTetra  (C.AnTEC a Tetra.Name)
 
         -- Manage boxing of numeric values.
@@ -292,12 +293,15 @@
          -> {-# SCC "PipeTetraOutput" #-}
             pipeSink (renderIndent $ ppr mm)  sink
 
-        PipeTetraCurry  !pipes
+        PipeTetraCurry  !sinkUnshare !pipes
          -> {-# SCC "PipeTetraCurry"  #-}
-            case Tetra.curryModule (C.unshareModule mm) of
-             Left err  -> return [ErrorTetraConvert err]
-             Right mm' -> pipeCores mm' pipes
+            do  let mm_unshared     = C.unshareModule mm
+                pipeSink (renderIndent $ ppr mm_unshared) sinkUnshare
 
+                case Tetra.curryModule mm_unshared of
+                 Left err  -> return [ErrorTetraConvert err]
+                 Right mm' -> pipeCores mm' pipes
+
         PipeTetraBoxing !pipes
          -> {-# SCC "PipeTetraBoxing" #-}
             pipeCores (Tetra.boxingModule mm) pipes
@@ -466,8 +470,9 @@
                       -> let mm_stripped = C.reannotate (const ()) mm'
                              mm_flow     = fst $ Flow.seriesOfVectorModule mm_stripped
                            
+                             config      = C.configOfProfile Flow.profile
                             -- Synthesise the types of any newly created bindings.
-                         in case C.checkModule (C.configOfProfile Flow.profile) mm_flow C.Synth of
+                         in case C.checkModule config mm_flow (C.Synth [])  of
                              (Left err, _ct)         
                               -> return [ErrorCoreTransform err]
                             
@@ -512,7 +517,8 @@
 
 
                 -- Lift up any remaining lambdas
-                mm_lift         = Lambdas.lambdasModule Flow.profile mm_eta
+                mm_lift         = Lambdas.evalState "fl"
+                                $ Lambdas.lambdasModule Flow.profile mm_eta
 
                 -- Snip program so arguments and case scrutinees are just variables
                 mm_snip         = Flatten.flatten 
@@ -552,9 +558,7 @@
 
 
 -- | Process a Flow module with several different pipes.
-pipeFlows :: (NFData a, Show a)
-          => C.Module a Flow.Name -> [PipeFlow a] -> IO [Error]
-
+pipeFlows :: C.Module a Flow.Name -> [PipeFlow a] -> IO [Error]
 pipeFlows !mm !pipes 
  = go [] pipes
  where  go !errs []   
diff --git a/DDC/Build/Pipeline/Error.hs b/DDC/Build/Pipeline/Error.hs
--- a/DDC/Build/Pipeline/Error.hs
+++ b/DDC/Build/Pipeline/Error.hs
@@ -2,7 +2,7 @@
 module DDC.Build.Pipeline.Error
         (Error (..)) 
 where
-import DDC.Base.Pretty
+import DDC.Data.Pretty
 import DDC.Data.SourcePos
 import qualified DDC.Core.Salt          as Salt
 import qualified DDC.Core.Load          as CL
diff --git a/DDC/Build/Pipeline/Llvm.hs b/DDC/Build/Pipeline/Llvm.hs
--- a/DDC/Build/Pipeline/Llvm.hs
+++ b/DDC/Build/Pipeline/Llvm.hs
@@ -5,7 +5,7 @@
 where
 import DDC.Build.Pipeline.Error
 import DDC.Build.Pipeline.Sink
-import DDC.Base.Pretty
+import DDC.Data.Pretty
 import Control.Monad
 import qualified DDC.Build.Builder              as Build
 import qualified DDC.Llvm.Pretty                as Llvm
diff --git a/DDC/Build/Pipeline/Salt.hs b/DDC/Build/Pipeline/Salt.hs
--- a/DDC/Build/Pipeline/Salt.hs
+++ b/DDC/Build/Pipeline/Salt.hs
@@ -7,7 +7,7 @@
 import DDC.Build.Pipeline.Sink
 import DDC.Build.Pipeline.Llvm
 import DDC.Build.Builder
-import DDC.Base.Pretty
+import DDC.Data.Pretty
 import DDC.Llvm.Pretty                          ()
 import DDC.Core.Check                           (AnTEC)
 import qualified DDC.Core.Transform.Reannotate  as C
diff --git a/DDC/Build/Pipeline/Text.hs b/DDC/Build/Pipeline/Text.hs
--- a/DDC/Build/Pipeline/Text.hs
+++ b/DDC/Build/Pipeline/Text.hs
@@ -1,38 +1,41 @@
 {-# LANGUAGE GADTs #-}
 module DDC.Build.Pipeline.Text
-        ( -- InterfaceAA
-          PipeText (..)
+        ( PipeText (..)
         , pipeText)
 where
 import DDC.Build.Pipeline.Error
 import DDC.Build.Pipeline.Sink
 import DDC.Build.Pipeline.Core
 import DDC.Build.Language
-import DDC.Build.Interface.Store                (Store)
-import DDC.Base.Pretty
+import DDC.Build.Interface.Store                        (Store)
+import DDC.Data.Pretty
 
-import qualified DDC.Build.Transform.Resolve       as B
+import qualified DDC.Build.Transform.Resolve            as B
 
-import qualified DDC.Source.Tetra.Convert          as SE
-import qualified DDC.Source.Tetra.Transform.Defix  as SE
-import qualified DDC.Source.Tetra.Transform.Expand as SE
-import qualified DDC.Source.Tetra.Pretty           ()
-import qualified DDC.Source.Tetra.Parser           as SE
-import qualified DDC.Source.Tetra.Lexer            as SE
-import qualified DDC.Source.Tetra.Env              as SE
+import qualified DDC.Source.Tetra.Convert               as SConvert
+import qualified DDC.Source.Tetra.Transform.Freshen     as SFreshen
+import qualified DDC.Source.Tetra.Transform.Defix       as SDefix
+import qualified DDC.Source.Tetra.Transform.Expand      as SExpand
+import qualified DDC.Source.Tetra.Transform.Guards      as SGuards
+import qualified DDC.Source.Tetra.Transform.Matches     as SMatches
+import qualified DDC.Source.Tetra.Transform.Prep        as SPrep
+import qualified DDC.Source.Tetra.Parser                as SParser
+import qualified DDC.Source.Tetra.Lexer                 as SLexer
+import qualified DDC.Source.Tetra.Pretty                ()
 
-import qualified DDC.Build.Language.Tetra          as CE
-import qualified DDC.Core.Tetra                    as CE
-import qualified DDC.Core.Tetra.Env                as CE
+import qualified DDC.Build.Language.Tetra               as CE
+import qualified DDC.Core.Tetra                         as CE
+import qualified DDC.Core.Tetra.Env                     as CE
 
-import qualified DDC.Core.Fragment                 as C
-import qualified DDC.Core.Transform.SpreadX        as C
-import qualified DDC.Core.Check                    as C
-import qualified DDC.Core.Load                     as C
-import qualified DDC.Core.Lexer                    as C
-import qualified DDC.Base.Parser                   as BP
-import qualified DDC.Data.SourcePos                as SP
-import qualified DDC.Data.Token                    as Token
+import qualified DDC.Core.Fragment                      as C
+import qualified DDC.Core.Transform.SpreadX             as C
+import qualified DDC.Core.Check                         as C
+import qualified DDC.Core.Load                          as C
+import qualified DDC.Core.Lexer                         as C
+import qualified DDC.Control.Parser                     as BP
+import qualified DDC.Data.SourcePos                     as SP
+
+import qualified Data.Text                              as Text
 import Control.DeepSeq
 
 
@@ -52,8 +55,14 @@
 
   PipeTextLoadSourceTetra
         :: !Sink        -- Sink for source tokens.
-        -> !Sink        -- Sink for desugared source code.
-        -> !Sink        -- Sink for core tetra code after conversoin.
+        -> !Sink        -- Sink for parsed source code.
+        -> !Sink        -- Sink for freshened code.
+        -> !Sink        -- Sink for defixed source code.
+        -> !Sink        -- Sink for expanded source code.
+        -> !Sink        -- Sink for guard desugared source code.
+        -> !Sink        -- Sink for match desugared source code.
+        -> !Sink        -- Sink for prepped source code.
+        -> !Sink        -- Sink for core tetra code after conversion.
         -> !Sink        -- Sink for core tetra code before type checking.
         -> !Sink        -- Sink for type checker trace.
         -> !Store       -- Interface store.
@@ -72,105 +81,135 @@
         -> PipeText n err
         -> IO [Error]
 
-pipeText !srcName !srcLine !str !pp
- = case pp of
-        PipeTextOutput !sink
-         -> {-# SCC "PipeTextOutput" #-}
-            pipeSink str sink
+-------------------------------------------------------------------------------
+pipeText !_srcName !_srcLine !str 
+         !(PipeTextOutput !sink)
+ = {-# SCC "PipeTextOutput" #-}
+   pipeSink str sink
 
-        PipeTextLoadCore !fragment !mode !sink !pipes
-         -> {-# SCC "PipeTextLoadCore" #-}
-            let toks    = fragmentLexModule fragment srcName srcLine str 
-            in case C.loadModuleFromTokens fragment srcName mode toks of
-                 (Left err, mct) 
-                  -> do sinkCheckTrace mct sink
-                        return [ErrorLoad err]
 
-                 (Right mm, mct) 
-                  -> do sinkCheckTrace mct sink
-                        pipeCores mm pipes
+-------------------------------------------------------------------------------
+pipeText !srcName !srcLine !str 
+         !(PipeTextLoadCore !fragment !mode !sink !pipes)
+ = {-# SCC "PipeTextLoadCore" #-}
+   do   let   toks    = fragmentLexModule fragment srcName srcLine str 
 
-        PipeTextLoadSourceTetra 
-                sinkTokens
-                sinkDesugared sinkCore sinkPreCheck sinkCheckerTrace 
-                store pipes
-         -> {-# SCC "PipeTextLoadSourceTetra" #-}
-            let 
-                goParse
-                 = do   -- Lex the input text into source tokens.
-                        let tokens  = SE.lexModuleString srcName srcLine str
+--        putStrLn $ unlines $ map (show . SP.valueOfLocated) toks
 
-                        -- Dump tokens to file.
-                        pipeSink (unlines $ map (show . Token.tokenTok) $ tokens) 
-                                sinkTokens
+        case C.loadModuleFromTokens fragment srcName mode toks of
+          (Left err, mct) 
+           -> do sinkCheckTrace mct sink
+                 return [ErrorLoad err]
 
-                        -- Parse the tokens into a Source Tetra module.
-                        case BP.runTokenParser C.describeTok srcName
-                                (SE.pModule SE.context) tokens of
-                         Left err -> return [ErrorLoad err]
-                         Right mm -> goDesugar mm
+          (Right mm, mct) 
+           -> do sinkCheckTrace mct sink
+                 pipeCores mm pipes
 
-                goDesugar mm
-                 =      -- Resolve fixity of infix operators.
-                   case SE.defix SE.defaultFixTable mm of
-                        Left err  -> return [ErrorLoad err]
-                        Right mm' -> goToCore mm'
+ where  sinkCheckTrace mct sink'
+         = case mct of
+                Nothing                 -> return []
+                Just (C.CheckTrace doc) -> pipeSink (renderIndent doc) sink'
 
-                goToCore mm
-                 = do   -- Expand missing quantifiers in signatures.
-                        let mm_expand = SE.expand SE.configDefault 
-                                            SE.primKindEnv SE.primTypeEnv mm
 
-                        -- Dump desguared source code.
-                        pipeSink (renderIndent $ ppr mm_expand) sinkDesugared
+-------------------------------------------------------------------------------
+pipeText !srcName !srcLine !str
+         (PipeTextLoadSourceTetra 
+                sinkTokens sinkParsed sinkFresh
+                sinkDefix  sinkExpand sinkGuards sinkMatches sinkPrep
+                sinkCore        
+                sinkPreCheck sinkCheckerTrace 
+                store pipes)
+ = goParse
+ where 
+        goParse
+         = do   -- Lex the input text into source tokens.
+                let tokens  = SLexer.lexModuleString srcName srcLine str
 
-                        -- Convert Source Tetra to Core Tetra.
-                        -- This source position is used to annotate the 
-                        -- let-expression that holds all the top-level bindings.
-                        let sp            = SP.SourcePos "<top level>" 1 1
-                        case SE.coreOfSourceModule sp mm_expand of
-                         Left err
-                          -> return [ErrorLoad err]
+                -- Dump tokens to file.
+                pipeSink (unlines $ map (show . SP.valueOfLocated) $ tokens) 
+                        sinkTokens
 
-                         Right mm_core
-                          -> do -- Dump Core Tetra.
-                                pipeSink (renderIndent $ ppr mm_core) sinkCore
+                -- Parse the tokens into a Source Tetra module.
+                case BP.runTokenParser C.describeToken srcName
+                        (SParser.pModule) tokens of
+                 Left err -> return [ErrorLoad err]
+                 Right mm 
+                  -> do pipeSink (renderIndent $ ppr mm) sinkParsed
+                        goDesugar mm
 
-                                -- Discover which module imported names are from, and
-                                -- attach the meta-data which will be needed by follow-on
-                                -- compilation, such as the arity of each super.
-                                result <- B.resolveNamesInModule 
-                                                CE.primKindEnv CE.primTypeEnv
-                                                store mm_core
+        goDesugar mm
+         = do   -- Freshen shadowed names and eliminate anonymous binders.
+                let mm_fresh    = SFreshen.evalState (Text.pack "f")
+                                $ SFreshen.freshenModule mm
+                pipeSink (renderIndent $ ppr mm_fresh) sinkFresh
 
-                                case result of 
-                                 Left err          -> return [ErrorLoad err]
-                                 Right mm_resolved -> goSpread mm_resolved
+              -- Resolve fixity of infix operators.
+                case SDefix.defix SDefix.defaultFixTable mm_fresh of
+                 Left err  -> return [ErrorLoad err]
+                 Right mm' -> goToCore mm'
 
-                goSpread mm
-                 = do
-                        -- Spread types of data constructors into uses.
-                        let mm_spread   = C.spreadX CE.primKindEnv CE.primTypeEnv mm
+        goToCore mm_defixed
+         = do   -- Dump defixed source code.
+                pipeSink (renderIndent $ ppr mm_defixed) sinkDefix
 
-                        -- Dump loaded code before type checking.
-                        pipeSink (renderIndent $ ppr mm_spread) sinkPreCheck
+                -- Expand missing quantifiers in signatures.
+                let sp          = SP.SourcePos "<top level>" 1 1
+                let mm_expand   = SExpand.expandModule sp mm_defixed
+                pipeSink (renderIndent $ ppr mm_expand)  sinkExpand
 
-                        -- Type check the code, synthesising missing type annotations.
-                        --  Insert casts to implicitly run suspended bindings along the way.
-                        let fragment_implicit
-                                = flip C.mapProfileOfFragment CE.fragment
-                                $ C.mapFeaturesOfProfile 
-                                $ ( C.setFeature C.ImplicitRun True
-                                  . C.setFeature C.ImplicitBox True)
+                -- Desugar guards and patterns to match expressions.
+                let mm_guards   = SGuards.evalState   (Text.pack "g")
+                                $ SGuards.desugarModule mm_expand
+                pipeSink (renderIndent $ ppr mm_guards) sinkGuards
 
-                        pipeCore mm_spread
-                          $ PipeCoreCheck fragment_implicit C.Synth sinkCheckerTrace pipes
+                -- Desugar match expressions to case expressions.
+                let mm_match    = SMatches.evalState  (Text.pack "m")
+                                $ SMatches.desugarModule mm_guards
+                pipeSink (renderIndent $ ppr mm_match)  sinkMatches
 
-            in goParse
+                -- Prepare for conversion to core.
+                let mm_prep     = SPrep.evalState     (Text.pack "p")
+                                $ SPrep.desugarModule mm_match
+                pipeSink (renderIndent $ ppr mm_prep)   sinkPrep
 
- where  sinkCheckTrace mct sink
-         = case mct of
-                Nothing                 -> return []
-                Just (C.CheckTrace doc) -> pipeSink (renderIndent doc) sink
+                -- Convert Source Tetra to Core Tetra.
+                -- This source position is used to annotate the 
+                -- let-expression that holds all the top-level bindings.
+                case SConvert.coreOfSourceModule sp mm_prep of
+                 Left err
+                  -> return [ErrorLoad err]
 
+                 Right mm_core
+                  -> do -- Dump Core Tetra.
+                        pipeSink (renderIndent $ ppr mm_core) sinkCore
+
+                        -- Discover which module imported names are from, and
+                        -- attach the meta-data which will be needed by follow-on
+                        -- compilation, such as the arity of each super.
+                        result <- B.resolveNamesInModule 
+                                        CE.primKindEnv CE.primTypeEnv
+                                        store mm_core
+
+                        case result of 
+                         Left err          -> return [ErrorLoad err]
+                         Right mm_resolved -> goSpread mm_resolved
+
+        goSpread mm
+         = do
+                -- Spread types of data constructors into uses.
+                let mm_spread   = C.spreadX CE.primKindEnv CE.primTypeEnv mm
+
+                -- Dump loaded code before type checking.
+                pipeSink (renderIndent $ ppr mm_spread) sinkPreCheck
+
+                -- Type check the code, synthesising missing type annotations.
+                --  Insert casts to implicitly run suspended bindings along the way.
+                let fragment_implicit
+                        = flip C.mapProfileOfFragment CE.fragment
+                        $ C.mapFeaturesOfProfile 
+                        $ ( C.setFeature C.ImplicitRun True
+                          . C.setFeature C.ImplicitBox True)
+
+                pipeCore mm_spread
+                  $ PipeCoreCheck fragment_implicit (C.Synth []) sinkCheckerTrace pipes
 
diff --git a/DDC/Build/Platform.hs b/DDC/Build/Platform.hs
--- a/DDC/Build/Platform.hs
+++ b/DDC/Build/Platform.hs
@@ -15,7 +15,7 @@
         , determineHostOs
         , determineHostLlvmVersion)
 where
-import DDC.Base.Pretty
+import DDC.Data.Pretty
 import Data.List                as List
 import Data.Maybe               as Maybe
 import Data.Char                as Char
diff --git a/DDC/Build/Spec/Parser.hs b/DDC/Build/Spec/Parser.hs
--- a/DDC/Build/Spec/Parser.hs
+++ b/DDC/Build/Spec/Parser.hs
@@ -5,7 +5,7 @@
         , Error(..) )
 where
 import DDC.Build.Spec.Base
-import DDC.Base.Pretty
+import DDC.Data.Pretty
 import Control.Monad
 import Data.List
 import Data.Char
diff --git a/DDC/Build/Transform/Resolve.hs b/DDC/Build/Transform/Resolve.hs
--- a/DDC/Build/Transform/Resolve.hs
+++ b/DDC/Build/Transform/Resolve.hs
@@ -10,8 +10,8 @@
 import DDC.Core.Collect.Support
 import DDC.Type.DataDef
 import DDC.Type.Env                             (KindEnv, TypeEnv)
-import DDC.Base.Pretty
-import DDC.Base.Panic
+import DDC.Data.Pretty
+import DDC.Control.Panic
 import Data.Map                                 (Map)
 import DDC.Build.Interface.Store                (Store)
 import DDC.Build.Interface.Base                 (Interface (..))
@@ -69,12 +69,17 @@
                 $  moduleImportDataDefs mm 
                 ++ importsForDaTyCons deps (Set.toList $ supportTyCon sp)
 
+           , moduleImportTypeDefs
+                =  nubBy ((==) `on` fst)
+                $  moduleImportTypeDefs mm
+                ++ importsTypeDef deps
+
            , moduleImportCaps
-                = moduleImportCaps mm
+                =  moduleImportCaps mm
                 ++ importsCap deps
 
            , moduleImportValues  
-                =  moduleImportValues mm 
+                =  moduleImportValues mm
                 ++ importsDaVar }
 
 
@@ -84,7 +89,7 @@
         :: Ord n
         => Map ModuleName (Module b n)  -- ^ Modules which this one depends on.
         -> [Bound n]                    -- ^ Unbound type constructors to find imports for.
-        -> [(n, ImportType n)]
+        -> [(n, ImportType n (Type n))]
 
 importsForTyCons deps _tyCons
  = concat
@@ -104,9 +109,8 @@
 ---------------------------------------------------------------------------------------------------
 -- | Import caps defined in other modules.
 importsCap
-        :: Ord n
-        => Map ModuleName (Module b n)
-        -> [(n, ImportCap n)]
+        :: Map ModuleName (Module b n)
+        -> [(n, ImportCap n (Type n))]
 
 importsCap deps
  = concatMap moduleImportCaps $ Map.elems deps
@@ -115,8 +119,7 @@
 ---------------------------------------------------------------------------------------------------
 -- | Import data defs defined in other modules.
 importsForDaTyCons
-        :: Ord n
-        => Map ModuleName (Module b n)
+        :: Map ModuleName (Module b n)
         -> [Bound n]
         -> [DataDef n]
 
@@ -127,6 +130,18 @@
 
 
 ---------------------------------------------------------------------------------------------------
+-- | Import type defs defined in other modules.
+importsTypeDef 
+        :: Map ModuleName (Module b n)
+        -> [(n, (Kind n, Type n))]
+
+importsTypeDef deps
+        = concat
+        $ [ moduleImportTypeDefs m ++ moduleTypeDefsLocal m
+                | m <- Map.elems deps ]
+
+
+---------------------------------------------------------------------------------------------------
 -- | Build import statements for the given list of unbound value variables.
 --
 --   We look in dependency modules for a matching export, 
@@ -136,7 +151,7 @@
         :: Store                -- ^ Interface store.
         -> [ModuleName]         -- ^ Modules to search for matching exports.
         -> E.Name               -- ^ Name of value.
-        -> IO (Either Error (ImportValue E.Name))
+        -> IO (Either Error (ImportValue E.Name (Type E.Name)))
 
 findImportSourceForDaVar store modNames nSuper
  = do   result  <- Store.findSuper store nSuper modNames
diff --git a/LICENSE b/LICENSE
--- a/LICENSE
+++ b/LICENSE
@@ -1,7 +1,7 @@
 --------------------------------------------------------------------------------
 The Disciplined Disciple Compiler License (MIT style)
 
-Copyrite (K) 2007-2014 The Disciplined Disciple Compiler Strike Force
+Copyrite (K) 2007-2016 The Disciplined Disciple Compiler Strike Force
 All rights reversed.
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
diff --git a/ddc-build.cabal b/ddc-build.cabal
--- a/ddc-build.cabal
+++ b/ddc-build.cabal
@@ -1,5 +1,5 @@
 Name:           ddc-build
-Version:        0.4.2.2
+Version:        0.4.3.1
 License:        MIT
 License-file:   LICENSE
 Author:         The Disciplined Disciple Compiler Strike Force
@@ -14,23 +14,23 @@
 
 Library
   Build-depends:
-        base             >= 4.6 && < 4.9,
-        process          >= 1.1 && < 1.3,
+        base             >= 4.6 && < 4.10,
+        process          >= 1.4 && < 1.5,
         deepseq          >= 1.3 && < 1.5,
         containers       == 0.5.*,
         filepath         >= 1.3 && < 1.5,
         directory        == 1.2.*,
         mtl              == 2.2.1.*,
-        time             >= 1.4 && < 1.6,
-        ddc-base         == 0.4.2.*,
-        ddc-core         == 0.4.2.*,
-        ddc-core-simpl   == 0.4.2.*,
-        ddc-core-salt    == 0.4.2.*,
-        ddc-core-llvm    >= 0.4.2.2 && < 0.4.3,
-        ddc-core-flow    == 0.4.2.*,
-        ddc-core-tetra   == 0.4.2.*,
-        ddc-core-babel   == 0.4.2.*,
-        ddc-source-tetra == 0.4.2.*
+        time             >= 1.6 && < 1.7,
+        text             >= 1.2.2 && < 1.3,
+        ddc-core         == 0.4.3.*,
+        ddc-core-simpl   == 0.4.3.*,
+        ddc-core-salt    == 0.4.3.*,
+        ddc-core-llvm    == 0.4.3.*,
+        ddc-core-flow    == 0.4.3.*,
+        ddc-core-tetra   == 0.4.3.*,
+        ddc-core-babel   == 0.4.3.*,
+        ddc-source-tetra == 0.4.3.*
   
   Exposed-modules:
         DDC.Build.Interface.Base
