on develop help sign in
add justification for type signature
commit2ce3f4d29724e265b826a51b98ff2223e5f6c5a1 authorJoe Betz <joebetz91@gmail.com> dateWed 4 Dec 2019, 22:05 (7 years ago) parentd705913
1 file changed+2
FAQ.md+2
FAQ.md+2
@@ -4,6 +4,8 @@
44
55Using `element`, a low-level DOM builder function. Its second argument, `ElementConfig`, has a `_elementConfig_eventSpec` field that can be modified using `addEventSpecFlags`. It takes a `Proxy` that specifies the `DomSpace`, an event name, and a callback which takes the event result and returns an event flag, which can enable behavior like `preventDefault` and `stopPropagation`.
66
7+The type signature on the `def` value is needed because `EventSpec` is a non-injective type family, meaning that the input type can't be inferred from the result. In this case, the unknown input is the `DomBuilderSpace m`, which is why it needs to be specified manually.
8+
79For example:
810
911```haskell