Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Referential
![example workflow](https://github.com/dvisockas/referential/actions/workflows/main.yml/badge.svg)

With Referential, you can convert your ruby methods into curried procs for use in composition, or as arguments to other methods, while still being able to call them directly!
Referential overrides default ruby method behaviour of raising `ArgumentError` when not all arguments are passed and returns (curried) procs instead.
This enables composition, pipelining, or just passing methods procs to other methods, while still being able to call them directly!

## Installation

Expand Down Expand Up @@ -48,7 +49,7 @@ class Operations
def square_and_add_two(x)
add_two(square(x))
end

def added_squares(list)
list.map { |x| add_two(square(x)) }
end
Expand All @@ -65,7 +66,7 @@ class Operations
# Or the other way around:
# (&add_two << square).call(x)
end

def added_squares(list)
list.map(&square >> add_two)
end
Expand Down