diff options
| author | hallgren <hallgren@chalmers.se> | 2015-08-28 13:59:43 +0000 |
|---|---|---|
| committer | hallgren <hallgren@chalmers.se> | 2015-08-28 13:59:43 +0000 |
| commit | 5bfaf10de597af504e6d2784309e533b09a6451c (patch) | |
| tree | c0aacba9c492304cb3b0f905aa05bbefa1599d2c /src/runtime | |
| parent | f2952768d578309a8f75c7da417e3602c4d5e9e9 (diff) | |
Comment out some dead code found with -fwarn-unused-binds
Also fixed some warnings and tightened some imports
Diffstat (limited to 'src/runtime')
| -rw-r--r-- | src/runtime/haskell/PGF/Forest.hs | 4 | ||||
| -rw-r--r-- | src/runtime/haskell/PGF/Linearize.hs | 4 | ||||
| -rw-r--r-- | src/runtime/haskell/PGF/Macros.hs | 4 | ||||
| -rw-r--r-- | src/runtime/haskell/PGF/OldBinary.hs | 4 | ||||
| -rw-r--r-- | src/runtime/haskell/PGF/Probabilistic.hs | 6 | ||||
| -rw-r--r-- | src/runtime/haskell/PGF/SortTop.hs | 4 | ||||
| -rw-r--r-- | src/runtime/haskell/PGF/TypeCheck.hs | 2 |
7 files changed, 15 insertions, 13 deletions
diff --git a/src/runtime/haskell/PGF/Forest.hs b/src/runtime/haskell/PGF/Forest.hs index bb4ba29af..2a680b7c9 100644 --- a/src/runtime/haskell/PGF/Forest.hs +++ b/src/runtime/haskell/PGF/Forest.hs @@ -71,7 +71,7 @@ bracketedTokn dp f@(Forest abs cnc forest root) = in (ct,fid',fun,es,(map getVar hypos,lin))
Nothing -> error ("wrong forest id " ++ show fid)
where
- descend forest (PApply funid args) = let (CncFun fun lins) = cncfuns cnc ! funid
+ descend forest (PApply funid args) = let (CncFun fun _lins) = cncfuns cnc ! funid
cat = case isLindefCId fun of
Just cat -> cat
Nothing -> case Map.lookup fun (funs abs) of
@@ -132,7 +132,7 @@ getAbsTrees (Forest abs cnc forest root) arg@(PArg _ fid) ty dp = | otherwise = do fid0 <- get
put fid
x <- foldForest (\funid args trees ->
- do let CncFun fn lins = cncfuns cnc ! funid
+ do let CncFun fn _lins = cncfuns cnc ! funid
case isLindefCId fn of
Just _ -> do arg <- go (Set.insert fid rec_) scope mb_tty (head args)
return (mkAbs arg)
diff --git a/src/runtime/haskell/PGF/Linearize.hs b/src/runtime/haskell/PGF/Linearize.hs index 2393010b7..e3e8d92db 100644 --- a/src/runtime/haskell/PGF/Linearize.hs +++ b/src/runtime/haskell/PGF/Linearize.hs @@ -124,5 +124,5 @@ linTree pgf cnc e = nub (map snd (lin Nothing 0 e [] [] e [])) def (Just (cat,fid)) n_fid e0 ys xs s def Nothing n_fid e0 ys xs s = [] -amapWithIndex :: (IArray a e1, IArray a e2, Ix i) => (i -> e1 -> e2) -> a i e1 -> a i e2 -amapWithIndex f arr = listArray (bounds arr) (map (uncurry f) (assocs arr)) +--amapWithIndex :: (IArray a e1, IArray a e2, Ix i) => (i -> e1 -> e2) -> a i e1 -> a i e2 +--amapWithIndex f arr = listArray (bounds arr) (map (uncurry f) (assocs arr)) diff --git a/src/runtime/haskell/PGF/Macros.hs b/src/runtime/haskell/PGF/Macros.hs index 42d16683a..de175616c 100644 --- a/src/runtime/haskell/PGF/Macros.hs +++ b/src/runtime/haskell/PGF/Macros.hs @@ -231,11 +231,11 @@ computeSeq filter seq args = concatMap compute seq | otherwise = arg_lin where arg_lin = lin ! r - (ct@(cat,fid),_,fun,es,(xs,lin)) = args !! d + (ct@(cat,fid),_,fun,es,(_xs,lin)) = args !! d getVar d r = [LeafKS (showCId (xs !! r))] where - (ct,_,fun,es,(xs,lin)) = args !! d + (_ct,_,_fun,_es,(xs,_lin)) = args !! d flattenBracketedString :: BracketedString -> [String] flattenBracketedString (Leaf w) = [w] diff --git a/src/runtime/haskell/PGF/OldBinary.hs b/src/runtime/haskell/PGF/OldBinary.hs index 9a65b0fa6..c727589f5 100644 --- a/src/runtime/haskell/PGF/OldBinary.hs +++ b/src/runtime/haskell/PGF/OldBinary.hs @@ -159,8 +159,8 @@ getArray get1 = toArray `fmap` getList' get1 toArray (n,xs) = listArray (0::Int,n-1) xs listToArray xs = toArray (length xs,xs) -getArray2 :: (IArray a1 (a2 Int e), IArray a2 e) => Get e -> Get (a1 Int (a2 Int e)) -getArray2 get1 = getArray (getArray get1) +--getArray2 :: (IArray a1 (a2 Int e), IArray a2 e) => Get e -> Get (a1 Int (a2 Int e)) +--getArray2 get1 = getArray (getArray get1) getList get1 = snd `fmap` getList' get1 diff --git a/src/runtime/haskell/PGF/Probabilistic.hs b/src/runtime/haskell/PGF/Probabilistic.hs index 555ae0ce9..780e1c12f 100644 --- a/src/runtime/haskell/PGF/Probabilistic.hs +++ b/src/runtime/haskell/PGF/Probabilistic.hs @@ -210,7 +210,7 @@ mkProbDefs pgf = then closure k deps2 vs2 vs3 else closure k deps2 ((src,dst') : vs2) vs3 else closure k (dep2 : deps2) vs2 vs3 - +{- mkNewSig src = DTyp (mkArgs 0 0 [] src) cidFloat [] where @@ -219,7 +219,7 @@ mkProbDefs pgf = | i == k = let ty = DTyp [] c (map (normalForm sig k env) es) in (Explicit,wildCId,ty) : mkArgs (k+1) (l+1) (VGen l [] : env) src | otherwise = mkArgs (k+1) l (VMeta 0 env [] : env) src - +-} type CState = (Int,Map.Map CId [Equation]) computeConstrs :: PGF -> CState -> [(CId,[Patt],[Expr])] -> (CState,[[CId]]) @@ -263,7 +263,7 @@ computeConstrs pgf st fns = where addArgs (cn,fns) = addArg (length args) cn [] fns where - Just (ty@(DTyp args _ es),_,_,_) = Map.lookup cn (funs (abstract pgf)) + Just (DTyp args _ _es,_,_,_) = Map.lookup cn (funs (abstract pgf)) addArg 0 cn ps fns = [(PApp cn (reverse ps),fns)] addArg n cn ps fns = concat [addArg (n-1) cn (arg:ps) fns' | (arg,fns') <- computeConstr fns] diff --git a/src/runtime/haskell/PGF/SortTop.hs b/src/runtime/haskell/PGF/SortTop.hs index f3747b805..c31b32e91 100644 --- a/src/runtime/haskell/PGF/SortTop.hs +++ b/src/runtime/haskell/PGF/SortTop.hs @@ -55,7 +55,7 @@ typesInterm abs fset = in (x,c)) fset in Map.fromList $ Set.toList fsetTypes - +{- takeArgs :: Map.Map CId CId -> Map.Map CId Expr -> CId -> Expr takeArgs mtypes mexpr ty = let xarg = head $ Map.keys $ Map.filter (==ty) mtypes @@ -63,7 +63,7 @@ takeArgs mtypes mexpr ty = doesReturnCat :: Type -> CId -> Bool doesReturnCat (DTyp _ c _) cat = c == cat - +-} returnCat :: Abstr -> CId -> CId returnCat abs cid = let p = Map.lookup cid $ funs abs diff --git a/src/runtime/haskell/PGF/TypeCheck.hs b/src/runtime/haskell/PGF/TypeCheck.hs index 8860ed17b..3c2580d59 100644 --- a/src/runtime/haskell/PGF/TypeCheck.hs +++ b/src/runtime/haskell/PGF/TypeCheck.hs @@ -600,6 +600,7 @@ generateForForest :: (Scope -> TType -> TcM FId Expr) -> Expr -> TcM FId Expr generateForForest prove e = do -- fillinVariables refineExpr e +{- where fillinVariables = do fvs <- TcM (\abstr k h ms -> k [(i,s,scope,tty,cs) | (i,MUnbound s scope tty cs) <- IntMap.toList ms] ms) @@ -614,6 +615,7 @@ generateForForest prove e = do sequence_ [c e | c <- cs] fillinVariables ) abstr k h ms s) +-} ----------------------------------------------------- -- evalType |
