Comments (8)
I think it is.
EventHandler (Aff eff input)
is inhabited by preventDefault $> x
. All we need is for x
to not call the callback, but I'm not sure if that's possible. @jdegoes ?
from purescript-halogen.
Aff eff input
is a computation which must produce an input
or end in error, there are no other options. It's exactly like Eff eff input
except asynchronous. However, one use forkAff
if one wishes to fork the computation, and then const-map it to whatever. That should be enough to build this, right? Also Handler is becoming a monad transformer, isn't it?
from purescript-halogen.
I think @cryogenian wants to not produce any input to the state machine at all. I think handler'
will let you do that. The underlying representation of a handler certainly allows it.
from purescript-halogen.
Perhaps a combinator, then, which operates on EventHandler a
, goes to EventHandler b
for all b
, by mapping the Maybe i
to Nothing
?
from purescript-halogen.
It's not EventHandler
, it's the attribute itself:
https://github.com/slamdata/purescript-halogen/blob/master/src/Halogen/HTML/Attributes.purs#L147
But yes, a combinator would probably do the trick. Rolling the Maybe into the new EventHandlerT
would probably be a good thing.
from purescript-halogen.
@cryogenian Now you can use cancel
if you don't want to generate any input event.
@puffnfresh You mentioned using Free
which I think was a good idea, but I stuck with WriterT
because I now need to turn this into EventHandlerT
(transformer) and we don't have a free monad transformer yet in purescript-free
.
from purescript-halogen.
@paf31 that's fine.
We were not able to write a stack-safe FreeT
in Scala due to the JVM. I wonder if JS will have the same problem...
from purescript-halogen.
Can't you play the same trick with Gosub
? Interpreting the monad should (and I'm guessing obviously) be possible safely with tailrec
.
from purescript-halogen.
Related Issues (20)
- touchenter and touchleave are deprecated
- `tellAll` function is not re-exported in Halogen module
- Enabling `StateT` with `HalogenM` HOT 1
- Export tellAll from Halogen.Query to Halogen HOT 2
- Reading Effects chapter -> Could not match type ResponseFormat String with type AffjaxDriver HOT 4
- Question: how to handle events coming from a js app? HOT 2
- Communication with JS loaded via CDN HOT 2
- Child component gets rendered outside of parent, being moved to bottom of HTML body HOT 6
- `raise` should not be a blocking operation HOT 8
- Discussion: CSS strategy for halogen applications HOT 20
- Question: body-level events HOT 3
- Order of properties matters when using `value` with `min` / `max` for `InputRange` HOT 3
- Change kind of slots to not be `Type`
- `RenderSpec` doc comment still mentions `h` parameter
- Doc: the examples of "An Aff Example: HTTP Requests" give TypesDoNotUnify Error on Halogen v7 HOT 1
- Select Multiple Selected does not work HOT 4
- A bug? Weird behavior of text input fields. HOT 4
- Child component is destroyed while parent component handles output from that child HOT 5
- Array state updates HOT 4
- open and showModal are missing for dialog HOT 6
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 purescript-halogen.