Commit ebd64a18 authored by Björn Peemöller 's avatar Björn Peemöller
Browse files

WarnCheck improved, version up to 0.3.4

parent 7598493d
Name: curry-frontend
Version: 0.3.3
Version: 0.3.4
Cabal-Version: >= 1.6
Synopsis: Compile the functional logic language Curry to several
intermediate formats
......@@ -35,7 +35,7 @@ Executable cymake
else
Build-Depends: base == 3.*
Build-Depends:
curry-base == 0.3.3
curry-base == 0.3.4
, mtl, containers, pretty, transformers
ghc-options: -Wall
Other-Modules:
......
......@@ -9,7 +9,7 @@
-}
module Base.ScopeEnv
( Level, ScopeEnv
, new, insert, modify, lookup, level, exists, beginScope
, new, insert, modify, lookup, level, lookupWithLevel, exists, beginScope
, endScope, endScopeUp, toLevelList, currentLevel
) where
......@@ -41,13 +41,17 @@ modify f k = modifySE modifyLev
-- |Looks up the value which is stored under a key from the environment of
-- the current scope
lookup :: Ord a => a -> ScopeEnv a b -> Maybe b
lookup k = selectSE lookupLev
where lookupLev _ = fmap fst . Map.lookup k
lookup k = fmap fst . lookupWithLevel k
-- Returns the level of the last insertion of a key
level :: Ord a => a -> ScopeEnv a b -> Int
level k = selectSE levelLev
where levelLev _ = maybe (-1) snd . Map.lookup k
level :: Ord a => a -> ScopeEnv a b -> Level
level k = maybe (-1) snd . lookupWithLevel k
-- |Looks up the value and the level which is stored under a key from the
-- environment of the current scope
lookupWithLevel :: Ord a => a -> ScopeEnv a b -> Maybe (b, Level)
lookupWithLevel k = selectSE lookupLev
where lookupLev _ = Map.lookup k
-- Checks, whether a key exists in the environment of the current scope
exists :: Ord a => a -> ScopeEnv a b -> Bool
......
This diff is collapsed.
......@@ -8,4 +8,8 @@ main = do
main2 = do
let x = True
let x = False
return x
\ No newline at end of file
return x
f x = g 1 where g x = x
lc = [x | x <- [1..10], x <- [1..10]]
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment