You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

177 lines
4.8 KiB

  1. // Generated by LiveScript 1.4.0
  2. var Func, List, Obj, Str, Num, id, isType, replicate, prelude, toString$ = {}.toString;
  3. Func = require('./Func.js');
  4. List = require('./List.js');
  5. Obj = require('./Obj.js');
  6. Str = require('./Str.js');
  7. Num = require('./Num.js');
  8. id = function(x){
  9. return x;
  10. };
  11. isType = curry$(function(type, x){
  12. return toString$.call(x).slice(8, -1) === type;
  13. });
  14. replicate = curry$(function(n, x){
  15. var i$, results$ = [];
  16. for (i$ = 0; i$ < n; ++i$) {
  17. results$.push(x);
  18. }
  19. return results$;
  20. });
  21. Str.empty = List.empty;
  22. Str.slice = List.slice;
  23. Str.take = List.take;
  24. Str.drop = List.drop;
  25. Str.splitAt = List.splitAt;
  26. Str.takeWhile = List.takeWhile;
  27. Str.dropWhile = List.dropWhile;
  28. Str.span = List.span;
  29. Str.breakStr = List.breakList;
  30. prelude = {
  31. Func: Func,
  32. List: List,
  33. Obj: Obj,
  34. Str: Str,
  35. Num: Num,
  36. id: id,
  37. isType: isType,
  38. replicate: replicate
  39. };
  40. prelude.each = List.each;
  41. prelude.map = List.map;
  42. prelude.filter = List.filter;
  43. prelude.compact = List.compact;
  44. prelude.reject = List.reject;
  45. prelude.partition = List.partition;
  46. prelude.find = List.find;
  47. prelude.head = List.head;
  48. prelude.first = List.first;
  49. prelude.tail = List.tail;
  50. prelude.last = List.last;
  51. prelude.initial = List.initial;
  52. prelude.empty = List.empty;
  53. prelude.reverse = List.reverse;
  54. prelude.difference = List.difference;
  55. prelude.intersection = List.intersection;
  56. prelude.union = List.union;
  57. prelude.countBy = List.countBy;
  58. prelude.groupBy = List.groupBy;
  59. prelude.fold = List.fold;
  60. prelude.foldl = List.foldl;
  61. prelude.fold1 = List.fold1;
  62. prelude.foldl1 = List.foldl1;
  63. prelude.foldr = List.foldr;
  64. prelude.foldr1 = List.foldr1;
  65. prelude.unfoldr = List.unfoldr;
  66. prelude.andList = List.andList;
  67. prelude.orList = List.orList;
  68. prelude.any = List.any;
  69. prelude.all = List.all;
  70. prelude.unique = List.unique;
  71. prelude.uniqueBy = List.uniqueBy;
  72. prelude.sort = List.sort;
  73. prelude.sortWith = List.sortWith;
  74. prelude.sortBy = List.sortBy;
  75. prelude.sum = List.sum;
  76. prelude.product = List.product;
  77. prelude.mean = List.mean;
  78. prelude.average = List.average;
  79. prelude.concat = List.concat;
  80. prelude.concatMap = List.concatMap;
  81. prelude.flatten = List.flatten;
  82. prelude.maximum = List.maximum;
  83. prelude.minimum = List.minimum;
  84. prelude.maximumBy = List.maximumBy;
  85. prelude.minimumBy = List.minimumBy;
  86. prelude.scan = List.scan;
  87. prelude.scanl = List.scanl;
  88. prelude.scan1 = List.scan1;
  89. prelude.scanl1 = List.scanl1;
  90. prelude.scanr = List.scanr;
  91. prelude.scanr1 = List.scanr1;
  92. prelude.slice = List.slice;
  93. prelude.take = List.take;
  94. prelude.drop = List.drop;
  95. prelude.splitAt = List.splitAt;
  96. prelude.takeWhile = List.takeWhile;
  97. prelude.dropWhile = List.dropWhile;
  98. prelude.span = List.span;
  99. prelude.breakList = List.breakList;
  100. prelude.zip = List.zip;
  101. prelude.zipWith = List.zipWith;
  102. prelude.zipAll = List.zipAll;
  103. prelude.zipAllWith = List.zipAllWith;
  104. prelude.at = List.at;
  105. prelude.elemIndex = List.elemIndex;
  106. prelude.elemIndices = List.elemIndices;
  107. prelude.findIndex = List.findIndex;
  108. prelude.findIndices = List.findIndices;
  109. prelude.apply = Func.apply;
  110. prelude.curry = Func.curry;
  111. prelude.flip = Func.flip;
  112. prelude.fix = Func.fix;
  113. prelude.over = Func.over;
  114. prelude.split = Str.split;
  115. prelude.join = Str.join;
  116. prelude.lines = Str.lines;
  117. prelude.unlines = Str.unlines;
  118. prelude.words = Str.words;
  119. prelude.unwords = Str.unwords;
  120. prelude.chars = Str.chars;
  121. prelude.unchars = Str.unchars;
  122. prelude.repeat = Str.repeat;
  123. prelude.capitalize = Str.capitalize;
  124. prelude.camelize = Str.camelize;
  125. prelude.dasherize = Str.dasherize;
  126. prelude.values = Obj.values;
  127. prelude.keys = Obj.keys;
  128. prelude.pairsToObj = Obj.pairsToObj;
  129. prelude.objToPairs = Obj.objToPairs;
  130. prelude.listsToObj = Obj.listsToObj;
  131. prelude.objToLists = Obj.objToLists;
  132. prelude.max = Num.max;
  133. prelude.min = Num.min;
  134. prelude.negate = Num.negate;
  135. prelude.abs = Num.abs;
  136. prelude.signum = Num.signum;
  137. prelude.quot = Num.quot;
  138. prelude.rem = Num.rem;
  139. prelude.div = Num.div;
  140. prelude.mod = Num.mod;
  141. prelude.recip = Num.recip;
  142. prelude.pi = Num.pi;
  143. prelude.tau = Num.tau;
  144. prelude.exp = Num.exp;
  145. prelude.sqrt = Num.sqrt;
  146. prelude.ln = Num.ln;
  147. prelude.pow = Num.pow;
  148. prelude.sin = Num.sin;
  149. prelude.tan = Num.tan;
  150. prelude.cos = Num.cos;
  151. prelude.acos = Num.acos;
  152. prelude.asin = Num.asin;
  153. prelude.atan = Num.atan;
  154. prelude.atan2 = Num.atan2;
  155. prelude.truncate = Num.truncate;
  156. prelude.round = Num.round;
  157. prelude.ceiling = Num.ceiling;
  158. prelude.floor = Num.floor;
  159. prelude.isItNaN = Num.isItNaN;
  160. prelude.even = Num.even;
  161. prelude.odd = Num.odd;
  162. prelude.gcd = Num.gcd;
  163. prelude.lcm = Num.lcm;
  164. prelude.VERSION = '1.1.2';
  165. module.exports = prelude;
  166. function curry$(f, bound){
  167. var context,
  168. _curry = function(args) {
  169. return f.length > 1 ? function(){
  170. var params = args ? args.concat() : [];
  171. context = bound ? context || this : this;
  172. return params.push.apply(params, arguments) <
  173. f.length && arguments.length ?
  174. _curry.call(context, params) : f.apply(context, params);
  175. } : f;
  176. };
  177. return _curry();
  178. }