__Function composition__ is a mathematical operation that mainly presents itself in lambda calculus and computability. It is explained well [here](http://www.mathsisfun.com/sets/functions-composition.html), but this is my explanation, in simple mathematical notation:

```
f3 = compose( f1 f2 )
   Is equivalent to...
f3(a) = f1( f2( a ) )
```

Your task is to create a `compose` function to carry out this task, which will be passed two functions or lambdas. Ruby functions will be passed, and should return, either a proc or a lambda. Remember that the resulting composed function may be passed multiple arguments!

```python
compose(f , g)(x)
=> f( g( x ) )
```

This kata is not available in haskell; that would be too easy!

Source: codewars | Difficulty: EASY
Tags: Fundamentals

Starter code: def compose(f,g):
	

Solutions:
def compose(f, g):
	return lambda *x: f(g(*x))


def pow(x, y):
	return x ** y
printPow = compose(print, pow)
lambda *x: print(pow(*x))
printPow(2, 3)
print(pow(*[2, 3]))
print(pow(2, 3))


def compose(f, g):
	return lambda *args: f(g(*args))


def compose(f, g):

	def z(*arg, **kw):
		return f(g(*arg, **kw))
	return z


def compose(f, g):

	def composing(*args, **kwargs):
		return f(g(*args, **kwargs))
	return composing


def compose(f, g):

	def newfunc(*args):
		return f(g(*args))
	return newfunc


def compose(f, g):
	return lambda *a, **kw: f(g(*a, **kw))


def compose(f, g):

	def h(*args, **kwargs):
		return f(g(*args, **kwargs))
	return h


def compose(f, g):

	def inner(*args, **kwargs):
		return f(g(*args, **kwargs))
	return inner


def compose(*func):
	return C(func)

class C:

	def __init__(self, func):
		self.func = list(func)[::-1]

	def __call__(self, *value):
		value = sum(value)
		for f in self.func:
			value = f(value)
		return value