mirror of
https://github.com/unisonweb/unison.git
synced 2024-11-13 09:55:35 +03:00
832 B
832 B
The same kind of thing happens with map
. Are we saying this is incorrect behaviour?
map : (a -> b) -> [a] -> [b]
map f = cases
x +: xs -> f x +: map f xs
[] -> []
I found and typechecked these definitions in scratch.u. If you
do an `add` or `update`, here's how your codebase would
change:
⍟ These new definitions are ok to `add`:
map : (a ->{𝕖} b) ->{𝕖} [a] ->{𝕖} [b]
Now evaluating any watch expressions (lines starting with
`>`)... Ctrl+C cancels.
.> add
⍟ I've added these definitions:
map : (a ->{𝕖} b) ->{𝕖} [a] ->{𝕖} [b]
.> view map
map : (a -> b) -> [a] -> [b]
map f = cases
x +: xs ->
use builtin.List +:
f x +: map f xs
[] -> []
.> find map
1. map : (a ->{𝕖} b) ->{𝕖} [a] ->{𝕖} [b]