Skip to content

Drop deprecated use of RLProxy #144

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

Merged
merged 2 commits into from
May 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/React/Basic/Events.purs
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ module React.Basic.Events
) where

import Prelude
import Data.Symbol (class IsSymbol, SProxy(SProxy))
import Data.Symbol (class IsSymbol)
import Effect (Effect)
import Effect.Uncurried (EffectFn1, mkEffectFn1)
import Prim.Row as Row
import Prim.RowList (class RowToList, RowList, Cons, Nil)
import Record (delete, get, insert)
import Type.Data.RowList (RLProxy(..))
import Type.Proxy (Proxy(..))

-- | An event handler, which receives a `SyntheticEvent` and performs some
-- | effects in return.
Expand Down Expand Up @@ -80,7 +80,7 @@ syntheticEvent :: EventFn SyntheticEvent SyntheticEvent
syntheticEvent = identity

class Merge (rl :: RowList Type) fns a r | rl -> fns, rl a -> r where
mergeImpl :: RLProxy rl -> Record fns -> EventFn a (Record r)
mergeImpl :: Proxy rl -> Record fns -> EventFn a (Record r)

instance mergeNil :: Merge Nil () a () where
mergeImpl _ _ = EventFn \_ -> {}
Expand All @@ -97,13 +97,13 @@ instance mergeCons ::
mergeImpl _ fns =
EventFn \a ->
let
EventFn inner = mergeImpl (RLProxy :: RLProxy rest) (delete l fns)
EventFn inner = mergeImpl (Proxy :: Proxy rest) (delete l fns)

EventFn f = get l fns
in
insert l (f a) (inner a)
where
l = SProxy :: SProxy l
l = Proxy :: Proxy l

-- | Merge multiple `EventFn` operations and collect their results.
-- |
Expand All @@ -120,4 +120,4 @@ merge ::
Merge fns_list fns a r =>
Record fns ->
EventFn a (Record r)
merge = mergeImpl (RLProxy :: RLProxy fns_list)
merge = mergeImpl (Proxy :: Proxy fns_list)