Skip to content

Commit

Permalink
Drop deprecated use of RLProxy and SProxy (#144)
Browse files Browse the repository at this point in the history
* Drop deprecated use of `RLProxy`

* Also drop `SProxy`
  • Loading branch information
i-am-the-slime authored May 5, 2022
1 parent 4fb54fd commit 8b031f8
Showing 1 changed file with 6 additions and 6 deletions.
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)

0 comments on commit 8b031f8

Please sign in to comment.