Rename prop -> effProp

This commit is contained in:
Vladimir Kalnitsky 2020-09-12 22:35:17 +03:00
parent d35b4e5217
commit 4feee12b76
2 changed files with 15 additions and 15 deletions

View File

@ -21,34 +21,34 @@ import Untagged.Union (type (|+|))
import Node.Buffer (Buffer) import Node.Buffer (Buffer)
import Playwright.Data import Playwright.Data
import Playwright.Options import Playwright.Options
import Playwright.Internal (prop) import Playwright.Internal (effProp)
launch :: BrowserType -> Options Launch -> Aff Browser launch :: BrowserType -> Options Launch -> Aff Browser
launch bt = launch bt =
options >>> options >>>
prop "launch" (\_ -> launch) bt >>> effProp "launch" (\_ -> launch) bt >>>
toAffE toAffE
close :: Browser |+| BrowserContext |+| Page -> Aff Unit close :: Browser |+| BrowserContext |+| Page -> Aff Unit
close = close =
prop "close" (\_ -> close) >>> toAffE effProp "close" (\_ -> close) >>> toAffE
contexts :: Browser -> Effect (Array BrowserContext) contexts :: Browser -> Effect (Array BrowserContext)
contexts = contexts =
prop "contexts" (\_ -> contexts) effProp "contexts" (\_ -> contexts)
isConnected :: Browser -> Effect Boolean isConnected :: Browser -> Effect Boolean
isConnected = isConnected =
prop "isConnected" (\_ -> isConnected) effProp "isConnected" (\_ -> isConnected)
version :: Browser -> Effect String version :: Browser -> Effect String
version = version =
prop "version" (\_ -> version) effProp "version" (\_ -> version)
newPage :: Browser |+| BrowserContext -> Options Newpage -> Aff Page newPage :: Browser |+| BrowserContext -> Options Newpage -> Aff Page
newPage sth = newPage sth =
options >>> options >>>
prop "newPage" (\_ -> newPage) sth >>> effProp "newPage" (\_ -> newPage) sth >>>
toAffE toAffE
-- | `sth.$(selector)` -- | `sth.$(selector)`
@ -57,15 +57,15 @@ query
-> Selector -> Selector
-> Aff ElementHandle -> Aff ElementHandle
query sth = query sth =
toAffE <<< prop "$" (\_ -> query) sth toAffE <<< effProp "$" (\_ -> query) sth
-- | `sth.$$(selector) -- | `sth.$$(selector)`
queryMany queryMany
:: ElementHandle |+| Page |+| Frame :: ElementHandle |+| Page |+| Frame
-> Selector -> Selector
-> Aff (Array ElementHandle) -> Aff (Array ElementHandle)
queryMany sth = queryMany sth =
toAffE <<< prop "$$" (\_ -> queryMany) sth toAffE <<< effProp "$$" (\_ -> queryMany) sth
screenshot screenshot
:: ElementHandle |+| Page :: ElementHandle |+| Page
@ -73,10 +73,10 @@ screenshot
-> Aff Buffer -> Aff Buffer
screenshot sth = screenshot sth =
options >>> options >>>
prop "screenshot" (\_ -> screenshot) sth >>> effProp "screenshot" (\_ -> screenshot) sth >>>
toAffE toAffE
url url
:: Page |+| Frame |+| Download |+| Request |+| Response |+| Worker :: Page |+| Frame |+| Download |+| Request |+| Response |+| Worker
-> Effect String -> Effect String
url = prop "url" \_ -> url url = effProp "url" \_ -> url

View File

@ -1,7 +1,7 @@
module Playwright.Internal module Playwright.Internal
( class NumberOfArgs ( class NumberOfArgs
, numberOfArgs , numberOfArgs
, prop , effProp
) )
where where
@ -55,5 +55,5 @@ foreign import unsafeEffectfulGetter
-> Int -> Int
-> r -> r
prop :: forall f r. NumberOfArgs f => String -> (Unit -> f) -> r effProp :: forall f r. NumberOfArgs f => String -> (Unit -> f) -> r
prop p f = unsafeEffectfulGetter p (countArgs f) effProp p f = unsafeEffectfulGetter p (countArgs f)