Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generalize fan following DMap #318

Merged
merged 7 commits into from
Jul 21, 2019

Conversation

treeowl
Copy link
Contributor

@treeowl treeowl commented Jul 4, 2019

Generalize fan to fang (yeah, that's a horrible name) allowing fanning DMaps with arbitrary targets (not just Identity). I haven't yet dug down enough to work out how to do the same for merge, but it would be useful.

@ryantrinkle
Copy link
Member

Awesome! This all looks great; maybe we could rename it to fanG and merge?

@treeowl
Copy link
Contributor Author

treeowl commented Jul 4, 2019 via email

@treeowl
Copy link
Contributor Author

treeowl commented Jul 4, 2019

Renamed. Should be ready to merge.

fan :: forall t k. (Reflex t, GCompare k)
=> Event t (DMap k Identity) -> EventSelector t k
--TODO: Can we help enforce the partial application discipline here? The combinator is worthless without it
fan e = EventSelector (fixup (selectg (fanG e) :: k a -> Event t (Identity a)) :: forall a. k a -> Event t a)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we match on the Coercion and then produce a lambda, or something like that, to make sure there's only one eventCoercion call per Reflex instance?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It probably doesn't actually matter...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking about such things and opened #319

@cgibbard
Copy link
Collaborator

cgibbard commented Jul 4, 2019 via email

@ryantrinkle
Copy link
Member

ryantrinkle commented Jul 4, 2019 via email

@Ericson2314
Copy link
Member

Ericson2314 commented Jul 4, 2019

We'll have the same thing again with NonEmptyDMap for fan and merge, so I'd say new name for now, and replace fan later.

@ali-abrar
Copy link
Member

Could you please update the changelog?

@treeowl treeowl changed the title Generalize following DMap Generalize fan following DMap Jul 8, 2019
@treeowl
Copy link
Contributor Author

treeowl commented Jul 8, 2019

@ali-abrar, updated.

@oliver-batchelor oliver-batchelor merged commit 13e76bb into reflex-frp:develop Jul 21, 2019
@oliver-batchelor oliver-batchelor mentioned this pull request Aug 1, 2019
ali-abrar added a commit that referenced this pull request Aug 1, 2019
* 'release/0.6.2.1' of github.com:ryantrinkle/reflex: (30 commits)
  Loosen monoidal-containers version bounds
  Update CONTRIBUTING.md
  Update CONTRIBUTING.md
  Use unsafePerformIO better (#325)
  Generalize fan following DMap (#318)
  Distribute more generally
  Generalize merge
  Drop *Tag classes
  Fix deprecation warnings related to updated Data.Some
  Bump dependent-sum to latest version
  fan: Rewrite haddock
  Replace hackage link with badge
  Use Some for more existential types (which should be efficient now that it is a newtype)
  Bump upper bounds
  Typo
  DRY conditional compilation
  Bump 'these' upper bound
  Typo
  Update changelog for holdDyn fix
  Make holdDyn lazy in its Event again
  ...
matthewbauer added a commit that referenced this pull request Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants