Code Monkey home page Code Monkey logo

Comments (9)

runarorama avatar runarorama commented on August 23, 2024 1

Merged in base hash #p47o3ehssr 🌈🌟

from base.

pchiusano avatar pchiusano commented on August 23, 2024

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.

sullyj3 avatar sullyj3 commented on August 23, 2024

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.

sullyj3 avatar sullyj3 commented on August 23, 2024

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.

anovstrup avatar anovstrup commented on August 23, 2024

@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.

sullyj3 avatar sullyj3 commented on August 23, 2024

Ah yep, do I also need to alias my CopyrightHolder and GUID?

from base.

sullyj3 avatar sullyj3 commented on August 23, 2024

Updated with just Author and License for now

from base.

anovstrup avatar anovstrup commented on August 23, 2024

Ah yep, do I also need to alias my CopyrightHolder and GUID?

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.

sullyj3 avatar sullyj3 commented on August 23, 2024

Righto cool. Updated with the additional metadata as well as Stream.iterate

from base.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.