Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
clean-compiler-and-rts
compiler
Commits
dec8d060
Commit
dec8d060
authored
Aug 14, 2001
by
Vincent Zweije
Browse files
Define mapsnd3
parent
e1479b2e
Changes
2
Hide whitespace changes
Inline
Side-by-side
sucl/basic.dcl
View file @
dec8d060
...
...
@@ -118,6 +118,9 @@ mappair :: .(.a -> .b) .(.c -> .d) !(.a,.c) -> (.b,.d)
// Map a function onto the second element of a 2-tuple.
mapsnd
::
v
:(.
a
->
.
b
)
->
u
:((.
c
,.
a
)
->
(.
c
,.
b
)),
[
u
<=
v
]
// Map a function on the second element of a triple.
mapsnd3
::
v
:(.
a
->
.
b
)
->
u
:((.
c
,.
a
,.
d
)
->
(.
c
,.
b
,.
d
)),
[
u
<=
v
]
// Map a function onto the tail of a list.
maptl
::
.(
x
:[.
a
]
->
u
:[.
a
])
!
w
:[.
a
]
->
v
:[.
a
],
[
u
<=
v
,
w
<=
x
]
...
...
sucl/basic.icl
View file @
dec8d060
...
...
@@ -198,6 +198,9 @@ mappair f g (x,y) = (f x,g y)
mapsnd
::
v
:(.
a
->
.
b
)
->
u
:((.
c
,.
a
)
->
(.
c
,.
b
)),
[
u
<=
v
]
mapsnd
f
=
app2
(
id
,
f
)
mapsnd3
::
v
:(.
a
->
.
b
)
->
u
:((.
c
,.
a
,.
d
)
->
(.
c
,.
b
,.
d
)),
[
u
<=
v
]
mapsnd3
f
=
app3
(
id
,
f
,
id
)
maptl
::
.(
x
:[.
a
]
->
u
:[.
a
])
!
w
:[.
a
]
->
v
:[.
a
],
[
u
<=
v
,
w
<=
x
]
maptl
f
[]
=
[]
maptl
f
[
x
:
xs
]
=
[
x
:
f
xs
]
...
...
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