This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MAGIC CARD DESIGN | |
// type color = | |
// | Blue | |
// | Green | |
// | Red | |
// | Black | |
// | White | |
// type card_color = | |
// | Colored of color |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// function used to compose | |
fn compose_two<A, B, C, G, F>(f: F, g: G) -> impl Fn(A) -> C | |
where | |
F: Fn(A) -> B, | |
G: Fn(B) -> C, | |
{ | |
move |x| g(f(x)) | |
} | |
fn pipe_two<A, B, F>(a : A, f: F) -> B |