Skip to content

Commit

Permalink
refactor(curry): move interface to types folder
Browse files Browse the repository at this point in the history
  • Loading branch information
tusharmath committed Oct 15, 2016
1 parent 300113c commit d9d12b0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/lib/Curry.ts
Expand Up @@ -2,9 +2,8 @@
* Created by tushar.mathur on 15/10/16.
*/

export interface ICurryFunction<T> {
(...k: any[]): T | ICurryFunction<T>
}

import {ICurryFunction} from '../types/ICurryFunction'

export function Curry <T, R> (f: ICurryFunction<T>): ICurryFunction<T> {
return function curried (...t: any[]): T | ICurryFunction<T> {
Expand Down
7 changes: 7 additions & 0 deletions src/types/ICurryFunction.ts
@@ -0,0 +1,7 @@
/**
* Created by tushar.mathur on 15/10/16.
*/

export interface ICurryFunction<T> {
(...k: any[]): T | ICurryFunction<T>
}
3 changes: 2 additions & 1 deletion test/test.Curry.ts
Expand Up @@ -3,7 +3,8 @@
*/

import test from 'ava'
import {Curry, ICurryFunction} from '../src/lib/Curry'
import {Curry} from '../src/lib/Curry'
import {ICurryFunction} from '../src/types/ICurryFunction'

const func = Curry<number[], number>(
(a: number, b: number, c: number) => [a, b, c]
Expand Down

0 comments on commit d9d12b0

Please sign in to comment.