Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/evanrelf/recto
Toy anonymous records
https://github.com/evanrelf/recto
Last synced: 12 days ago
JSON representation
Toy anonymous records
- Host: GitHub
- URL: https://github.com/evanrelf/recto
- Owner: evanrelf
- License: isc
- Created: 2023-07-22T07:39:43.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-03T03:23:35.000Z (11 months ago)
- Last Synced: 2024-12-24T00:38:02.702Z (16 days ago)
- Language: Haskell
- Homepage:
- Size: 52.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# recto
Toy anonymous records. See [verso] for anonymous variants.
## Example
```haskell
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE OverloadedLabels #-}
{-# LANGUAGE OverloadedRecordDot #-}
{-# LANGUAGE TypeOperators #-}import Recto
type Person = Record
[ "firstName" ::: String
, "lastName" ::: String
, "likesDogs" ::: Bool
]evan :: Person
evan = record
( #firstName := "Evan"
, #lastName := "Relf"
, #likesDogs := True
)fullName
:: ["firstName" ::: String, "lastName" ::: String] :| r
=> Record r
-> String
fullName r = r.firstName <> " " <> r.lastNamegreet :: Person -> IO ()
greet person = putStrLn $ "Hello, " <> fullName person <> "!"
```[verso]: https://github.com/evanrelf/verso