Skip to content

Make a record of SProxy of keys of a row type easily, and just plug in the inferred type when you're finished.

License

Notifications You must be signed in to change notification settings

justinwoo/purescript-xiaomian

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

purescript-xiaomian

Make a record of SProxy of keys of a row type easily, and just plug in the inferred type when you're finished.

Usage

See test/Main.purs

test :: Unit
test = do
  let
    expected = Proxy :: Proxy (RProxy ( a :: SProxy "a", b :: SProxy "b", c :: SProxy "c" ))
    actual = X.getKeysRow { a: 1, b: 2, c: 3 }
  expectInferred expected actual

test2 :: Unit
test2 = do
  let
    expected = Proxy :: Proxy ({ a :: SProxy "a", b :: SProxy "b", c :: SProxy "c" })
    actual = X.getKeysRecord { a: 1, b: 2, c: 3 }
  expectInferred expected actual

test3 :: Unit
test3 = do
  let
    expected = Proxy :: Proxy ({ a :: SProxy "a", b :: SProxy "b", c :: SProxy "c" })
    actual = X.getKeysRecord' (Proxy :: Proxy { a :: Int, b :: Int, c :: Int })
  expectInferred expected actual

About

Make a record of SProxy of keys of a row type easily, and just plug in the inferred type when you're finished.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published