-
Notifications
You must be signed in to change notification settings - Fork 56
Add missing Element-Attr API functions, add Attr type. #15
base: master
Are you sure you want to change the base?
Conversation
This commit also adds natively-typed API to work with attributes. Notice that here we also take a liberty of explicitly marking legacy and nonsense-fields of Attr IDL as ``legacy`` instead of IDL names of those.
I'm not sure My original thought was to just have |
g f (Just v) = toNullable $ Just (f v) | ||
|
||
(>>) :: forall a b m. (Monad m) => m a -> m b -> m b | ||
(>>) x y = x >>= \_ -> y |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is defined as (*>)
in Control.Applicative
- no need for (>>)
in PureScript as Applicative
is a superclass of Monad
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Old habits die hard.
I like this approach and will implement it, test and force-push. |
I'm confused though, quoting IRC —
|
I'm also not totally up on the DOM and previous versions either, so I'm just trying to stick to whatever the IDLs say in the DOM 4 draft really... it looks like there is no way of instantiating an I appreciate the contribution, but since I'm being so picky about this would you rather I just did it instead? |
I wouldn't say your API is terrible either 😉 I just have specific ideas about how this library should be built, to keep it as unopinionated as possible while providing typed access to the DOM API. That does make it more user unfriendly than normal libraries, but this is supposed to be a starting point to build useful libraries on top of while providing a set of common types that they can share, and prevent the need of resorting to writing code in the FFI for their implementations. |
This commit also adds natively-typed API to work with attributes.
Notice that here we also take a liberty of explicitly marking legacy and
nonsense-fields of Attr IDL as
legacy
instead of IDL names of those.Again, a ridiculously stupid, yet somewhat complete test suite is attached to PR.
I don't expect this PR to get merged right away, instead I'd like to hear
opinions regarding what to do with this code and Attr API.