Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/justinwoo/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.
https://github.com/justinwoo/purescript-xiaomian
purescript type-level
Last synced: about 2 months ago
JSON representation
Make a record of SProxy of keys of a row type easily, and just plug in the inferred type when you're finished.
- Host: GitHub
- URL: https://github.com/justinwoo/purescript-xiaomian
- Owner: justinwoo
- License: mit
- Created: 2018-09-14T07:16:50.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-09-15T06:21:38.000Z (over 6 years ago)
- Last Synced: 2024-10-11T11:39:24.524Z (2 months ago)
- Topics: purescript, type-level
- Language: PureScript
- Homepage:
- Size: 2.93 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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.
![](https://i.imgur.com/HhmRpVb.jpg)
## Usage
See [test/Main.purs](./test/Main.purs)
```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 actualtest2 :: 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 actualtest3 :: 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
```