Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
curry
curry-frontend
Commits
ebd64a18
Commit
ebd64a18
authored
Oct 17, 2012
by
Björn Peemöller
Browse files
WarnCheck improved, version up to 0.3.4
parent
7598493d
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
curry-frontend.cabal
View file @
ebd64a18
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:
...
...
src/Base/ScopeEnv.hs
View file @
ebd64a18
...
...
@@ -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
...
...
src/Checks/WarnCheck.hs
View file @
ebd64a18
This diff is collapsed.
Click to expand it.
test/Shadow.curry
View file @
ebd64a18
...
...
@@ -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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment