Comments (6)
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.
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.
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.
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.
currently the design of owler DOM is just to map web components to owlet components
from owlet.
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)
- Maven central release? HOT 7
- example for hyperlink? HOT 2
- label is not labeling properly HOT 2
- display-once semantics intended? HOT 3
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 owlet.