https://github.com/justinwoo/purescript-mochi
Make yourself a record by stretching out the rows!
https://github.com/justinwoo/purescript-mochi
purescript
Last synced: 5 months ago
JSON representation
Make yourself a record by stretching out the rows!
- Host: GitHub
- URL: https://github.com/justinwoo/purescript-mochi
- Owner: justinwoo
- License: mit
- Created: 2018-12-04T12:12:49.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-12-04T23:34:00.000Z (over 6 years ago)
- Last Synced: 2025-01-27T04:05:58.351Z (6 months ago)
- Topics: purescript
- Language: PureScript
- Homepage:
- Size: 2.93 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PureScript-Mochi
Make yourself a record by stretching out the rows!

## Example
```purs
type Fruits =
{ apple :: Int
, banana :: String
, cherry :: Boolean
}-- IDE inferred type signature:
mkFruits
:: Int
-> String
-> Boolean
-> { apple :: Int
, banana :: String
, cherry :: Boolean
}
mkFruits = constructRecord (Proxy :: Proxy Fruits)main :: Effect Unit
main = do
let (fruits :: Fruits) = { apple: 1, banana: "a", cherry: true }
assertEqual
{ expected: fruits
, actual: mkFruits 1 "a" true
}
```