https://github.com/sigma-andex/purescript-typelevel-arithmetic
Fast typelevel arithmetic 🧮 using symbols
https://github.com/sigma-andex/purescript-typelevel-arithmetic
typelevel typelevel-programming
Last synced: 7 months ago
JSON representation
Fast typelevel arithmetic 🧮 using symbols
- Host: GitHub
- URL: https://github.com/sigma-andex/purescript-typelevel-arithmetic
- Owner: sigma-andex
- License: mit-0
- Created: 2021-08-11T19:20:40.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-21T13:34:24.000Z (almost 4 years ago)
- Last Synced: 2025-02-07T21:26:21.647Z (12 months ago)
- Topics: typelevel, typelevel-programming
- Language: PureScript
- Homepage:
- Size: 37.1 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# purescript-typelevel-arithmetic 🧮
**DEPRECATED**: Purescript v0.15.0 now provides typelevel integers with compiler solved typeclasses, so there is no need anymore to use symbol-based arithmetic.
Arithmetic at the typelevel using symbols.
```purescript
add ∷
∀ augend addend sum carry result.
Add augend addend carry sum ⇒
Cons carry sum result ⇒
Proxy augend → Proxy addend → Proxy result
add _ _ = Proxy
result ∷ Proxy "0579"
result = add (term ∷ _ "123") (term ∷ _ "456")
```