Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

composition in rust haskell and scheme

Name: Anonymous 2015-07-17 12:43

Rust:
// This function accepts any two functions and composes them into a single function accepting the
// input type for the first function and returning the output type of the second function.
fn compose<'f, T1, T2, T3, F1, F2>(a: F1, b: F2) -> Box<Fn(T1) -> T3 + 'f>
where F1: Fn(T1) -> T2 + 'f,
F2: Fn(T2) -> T3 + 'f
{
box move |input| b(a(input))
}


Haskell:
compose f g x = f (g x)

Scheme:
(define (compose f g)
(lambda (x)
(f (g x))))

Name: Anonymous 2015-07-17 13:17

Symta:
compose F G = X => F (G X)

Name: Anonymous 2015-07-17 14:51

Rust is the only choice in these, since it's the only one that don't have GC.

GC is shit.

Name: Anonymous 2015-07-17 15:20

>>3
interesting post

Name: Anonymous 2015-07-17 15:21

>>3
you're a shitposter trying to force a retarded meme but actually came up with an interesting point by complete accident

Name: Anonymous 2015-07-17 15:24

>>5
complaining about forcing these ``retarded memes'' when there's some retard around throwing >meme arrows, plebs, cucks and shills shows how much of a dumbfuck you are

Name: Anonymous 2015-07-17 15:26

>>3
it's the only one that don't have GC.
What about Symta? It doesn't have GC.

Name: Anonymous 2015-07-17 16:15

>>6
you're one of those jp shits who is so autistic they can't cope with someone using > in a way you don't prescribe. absolutely pathetic.

Name: Anonymous 2015-07-17 16:32

Agda:
_○_ : {A : Set} {B : A -> Set} {C : (x : A) -> B x -> Set}
(f : {x : A} (y : B x) -> C x y) (g : (x : A) -> B x)
(x : A) -> C x (g x)
(f ○ g) x = f (g x)

Name: Anonymous 2015-07-17 16:38

>>8
you're one of those g shits who is so autistic they can't cope with someone using GC is shit in a way you don't prescribe. absolutely pathetic.

Learn to capitalize, retard.

Name: Anonymous 2015-07-17 17:04

>>9
heh

Name: Anonymous 2015-07-17 17:45

C:
#define shit(a, ar, b, br) \
br useless_function_in_real_world(ar){
return b(a(ar));
}

Name: Anonymous 2015-07-17 18:55

In go it's only possible by doing runtime type checking, not going to go through the motions here

Name: Anonymous 2015-07-17 19:36

useless_function_in_real_world

L E L, EPIC

Function composition is USELESS

FUCK OFF BACK OT YORU MATH BOOKS FAGETS

Name: SAGE 2015-07-17 20:17

E G I N
G
I
N

Name: Anonymous 2015-07-17 20:56

>>14

Compose your functions at compile time, come at me bra

Name: Anonymous 2015-07-17 21:07

Man, Rust have some cool features, but why its syntax is so fucking ugly?

DISCLAIMER: FYI I'm not a ``FIOCfag'', and I even considere C++ metaprogramming syntax acceptable.

Name: Anonymous 2015-07-17 23:23

>>17
B-but if Rust isn't ugly, it might become mainstream!

Name: Anonymous 2015-07-18 0:04

>>7
Symta doesn't pass the man or boy test, so I don't consider it a proper programming language.

Name: Anonymous 2015-07-18 1:51

>>19
Sʏᴍᴛᴀ is for boys, class is for men.

Name: Anonymous 2015-07-18 2:34

>>20
Gay men, perhaps.

Name: Anonymous 2015-07-19 2:45

Man, check these dubs, boys.

Name: Anonymous 2015-07-19 5:10

>>18
You've got to be ugly to be popular in the compiled languages arena. You want ~zero cost abstractions? You got hideous languages like Rust and C++. Even Java and C# are disgusting.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List