Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleaned up fp-examples #68

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
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
11 changes: 11 additions & 0 deletions fp-examples/src/fp_core_examples/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
mod applicative_example;
mod comonad_example;
mod empty_example;
mod foldable_example;
mod function_composition_example;
mod functor_example;
mod lens_example;
mod monad_example;
mod monoid_example;
mod semigroup_example;
mod setoid_example;
21 changes: 21 additions & 0 deletions fp-examples/src/fp_jargon/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
pub mod adt_example;
mod arity_example;
mod anamorphism_example;
mod catamorphism_example;
mod closure_example;
mod continuation_example;
mod contracts_example;
mod currying_example;
mod endomorphism_example;
mod hof_example;
mod idempotent_example;
mod isomorphism_example;
mod lambda_example;
mod option_example;
mod partial_application_example;
mod pointed_functor_example;
mod predicate_example;
mod purity_example;
mod referential_transparency_example;
mod side_effects_example;
mod type_signature_example;
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fn type_signature_example() {

// call :: (a -> b) -> a -> b
#[allow(dead_code)]
fn call<A, B>(f: &Fn(A) -> B) -> impl Fn(A) -> B + '_ {
fn call<A, B>(f: &(dyn Fn(A) -> B)) -> impl Fn(A) -> B + '_ {
move |x| f(x)
}

Expand All @@ -26,7 +26,7 @@ fn type_signature_example() {

// map :: (a -> b) -> [a] -> [b]
#[allow(dead_code)]
fn map<A, B>(f: &Fn(A) -> B) -> impl Fn(A) -> B + '_ {
fn map<A, B>(f: &(dyn Fn(A) -> B)) -> impl Fn(A) -> B + '_ {
move |x| f(x)
}
}
File renamed without changes.
34 changes: 2 additions & 32 deletions fp-examples/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,8 @@ extern crate partial_application;
#[macro_use]
extern crate fp_core;

pub mod adt_example;
mod anamorphism_example;
mod applicative_example;
mod arity_example;
mod catamorphism_example;
mod closure_example;
mod comonad_example;
mod continuation_example;
mod contracts_example;
mod currying_example;
mod empty_example;
mod endomorphism_example;
mod foldable_example;
mod function_composition_example;
mod functor_example;
mod hof_example;
mod idempotent_example;
mod isomorphism_example;
mod lambda_example;
mod lens_example;
mod monad_example;
mod monoid_example;
mod option_example;
mod partial_application_example;
mod pointed_functor_example;
mod predicate_example;
mod purity_example;
mod referential_transparency_example;
mod semigroup_example;
mod setoid_example;
mod side_effects_example;
mod type_signature_example;
mod fp_core_examples;
mod fp_jargon;

fn main() {
println!("Welcome to fp-core!");
Expand Down