Comments (9)
Merged in base hash #p47o3ehssr
🌈🌟
from base.
Cool! I probably won't get to take a closer look at this until next week and @runarorama is also out.
One thing I noticed: I don't think there should be any patch updates with this PR. The name Abort.toOptional
was repurposed but the old definition is still valid, and I think the definition is now called Abort.toOptional!
. Me or @runarorama can fix up the PR though, the functionality looks great!
The workflow for this needs improvement and is being tracked here unisonweb/unison#2248 since it's pretty error prone. One tip is you can do update .trash
to send updates to a dummy patch that you delete occasionally.
https://www.unisonweb.org/2020/04/10/reducing-churn/ is a good post for more reading on this.
Here's another List
function we noticed was missing that would be a good addition, if you want to take a crack at it!
List.find : (a ->{g} Boolean) -> [a] ->{g} Optional a
List.find! : (a ->{g} Boolean) -> [a] ->{g, Abort} a
from base.
Having thought about it more, I think iterate ought to return a stream, not a list, and should not require the passed function to decide when to stop. That should be the responsibility of the caller, using something like take or takewhile. In Haskell iterate returns a lazy infinite list, and I was confused since Haskell collapses the distinction between the two.
This only really occurred to me when I started coming up with examples and the passed functions were always something like
if n > 10 then abort else n + 1
Which is extremely not composable.
I'm not sure whether unfold ought to as well, as in this case the provided function is supposed to be responsible for stopping, and the output will often in fact be finite. I guess it can't hurt to have both versions of both functions? Thoughts?
from base.
Here's another List function we noticed was missing that would be a good addition, if you want to take a crack at it!
For sure, I also have List.deleteFirst : (a -> Boolean) -> [a] -> [a]
, which I could generalize and add
from base.
@sullyj3 You'll also want to add aliases for your Author
and License
metadata to the metadata.authors
and metadata.licenses
namespaces, respectively. e.g., alias.term sullyj3 .prs.base.unfoldStore.metadata.authors.sullyj
.
from base.
Ah yep, do I also need to alias my CopyrightHolder
and GUID
?
from base.
Updated with just Author
and License
for now
from base.
Ah yep, do I also need to alias my
CopyrightHolder
andGUID
?
Yep, mirror the structure of one of the existing authors. I think it's just a couple copy.namespace
commands at this point.
from base.
Righto cool. Updated with the additional metadata as well as Stream.iterate
from base.
Related Issues (20)
- regression in Bytes.toHex HOT 1
- Revamp `TlsSocket` API HOT 1
- Remove installation command from README HOT 1
- networkAccess doc: Tls.terminate mentioned twice. HOT 2
- Is Random.lcg okay? HOT 3
- Add aliases for `Bytes.indexOf` and `Text.indexOf` HOT 12
- move delay to Function namespace HOT 1
- Suggestion: rename `UTCOffset.+` to `UTCOffset.addHours` HOT 1
- minor: evalToText error message says Debug.toText HOT 2
- Unintuitive and inconsistent behavior in range functions HOT 6
- Random.natIn that is inclusive of upper value HOT 2
- contradictory entries in patch HOT 1
- Add some basic graph functionality HOT 1
- Streaming UTF-8 decoding and misc helpers HOT 4
- Add Ask.map and Ask.map! HOT 1
- Add IO.randomNat HOT 1
- It's easy to silently mess up Stream.flatMap calls HOT 1
- Process docs make false claim about closing handles
- 15x faster implementation of `Text.words` HOT 2
- WIP: proposed tweaks to testing API
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from base.