https://github.com/axionbuster/varcomp
Variadic function composition (without hacks)
https://github.com/axionbuster/varcomp
design-patterns functional-programming haskell
Last synced: 9 months ago
JSON representation
Variadic function composition (without hacks)
- Host: GitHub
- URL: https://github.com/axionbuster/varcomp
- Owner: axionbuster
- License: bsd-3-clause
- Created: 2024-12-18T02:36:44.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-12-25T15:04:33.000Z (about 1 year ago)
- Last Synced: 2025-04-07T13:13:46.785Z (12 months ago)
- Topics: design-patterns, functional-programming, haskell
- Language: Haskell
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# `varcomp` -- Variadic function composition
Variadic function composition done via the `.**.` operator.
## Usage
```haskell
import Variadic.Composition ((.**.))
-- Simple composition
g :: Char -> String
g = const "hello"
-- One argument
f0 :: Int -> Char
f0 = undefined
h1 :: Int -> String
h1 = g .**. f0
-- Two arguments
f2 :: Int -> Double -> Char
f2 = undefined
h2 :: Int -> Double -> String
h2 = g .**. f2
-- Three arguments
f3 :: Int -> Double -> String -> Char
f3 = undefined
h3 :: Int -> Double -> String -> String
h3 = g .**. f3
```