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
53c64683
Commit
53c64683
authored
Feb 26, 2015
by
Jan Rasmus Tikovsky
Browse files
Use free variables for omitted record fields instead of failures
parent
8e6bfbab
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Transformations/Desugar.hs
View file @
53c64683
...
...
@@ -574,7 +574,7 @@ booleanGuards tyEnv (CondExpr _ g _ : es) =
-- Record construction expressions are transformed into normal
-- constructor applications by rearranging fields in the order of the
-- record's declaration, passing `Prelude.un
defined
` in place of
-- record's declaration, passing `Prelude.un
known
` in place of
-- omitted fields, and discarding the field labels. The transformation of
-- record update expressions is a bit more involved as we must match the
-- updated expression with all valid constructors of the expression's
...
...
@@ -598,7 +598,7 @@ dsExpr p (Typed e ty) = Typed <$> dsExpr p e <*> dsTypeExpr ty
dsExpr
p
(
Record
c
fs
)
=
do
tyEnv
<-
getValueEnv
let
ls
=
map
(
qualifyLike
c
)
$
fst
$
conType
c
tyEnv
es
=
map
(
dsLabel
prel
Failed
(
map
field2Tuple
fs
))
ls
es
=
map
(
dsLabel
prel
Unknown
(
map
field2Tuple
fs
))
ls
dsExpr
p
$
apply
(
Constructor
c
)
es
dsExpr
p
(
RecordUpdate
e
fs
)
=
do
tcEnv
<-
getTyConsEnv
...
...
Write
Preview
Markdown
is supported
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