Code Monkey home page Code Monkey logo

Comments (6)

jcouyang avatar jcouyang commented on June 11, 2024

Boolean works because whether tick or untick the box it emit the same type. I'm not sure what Owlet[Either[A, B]] can be represented in the sense of web component? What kind of component can emit either A or B type of value?

in my mind RawValue and Formula are both model as Owlet[A], one without computation one with computation, but both emit A

from owlet.

cryptokoans avatar cryptokoans commented on June 11, 2024

Right, I see what you mean regarding checkbox, and perhaps my example was not the best. A better example might be one pertaining to some form of error handling where type A represents an error and type B represents the expected value?

Additionally, one way to think about Boolean is as a sum type which means that the checkbox component (at least in theory?) is a special case of Owlet[Either[_,_]]

Anyway, the intuition behind coming up with some representation for Either, Pair, and maybe even Function1 is that it would open the door to making a very neat way to allow end-users (e.g. not us scala programmers, but the users that are actually using the programs/sites we write) to program on top of Owlet?

from owlet.

cryptokoans avatar cryptokoans commented on June 11, 2024

I've been thinking more about this, and it seems that perhaps that best example of a component that can emit either an A or B is actually the error propagation case. This is actually really interesting. Specifically, if an end user is dissatisfied with how a component is behaving, they can essentially "file a bug" and the report would sort of start propagating backwards. It's sort of like a user-generated exception and bug reporting all rolled into one.

Not sure if the above makes much sense or not but figured I'd at least try to explain one reason why such a component would be interesting :-)

from owlet.

jcouyang avatar jcouyang commented on June 11, 2024

If i understand correctly, for user error, you can always map over an owlet and covert it to either
E.g. if you consider numbers less than 0 is error

int("a", 0).map(a=>if(a<0) Left("error") else Right(a))

from owlet.

jcouyang avatar jcouyang commented on June 11, 2024

currently the design of owler DOM is just to map web components to owlet components

from owlet.

cryptokoans avatar cryptokoans commented on June 11, 2024

currently the design of owler DOM is just to map web components to owlet components

Yeah, that makes sense. It could be that what I'm attempting is too far out of scope. I'll likely still keep thinking about it though :-)

from owlet.

Related Issues (5)

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.