Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: sledorze/hots
base: c29768d801
...
head fork: sledorze/hots
compare: cf27b5e6b0
Checking mergeability… Don't worry, you can still create the pull request.
  • 7 commits
  • 287 files changed
  • 0 commit comments
  • 1 contributor
Commits on Jul 29, 2012
@frabbit frabbit renamed TcRegistry to Registry
renamed TcContext to Resolver
renamed extension classes, trailing 's' like Arrays
added Function monoids and semigroups
clean up registry and resolver
8dee86a
Commits on Aug 07, 2012
@frabbit frabbit major overhaul, pre cleanup 0440643
Commits on Aug 09, 2012
@frabbit frabbit Add first new version
Added a few test cases
Error reporting must be improved
1cb8d80
Commits on Aug 10, 2012
@frabbit frabbit add ValidationTApplicative, ValidationTMonad
fixed some ValidationT errors
added ImplicitCasts + Objects
added Identity methods
added ValidationT Test
87cf988
@frabbit frabbit removed unnecessary type declaration 599d4e9
@frabbit frabbit small resolver fix
some eq tests
ca506b5
Commits on Aug 12, 2012
@frabbit frabbit removed OfT, seems unnessecary now
added tests
cf27b5e
Showing with 4,395 additions and 4,010 deletions.
  1. +3 −1 .gitignore
  2. +5 −4 commonTest.hxml
  3. +2 −0  runTestsCpp.bat
  4. +2 −0  runTestsCs.bat
  5. +4 −0 runTestsCs.hxml
  6. +2 −0  runTestsFlash.bat
  7. +4 −0 runTestsFlash.hxml
  8. +2 −0  runTestsJava.bat
  9. +4 −0 runTestsJava.hxml
  10. +2 −0  runTestsJs.bat
  11. +4 −0 runTestsJs.hxml
  12. +2 −0  runTestsNeko.bat
  13. +1 −1  runTestsNeko.hxml
  14. +2 −0  runTestsPhp.bat
  15. +4 −0 runTestsPhp.hxml
  16. +0 −55 samples/01_ArrayMonad/ArrayMonadSample.hx
  17. +0 −1  samples/01_ArrayMonad/main.hxml
  18. +0 −8 samples/01_ArrayMonad/neko.hxml
  19. +0 −51 samples/02_MonadTransformer/MonadTransformerSample.hx
  20. +0 −5 samples/02_MonadTransformer/all.hxml
  21. +0 −9 samples/02_MonadTransformer/cpp.hxml
  22. +0 −8 samples/02_MonadTransformer/flash.hxml
  23. +0 −7 samples/02_MonadTransformer/js.hxml
  24. +0 −1  samples/02_MonadTransformer/main.hxml
  25. +0 −9 samples/02_MonadTransformer/neko.hxml
  26. +0 −7 samples/02_MonadTransformer/php.hxml
  27. +0 −36 samples/03_Foldable/FoldableSample.hx
  28. +0 −5 samples/03_Foldable/all.hxml
  29. +0 −9 samples/03_Foldable/cpp.hxml
  30. +0 −8 samples/03_Foldable/flash.hxml
  31. +0 −7 samples/03_Foldable/js.hxml
  32. +0 −1  samples/03_Foldable/main.hxml
  33. +0 −9 samples/03_Foldable/neko.hxml
  34. +0 −7 samples/03_Foldable/php.hxml
  35. +0 −51 samples/04_Collection/CollectionSample.hx
  36. +0 −5 samples/04_Collection/all.hxml
  37. +0 −9 samples/04_Collection/cpp.hxml
  38. +0 −8 samples/04_Collection/flash.hxml
  39. +0 −7 samples/04_Collection/js.hxml
  40. +0 −1  samples/04_Collection/main.hxml
  41. +0 −9 samples/04_Collection/neko.hxml
  42. +0 −7 samples/04_Collection/php.hxml
  43. +0 −145 samples/05_Validation/ValidationSample.hx
  44. +0 −1  samples/05_Validation/main.hxml
  45. +0 −9 samples/05_Validation/neko.hxml
  46. +0 −68 samples/06_Monoid/MonoidSample.hx
  47. +0 −5 samples/06_Monoid/all.hxml
  48. +0 −9 samples/06_Monoid/cpp.hxml
  49. +0 −8 samples/06_Monoid/flash.hxml
  50. +0 −7 samples/06_Monoid/js.hxml
  51. +0 −1  samples/06_Monoid/main.hxml
  52. +0 −9 samples/06_Monoid/neko.hxml
  53. +0 −7 samples/06_Monoid/php.hxml
  54. +0 −73 samples/07_GenEq/GenEqSample.hx
  55. +0 −5 samples/07_GenEq/all.hxml
  56. +0 −9 samples/07_GenEq/cpp.hxml
  57. +0 −8 samples/07_GenEq/flash.hxml
  58. +0 −7 samples/07_GenEq/js.hxml
  59. +0 −1  samples/07_GenEq/main.hxml
  60. +0 −9 samples/07_GenEq/neko.hxml
  61. +0 −7 samples/07_GenEq/php.hxml
  62. +7 −0 src/hots/Hots.hx
  63. +94 −0 src/hots/Identity.hx
  64. +3 −0  src/hots/Implicit.hx
  65. +191 −0 src/hots/ImplicitCasts.hx
  66. +6 −0 src/hots/ImplicitConversion.hx
  67. +5 −0 src/hots/ImplicitObject.hx
  68. +419 −0 src/hots/Objects.hx
  69. +21 −19 src/hots/Of.hx
  70. +5 −0 src/hots/OfOf.hx
  71. +0 −8 src/hots/TC.hx
  72. +32 −9 src/hots/box/ArrayBox.hx
  73. +28 −0 src/hots/box/FastListBox.hx
  74. +20 −3 src/hots/box/FunctionBox.hx
  75. +0 −21 src/hots/box/FutureBox.hx
  76. +0 −1  src/hots/box/ImmutableListBox.hx
  77. +28 −0 src/hots/box/IoBox.hx
  78. +28 −0 src/hots/box/IterableBox.hx
  79. +10 −5 src/hots/box/LazyListBox.hx
  80. +32 −8 src/hots/box/OptionBox.hx
  81. +22 −0 src/hots/box/PromiseBox.hx
  82. +26 −0 src/hots/box/StdListBox.hx
  83. +19 −9 src/hots/box/Tup2Box.hx
  84. +15 −1 src/hots/box/ValidationBox.hx
  85. +1 −4 src/hots/classes/Alternative.hx
  86. +2 −2 src/hots/classes/Applicative.hx
  87. +1 −1  src/hots/classes/ApplicativeAbstract.hx
  88. +2 −2 src/hots/classes/Arrow.hx
  89. +8 −10 src/hots/classes/ArrowAbstract.hx
  90. +2 −2 src/hots/classes/ArrowZero.hx
  91. +10 −10 src/hots/classes/ArrowZeroAbstract.hx
  92. +5 −2 src/hots/classes/Category.hx
  93. +1 −1  src/hots/classes/CategoryAbstract.hx
  94. +6 −4 src/hots/classes/CoMonadAbstract.hx
  95. +2 −2 src/hots/classes/CoPointed.hx
  96. +3 −3 src/hots/classes/CoPointedAbstract.hx
  97. +2 −2 src/hots/classes/Collection.hx
  98. +1 −1  src/hots/classes/CollectionAbstract.hx
  99. +3 −2 src/hots/classes/Enumeration.hx
  100. +4 −3 src/hots/classes/EnumerationAbstract.hx
  101. +4 −2 src/hots/classes/Eq.hx
  102. +5 −7 src/hots/classes/EqAbstract.hx
  103. +2 −2 src/hots/classes/Foldable.hx
  104. +24 −24 src/hots/classes/FoldableAbstract.hx
  105. +2 −2 src/hots/classes/Functor.hx
  106. +1 −1  src/hots/classes/FunctorAbstract.hx
  107. +2 −2 src/hots/classes/Monad.hx
  108. +11 −8 src/hots/classes/MonadAbstract.hx
  109. +8 −8 src/hots/classes/MonadFailAbstract.hx
  110. +9 −9 src/hots/classes/MonadOrAbstract.hx
  111. +0 −3  src/hots/classes/MonadPlus.hx
  112. +19 −10 src/hots/classes/MonadPlusAbstract.hx
  113. +6 −3 src/hots/classes/MonadTrans.hx
  114. +2 −4 src/hots/classes/MonadTransAbstract.hx
  115. +16 −9 src/hots/classes/MonadZeroAbstract.hx
  116. +5 −2 src/hots/classes/Monoid.hx
  117. +7 −3 src/hots/classes/MonoidAbstract.hx
  118. +6 −5 src/hots/classes/NumAbstract.hx
  119. +19 −11 src/hots/classes/OrdAbstract.hx
  120. +2 −2 src/hots/classes/Pointed.hx
  121. +5 −2 src/hots/classes/PointedAbstract.hx
  122. +3 −2 src/hots/classes/Read.hx
  123. +2 −1  src/hots/classes/ReadAbstract.hx
  124. +2 −2 src/hots/classes/Semigroup.hx
  125. +1 −2  src/hots/classes/SemigroupAbstract.hx
  126. +3 −2 src/hots/classes/Show.hx
  127. +2 −1  src/hots/classes/ShowAbstract.hx
  128. +10 −9 src/hots/classes/TraversableAbstract.hx
  129. +3 −6 src/hots/extensions/{ApplicativeExt.hx → Applicatives.hx}
  130. +0 −35 src/hots/extensions/ArrayOfExt.hx
  131. +0 −27 src/hots/extensions/ArrowExt.hx
  132. +32 −0 src/hots/extensions/Arrows.hx
  133. +0 −12 src/hots/extensions/EqExt.hx
  134. +26 −0 src/hots/extensions/Eqs.hx
  135. +0 −23 src/hots/extensions/FoldableExt.hx
  136. +25 −0 src/hots/extensions/Foldables.hx
  137. +10 −0 src/hots/extensions/Functors.hx
  138. +0 −255 src/hots/extensions/MonadExt.hx
  139. +31 −0 src/hots/extensions/MonadTs.hx
  140. +15 −0 src/hots/extensions/MonadZeros.hx
  141. +154 −0 src/hots/extensions/Monads.hx
  142. +34 −0 src/hots/extensions/Monoids.hx
  143. +0 −22 src/hots/extensions/OptionEnumExt.hx
  144. +0 −43 src/hots/extensions/OptionOfExt.hx
  145. +17 −1 src/hots/extensions/{OrdExt.hx → Ords.hx}
  146. +0 −8 src/hots/extensions/ShowExt.hx
  147. +23 −0 src/hots/extensions/Shows.hx
  148. +0 −13 src/hots/extensions/StringClassExt.hx
  149. +3 −4 src/hots/instances/ArrayEq.hx
  150. +2 −1  src/hots/instances/ArrayMonoid.hx
  151. +8 −3 src/hots/instances/ArrayOfApplicative.hx
  152. +18 −25 src/hots/instances/ArrayOfCollection.hx
  153. +4 −2 src/hots/instances/ArrayOfFoldable.hx
  154. +1 −2  src/hots/instances/ArrayOfFunctor.hx
  155. +12 −3 src/hots/instances/ArrayOfMonad.hx
  156. +7 −4 src/hots/instances/ArrayOfMonadZero.hx
  157. +0 −18 src/hots/instances/ArrayOfMonoid.hx
  158. +3 −1 src/hots/instances/ArrayOfPointed.hx
  159. +4 −3 src/hots/instances/ArrayOfSemigroup.hx
  160. +6 −3 src/hots/instances/ArrayRead.hx
  161. +2 −1  src/hots/instances/ArraySemigroup.hx
  162. +6 −3 src/hots/instances/ArrayShow.hx
  163. +14 −12 src/hots/instances/ArrayTOfApplicative.hx
  164. +9 −13 src/hots/instances/ArrayTOfFunctor.hx
  165. +10 −9 src/hots/instances/ArrayTOfMonad.hx
  166. +4 −4 src/hots/instances/ArrayTOfPointed.hx
  167. +1 −1  src/hots/instances/BoolMonoid.hx
  168. +1 −4 src/hots/instances/BoolOrd.hx
  169. +0 −1  src/hots/instances/BoolSemigroup.hx
  170. +2 −1  src/hots/instances/BoolShow.hx
  171. +10 −8 src/hots/instances/DateEq.hx
  172. +6 −3 src/hots/instances/DateInDaysEnumeration.hx
  173. +6 −3 src/hots/instances/DateInWeeksEnumeration.hx
  174. +18 −9 src/hots/instances/DateOrd.hx
  175. +5 −3 src/hots/instances/DualMonoid.hx
  176. +5 −2 src/hots/instances/DualSemigroup.hx
  177. +7 −4 src/hots/instances/EitherApplicative.hx
  178. +4 −7 src/hots/instances/EitherEq.hx
  179. +5 −3 src/hots/instances/EitherMonad.hx
  180. +6 −4 src/hots/instances/EitherPointed.hx
  181. +27 −0 src/hots/instances/EitherSemigroup.hx
  182. +8 −2 src/hots/instances/EndoMonoid.hx
  183. +2 −1  src/hots/instances/EndoSemigroup.hx
  184. +8 −3 src/hots/instances/EnumByIndexEq.hx
  185. +5 −3 src/hots/instances/EnumByIndexOrd.hx
  186. +5 −3 src/hots/instances/FastListFoldable.hx
  187. +2 −3 src/hots/instances/FloatEq.hx
  188. +29 −11 src/hots/instances/FloatOrd.hx
  189. +12 −0 src/hots/instances/FloatShow.hx
  190. +24 −0 src/hots/instances/Function0Monoid.hx
  191. +22 −0 src/hots/instances/Function0Semigroup.hx
  192. +20 −0 src/hots/instances/Function1Functor.hx
  193. +23 −0 src/hots/instances/Function1Monoid.hx
  194. +21 −0 src/hots/instances/Function1Semigroup.hx
  195. +9 −7 src/hots/instances/FunctionArrow.hx
  196. +9 −7 src/hots/instances/FunctionCategory.hx
  197. +1 −1  src/hots/instances/{FunctionOf.hx → FunctionOfOf.hx}
  198. +0 −25 src/hots/instances/FutureMonoid.hx
  199. +0 −7 src/hots/instances/FutureOf.hx
  200. +0 −18 src/hots/instances/FutureOfFunctor.hx
  201. +4 −2 src/hots/instances/HashShow.hx
  202. +0 −11 src/hots/instances/IO.hx
  203. +5 −1 src/hots/instances/IntNum.hx
  204. +1 −1  src/hots/instances/IntOrd.hx
  205. +2 −1  src/hots/instances/IntProductMonoid.hx
  206. +2 −1  src/hots/instances/IntSumMonoid.hx
  207. +8 −2 src/hots/instances/IntSumSemigroup.hx
  208. +9 −0 src/hots/instances/IoOf.hx
  209. +26 −0 src/hots/instances/IoOfApplicative.hx
  210. +19 −0 src/hots/instances/IoOfFunctor.hx
  211. +20 −0 src/hots/instances/IoOfMonad.hx
  212. +25 −0 src/hots/instances/IoOfPointed.hx
  213. +1 −1  src/hots/instances/IterableOfFoldable.hx
  214. +2 −2 src/hots/instances/KleisliArrow.hx
  215. +7 −5 src/hots/instances/LazyListOfFoldable.hx
  216. +7 −0 src/hots/instances/LazyListTOf.hx
  217. +1 −1  src/hots/instances/ListOf.hx
  218. +7 −7 src/hots/instances/ListOfCollection.hx
  219. +4 −4 src/hots/instances/ListOfFoldable.hx
  220. +2 −6 src/hots/instances/OptionMonoid.hx
  221. +8 −7 src/hots/instances/OptionOfApplicative.hx
  222. +2 −1  src/hots/instances/OptionOfMonad.hx
  223. +4 −4 src/hots/instances/OptionOfMonadZero.hx
  224. +3 −2 src/hots/instances/OptionOfPointed.hx
  225. +6 −9 src/hots/instances/OptionSemigroup.hx
  226. +22 −0 src/hots/instances/OptionShow.hx
  227. +2 −2 src/hots/instances/OptionTOf.hx
  228. +20 −19 src/hots/instances/OptionTOfApplicative.hx
  229. +5 −4 src/hots/instances/OptionTOfFunctor.hx
  230. +11 −10 src/hots/instances/OptionTOfMonad.hx
  231. +3 −3 src/hots/instances/OptionTOfMonadZero.hx
  232. +4 −4 src/hots/instances/OptionTOfPointed.hx
  233. +4 −2 src/hots/instances/Predicate1Monoid.hx
  234. +2 −1  src/hots/instances/Predicate1Semigroup.hx
  235. +24 −0 src/hots/instances/PromiseMonoid.hx
  236. +7 −0 src/hots/instances/PromiseOf.hx
  237. +23 −0 src/hots/instances/PromiseOfApplicative.hx
  238. +19 −0 src/hots/instances/PromiseOfFunctor.hx
  239. +4 −6 src/hots/instances/{FutureSemigroup.hx → PromiseSemigroup.hx}
  240. +2 −1  src/hots/instances/StringMonoid.hx
  241. +1 −1  src/hots/instances/StringOrd.hx
  242. +25 −0 src/hots/instances/Tup2Eq.hx
  243. +0 −19 src/hots/instances/Tup2LeftFunctor.hx
  244. +1 −1  src/hots/instances/Tup2Monoid.hx
  245. +4 −2 src/hots/instances/Tup2Semigroup.hx
  246. +19 −0 src/hots/instances/Tup2_1Functor.hx
  247. +1 −1  src/hots/instances/{Tup2LeftOf.hx → Tup2_1Of.hx}
  248. +1 −1  src/hots/instances/{Tup2RightOf.hx → Tup2_2Of.hx}
  249. +0 −1  src/hots/instances/Tup3Monoid.hx
  250. +1 −1  src/hots/instances/Tup4Monoid.hx
  251. +0 −1  src/hots/instances/Tup4Semigroup.hx
  252. +28 −0 src/hots/instances/ValidationEq.hx
  253. +7 −3 src/hots/instances/{ValidationApplicative.hx → ValidationOfApplicative.hx}
  254. +1 −1  src/hots/instances/{ValidationFunctor.hx → ValidationOfFunctor.hx}
  255. +8 −4 src/hots/instances/{ValidationMonad.hx → ValidationOfMonad.hx}
  256. +7 −6 src/hots/instances/{ValidationMonadPlus.hx → ValidationOfMonadPlus.hx}
  257. +5 −3 src/hots/instances/{ValidationMonadZero.hx → ValidationOfMonadZero.hx}
  258. +9 −6 src/hots/instances/{ValidationPointed.hx → ValidationOfPointed.hx}
  259. +2 −2 src/hots/instances/ValidationSemigroup.hx
  260. +9 −0 src/hots/instances/ValidationTOf.hx
  261. +52 −0 src/hots/instances/ValidationTOfApplicative.hx
  262. +31 −0 src/hots/instances/ValidationTOfFunctor.hx
  263. +39 −0 src/hots/instances/ValidationTOfMonad.hx
  264. +38 −0 src/hots/instances/ValidationTOfPointed.hx
  265. +0 −277 src/hots/macros/Box.hx
  266. +0 −35 src/hots/macros/Data.hx
  267. +35 −0 src/hots/macros/HotsMacros.hx
  268. +46 −0 src/hots/macros/ImplicitInternal.hx
  269. +943 −0 src/hots/macros/ImplicitResolver.hx
  270. +0 −268 src/hots/macros/TcContext.hx
  271. +0 −333 src/hots/macros/TcRegistry.hx
  272. +39 −46 src/hots/macros/{ → generators}/GenEq.hx
  273. +4 −4 src/hots/macros/generators/GenEqAnon.hx
  274. +33 −24 src/hots/macros/generators/GenEqEnum.hx
  275. +0 −3  src/hots/macros/internal/UsingScope.hx
  276. +173 −0 src/hots/macros/syntax/DoGenForMonads.hx
  277. +0 −17 src/hots/macros/utils/Constants.hx
  278. +0 −666 src/hots/macros/utils/Utils.hx
  279. +25 −32 test/AllTests.hx
  280. +41 −0 test/hots/EqTest.hx
  281. +79 −0 test/hots/ImplicitScopeTests.hx
  282. +116 −0 test/hots/MonadTransformersTest.hx
  283. +49 −0 test/hots/MonadsTest.hx
  284. +85 −0 test/hots/UnderscoreTests.hx
  285. +40 −0 test/hots/instances/ArrayOfMonadTest.hx
  286. +0 −117 test/hots/macros/BoxTest.hx
  287. +0 −308 test/hots/macros/utils/UtilsTest.hx
View
4 .gitignore
@@ -19,4 +19,6 @@
/samples/07_GenEq/_scuts_cache
/samples/05_Validation/_scuts_cache
/samples/05_Validation/bin
-/samples/06_Monoid/bin
+/samples/06_Monoid/bin
+/samples/08_Underscore/_scuts_cache
+/samples/08_Underscore/bin
View
9 commonTest.hxml
@@ -3,8 +3,9 @@
-cp ./../scutsMcore/src
-cp ./../scutsCore/src
-cp ./../scutsMacros/src
+-cp ./../scutsData/src
-lib utest
-#--connect 127.0.0.1:8889
-
---times
--D macrotimes
+--connect 127.0.0.1:1978
+#-D scutsDebug
+#--times
+#-D macrotimes
View
2  runTestsCpp.bat
@@ -0,0 +1,2 @@
+cd hots
+haxe runTestsCpp.hxml
View
2  runTestsCs.bat
@@ -0,0 +1,2 @@
+cd hots
+haxe runTestsCs.hxml
View
4 runTestsCs.hxml
@@ -0,0 +1,4 @@
+commonTest.hxml
+-main AllTests
+-cs bin/test/cs
+
View
2  runTestsFlash.bat
@@ -0,0 +1,2 @@
+cd hots
+haxe runTestsFlash.hxml
View
4 runTestsFlash.hxml
@@ -0,0 +1,4 @@
+commonTest.hxml
+-main AllTests
+-swf bin/test/testFlash.swf
+
View
2  runTestsJava.bat
@@ -0,0 +1,2 @@
+cd hots
+haxe runTestsJava.hxml
View
4 runTestsJava.hxml
@@ -0,0 +1,4 @@
+commonTest.hxml
+-main AllTests
+-java bin/test/java
+
View
2  runTestsJs.bat
@@ -0,0 +1,2 @@
+cd hots
+haxe runTestsJs.hxml
View
4 runTestsJs.hxml
@@ -0,0 +1,4 @@
+commonTest.hxml
+-main AllTests
+-js bin/test/testJs.js
+
View
2  runTestsNeko.bat
@@ -0,0 +1,2 @@
+cd hots
+haxe runTestsNeko.hxml
View
2  runTestsNeko.hxml
@@ -1,4 +1,4 @@
commonTest.hxml
-main AllTests
--neko bin/test/testNeko.n
+-x bin/test/testNeko.n
View
2  runTestsPhp.bat
@@ -0,0 +1,2 @@
+cd hots
+haxe runTestsPhp.hxml
View
4 runTestsPhp.hxml
@@ -0,0 +1,4 @@
+commonTest.hxml
+-main AllTests
+-php bin/test/php
+
View
55 samples/01_ArrayMonad/ArrayMonadSample.hx
@@ -1,55 +0,0 @@
-package ;
-
-
-
-import hots.classes.Monad;
-import hots.classes.MonadZero;
-import hots.In;
-import hots.instances.ArrayOfMonad;
-import hots.instances.ArrayOfMonadZero;
-
-using hots.extensions.MonadExt;
-using hots.macros.TcContext;
-using hots.macros.Box;
-
-class ArrayMonadSample
-{
-
-
- public static function main ()
- {
- var a = [1,2,3].box();
- var b = [3,4,5].box();
-
- var m = a.tc(Monad); // ArrayMonad.get()
-
- var res = m.runDo(
- x <= a,
- y <= b,
- return x + y
- );
- /*
- m.flatMap(a, function (x) {
- return m.flatMap(b, function (y) {
- return m.pure(x + y);
- })
- });
- */
-
- trace(res);
-
- var mz = a.tc(MonadZero);
-
- var res2 = mz.runDo(
- x <= a,
- filter(x > 2),
- y <= b,
- return x + y
- );
-
- trace(res2);
-
- }
-
-
-}
View
1  samples/01_ArrayMonad/main.hxml
@@ -1 +0,0 @@
--main ArrayMonadSample
View
8 samples/01_ArrayMonad/neko.hxml
@@ -1,8 +0,0 @@
-main.hxml
--cp ../../src
--cp ../../../scutsCore/src
--cp ../../../hots/src
--cp ../../../scutsMacros/src
--cp ../../../scutsMCore/src
--cp .
--x bin/Example
View
51 samples/02_MonadTransformer/MonadTransformerSample.hx
@@ -1,51 +0,0 @@
-package ;
-
-
-using hots.macros.Box;
-using hots.macros.TcContext;
-
-import scuts.core.extensions.Options;
-import scuts.core.types.Option;
-import hots.classes.Monad;
-import hots.classes.MonadZero;
-import hots.instances.ArrayOfMonad;
-import hots.instances.ArrayOfMonadZero;
-import hots.instances.OptionTOfMonad;
-import hots.instances.OptionTOfMonadZero;
-
-using hots.extensions.MonadExt;
-
-class MonadTransformerSample
-{
-
- public static function main () {
- var a = [Some(5), Some(7), Some(2)].box(2);
- var b = [Some(2), Some(3), Some(1)].box(2);
-
- var m = a.tc(Monad); // ArrayTMonad.get(OptionMonad.get())
-
- var res = m.runDo(
- x <= a,
- y <= b,
- return x + y
- );
-
-
- trace(res);
-
- var mz = a.tc(MonadZero);
-
- var res2 = mz.runDo(
- x <= a,
- filter(x > 2),
- y <= b,
- return x + y
- );
-
- trace(res2);
-
-
- }
-
-
-}
View
5 samples/02_MonadTransformer/all.hxml
@@ -1,5 +0,0 @@
-neko.hxml
-cpp.hxml
-flash.hxml
-js.hxml
-php.hxml
View
9 samples/02_MonadTransformer/cpp.hxml
@@ -1,9 +0,0 @@
-main.hxml
--cp ../../src
--cp ../../../scutsCore/src
--cp ../../../hots/src
--cp ../../../scutsMacros/src
--cp ../../../scutsMCore/src
--cpp bin/cpp
---next
--cmd bin\cpp\ListSample.exe
View
8 samples/02_MonadTransformer/flash.hxml
@@ -1,8 +0,0 @@
-main.hxml
--cp ../../src
--cp ../../../scutsCore/src
--cp ../../../hots/src
--cp ../../../scutsMacros/src
--cp ../../../scutsMCore/src
--swf-header 1200:900:31:FFFFFF
--swf bin/Example.swf
View
7 samples/02_MonadTransformer/js.hxml
@@ -1,7 +0,0 @@
-main.hxml
--cp ../../src
--cp ../../../scutsCore/src
--cp ../../../hots/src
--cp ../../../scutsMacros/src
--cp ../../../scutsMCore/src
--js bin/Example.js
View
1  samples/02_MonadTransformer/main.hxml
@@ -1 +0,0 @@
--main MonadTransformerSample
View
9 samples/02_MonadTransformer/neko.hxml
@@ -1,9 +0,0 @@
-main.hxml
--cp ../../src
--cp ../../../scutsCore/src
-
--cp ../../../hots/src
--cp ../../../scutsMacros/src
--cp ../../../scutsMCore/src
--cp .
--x bin/Example
View
7 samples/02_MonadTransformer/php.hxml
@@ -1,7 +0,0 @@
--main.hxml
--cp ../../src
--cp ../../../scutsCore/src
--cp ../../../hots/src
--cp ../../../scutsMacros/src
--cp ../../../scutsMCore/src
--php bin/php
View
36 samples/03_Foldable/FoldableSample.hx
@@ -1,36 +0,0 @@
-package ;
-
-
-import hots.classes.Foldable;
-import hots.Of;
-import hots.instances.ArrayOfFoldable;
-import hots.instances.ListOfFoldable;
-
-using hots.macros.TcContext;
-using hots.macros.Box;
-
-class FoldableSample
-{
-
- public static function genericFoldLeft <M,T, Acc>(of:Of<M,T>, f:Foldable<M>, fn:Acc->T->Acc, acc:Acc):Acc
- {
- return f.foldLeft(of, acc, fn);
- }
-
- public static function main () {
- var arrOf = [2,3,4].box();
-
- var list = new List();
- list.add(3); list.add(2); list.add(1);
-
- var listOf = list.box();
-
- var fn = function (acc, e) return acc + e;
-
- trace(genericFoldLeft(arrOf, arrOf.tc(Foldable), fn, 0));
- trace(genericFoldLeft(listOf, listOf.tc(Foldable), fn, 0));
-
- }
-
-
-}
View
5 samples/03_Foldable/all.hxml
@@ -1,5 +0,0 @@
-neko.hxml
-cpp.hxml
-flash.hxml
-js.hxml
-php.hxml
View
9 samples/03_Foldable/cpp.hxml
@@ -1,9 +0,0 @@
-main.hxml
--cp ../../src
--cp ../../../scutsCore/src
--cp ../../../hots/src
--cp ../../../scutsMacros/src
--cp ../../../scutsMCore/src
--cpp bin/cpp
---next
--cmd bin\cpp\ListSample.exe
View
8 samples/03_Foldable/flash.hxml
@@ -1,8 +0,0 @@
-main.hxml
--cp ../../src
--cp ../../../scutsCore/src
--cp ../../../hots/src
--cp ../../../scutsMacros/src
--cp ../../../scutsMCore/src
--swf-header 1200:900:31:FFFFFF
--swf bin/Example.swf
View
7 samples/03_Foldable/js.hxml
@@ -1,7 +0,0 @@
-main.hxml
--cp ../../src
--cp ../../../scutsCore/src
--cp ../../../hots/src
--cp ../../../scutsMacros/src
--cp ../../../scutsMCore/src
--js bin/Example.js
View
1  samples/03_Foldable/main.hxml
@@ -1 +0,0 @@
--main FoldableSample
View
9 samples/03_Foldable/neko.hxml
@@ -1,9 +0,0 @@
-main.hxml
--cp ../../src
--cp ../../../scutsCore/src
-
--cp ../../../hots/src
--cp ../../../scutsMacros/src
--cp ../../../scutsMCore/src
--cp .
--x bin/Example.n
View
7 samples/03_Foldable/php.hxml
@@ -1,7 +0,0 @@
--main.hxml
--cp ../../src
--cp ../../../scutsCore/src
--cp ../../../hots/src
--cp ../../../scutsMacros/src
--cp ../../../scutsMCore/src
--php bin/php
View
51 samples/04_Collection/CollectionSample.hx
@@ -1,51 +0,0 @@
-package ;
-
-import hots.classes.Collection;
-import hots.classes.Foldable;
-import hots.Of;
-import hots.instances.ArrayOfCollection;
-import hots.instances.ListOfCollection;
-
-using hots.macros.TcContext;
-using hots.macros.Box;
-
-
-class CollectionSample
-{
-
-
-
- public static function main ()
- {
- var arrOf = [2,3,4].box();
-
- var list = new List();
- list.add(3); list.add(2); list.add(1);
-
- var listOf = list.box();
-
-
-
- trace(insertIntoCollection(arrOf, arrOf.tc(Collection), 7));
- trace(insertIntoCollection(listOf, listOf.tc(Collection), 10));
-
-
-
- }
-
-
- public static function insertIntoCollection <M,T>(of:Of<M,T>, c:Collection<M>, el:T):Of<M,T>
- {
- return c.insert(of, el);
- }
-
- public static function removeFromCollection <M,T>(of:Of<M,T>, c:Collection<M>, remove:T->Bool):Of<M,T>
- {
- return c.remove(of, remove);
- }
-
-}
-// hots.instances.ArrayTOf<hots.Of<scuts.core.types.Option<hots.In>, scuts.core.types.Option<hots.In>>, Int>
-
-
-
View
5 samples/04_Collection/all.hxml
@@ -1,5 +0,0 @@
-neko.hxml
-cpp.hxml
-flash.hxml
-js.hxml
-php.hxml
View
9 samples/04_Collection/cpp.hxml
@@ -1,9 +0,0 @@
-main.hxml
--cp ../../src
--cp ../../../scutsCore/src
--cp ../../../hots/src
--cp ../../../scutsMacros/src
--cp ../../../scutsMCore/src
--cpp bin/cpp
---next
--cmd bin\cpp\ListSample.exe
View
8 samples/04_Collection/flash.hxml
@@ -1,8 +0,0 @@
-main.hxml
--cp ../../src
--cp ../../../scutsCore/src
--cp ../../../hots/src
--cp ../../../scutsMacros/src
--cp ../../../scutsMCore/src
--swf-header 1200:900:31:FFFFFF
--swf bin/Example.swf
View
7 samples/04_Collection/js.hxml
@@ -1,7 +0,0 @@
-main.hxml
--cp ../../src
--cp ../../../scutsCore/src
--cp ../../../hots/src
--cp ../../../scutsMacros/src
--cp ../../../scutsMCore/src
--js bin/Example.js
View
1  samples/04_Collection/main.hxml
@@ -1 +0,0 @@
--main CollectionSample
View
9 samples/04_Collection/neko.hxml
@@ -1,9 +0,0 @@
-main.hxml
--cp ../../src
--cp ../../../scutsCore/src
-
--cp ../../../hots/src
--cp ../../../scutsMacros/src
--cp ../../../scutsMCore/src
--cp .
--x bin/Example.n
View
7 samples/04_Collection/php.hxml
@@ -1,7 +0,0 @@
--main.hxml
--cp ../../src
--cp ../../../scutsCore/src
--cp ../../../hots/src
--cp ../../../scutsMacros/src
--cp ../../../scutsMCore/src
--php bin/php
View
145 samples/05_Validation/ValidationSample.hx
@@ -1,145 +0,0 @@
-package ;
-
-
-using hots.macros.TcContext;
-
-using scuts.core.extensions.Arrays;
-
-import hots.classes.Monad;
-import hots.classes.MonoidAbstract;
-import hots.classes.Semigroup;
-import hots.instances.ValidationMonad;
-import hots.instances.ValidationSemigroup;
-
-//import hots.instances.ValidationMonadPlus;
-import scuts.core.types.Validation;
-import hots.classes.SemigroupAbstract;
-
-import hots.instances.ArrayMonoid;
-import hots.Of;
-
-using scuts.core.extensions.Validations;
-
-using hots.extensions.MonadExt;
-
-using hots.box.ValidationBox;
-
-enum MultiError<T> {
- Simple(e:T);
- Multiple(a:Array<T>);
-}
-
-class MultiErrorSemigroup<X> extends SemigroupAbstract<MultiError<X>> {
- public function new () { }
-
- override public function append (e1:MultiError<X>, e2:MultiError<X>):MultiError<X> {
- return switch (e1) {
- case Multiple(a1): switch (e2)
- {
- case Multiple(a2): Multiple(a1.concat(a2));
- case Simple(a2): Multiple(a1.append(a2));
- }
- case Simple(a1): switch (e2)
- {
- case Multiple(a2): Multiple(a2.cons(a1));
- case Simple(a2): Multiple([a1,a2]);
- }
- }
- }
-}
-
-class FirstSemigroup<X> extends SemigroupAbstract<X> {
- public function new () { }
-
- override public function append (e1:X, e2:X):X {
- return e1;
- }
-}
-
-
-enum FormError {
- InvalidUserName(userName:String);
- InvalidEmail(email:String);
- InvalidAge(age:Int);
-}
-
-typedef Person = { name : String, email : String, age : Int };
-
-
-
-
-class ValidationSample
-{
-
- public static function validUserName(name:String):Bool
- {
- return name == "admin";
- }
-
- public static function validEmail(email:String):Bool
- {
- return email.indexOf("@") != -1;
- }
-
- public static function validAge(age:Int):Bool
- {
- return age >= 18;
- }
-
-
- public static function main ()
- {
- var loginInfo = { name : "admin", email : "foo", age : 13 };
-
- // lifting into Validation<MultiError<FormError>>, Success>
- var success = function (x:Person) return x.toSuccess();
- var fail = function (x) return Simple(x).toFail();
-
- var validEmail = function (p:Person) return if (validEmail(p.email)) success(p) else fail(InvalidEmail(p.email));
- var validAge = function (p:Person) return if (validAge(p.age)) success(p) else fail(InvalidAge(p.age));
- var validName = function (p:Person) return if (validUserName(p.name)) success(p) else fail(InvalidUserName(p.name));
-
- // we initialize with success
-
-
- // monad
- var vv:Validation<MultiError<FormError>, Person> = null;
- type(vv);
- //var m = Tc.forType('ValidationSemigroup<MultiErrorSemigroup<FormError>, Person>');
-
- var s:Semigroup<Person> = FirstSemigroup.get();
-
- var mon1 = vv.tc(Semigroup, [s]);
-
-
- var mon = ValidationSemigroup.get(MultiErrorSemigroup.get(), FirstSemigroup.get());
-
-
-
- var e1 = validEmail(loginInfo);
- var e2 = validAge(loginInfo);
- var e3 = validName(loginInfo);
-
- trace(mon.append(mon.append(e1,e2), e3));
-
-
- var m = ValidationMonad.get(MultiErrorSemigroup.get());
-
- var res = m.runDo(
- x <= validEmail(loginInfo).box(),
- y <= validAge(x).box(),
- z <= validName(y).box(),
- return z
- );
-
-
- trace(res);
-
- //m.
-
-
-
- }
-
-
-}
View
1  samples/05_Validation/main.hxml
@@ -1 +0,0 @@
--main ValidationSample
View
9 samples/05_Validation/neko.hxml
@@ -1,9 +0,0 @@
-main.hxml
--cp ../../src
--cp ../../../scutsCore/src
-
--cp ../../../hots/src
--cp ../../../scutsMacros/src
--cp ../../../scutsMCore/src
--cp .
--x bin/Example
View
68 samples/06_Monoid/MonoidSample.hx
@@ -1,68 +0,0 @@
-package ;
-
-import hots.classes.Collection;
-import hots.classes.Foldable;
-import hots.classes.Monoid;
-import hots.instances.IntProductMonoid;
-import hots.Of;
-import hots.instances.OptionMonoid;
-import hots.instances.OptionSemigroup;
-import hots.instances.ArrayMonoid;
-import hots.instances.ArraySemigroup;
-import hots.instances.Tup2Monoid;
-import hots.instances.StringMonoid;
-import hots.instances.StringSemigroup;
-import hots.instances.IntSumMonoid;
-import hots.instances.IntSumSemigroup;
-
-import scuts.core.types.Tup2;
-
-using hots.macros.TcContext;
-using hots.macros.Box;
-
-import scuts.core.types.Option;
-
-class MonoidSample
-{
-
-
-
- public static function main ()
- {
- {
- var a = Some([1,2,3]);
- var b = Some([4,5,6]);
-
- var m = a.tc(Monoid);
-
- trace(m.append(a,b));
- }
- {
- var a = Some(7);
- var b = Some(9);
-
-
- var m = a.tc(Monoid);
-
- trace(m.append(a,b));
- }
-
- {
- var a = Some(7);
- var b = Some(9);
-
- var productMonoid = IntProductMonoid.get();
-
- var m = a.tc(Monoid, [productMonoid]);
-
- trace(m.append(a,b));
- }
-
-
-
- }
-
-
-}
-
-
View
5 samples/06_Monoid/all.hxml
@@ -1,5 +0,0 @@
-neko.hxml
-cpp.hxml
-flash.hxml
-js.hxml
-php.hxml
View
9 samples/06_Monoid/cpp.hxml
@@ -1,9 +0,0 @@
-main.hxml
--cp ../../src
--cp ../../../scutsCore/src
--cp ../../../hots/src
--cp ../../../scutsMacros/src
--cp ../../../scutsMCore/src
--cpp bin/cpp
---next
--cmd bin\cpp\ListSample.exe
View
8 samples/06_Monoid/flash.hxml
@@ -1,8 +0,0 @@
-main.hxml
--cp ../../src
--cp ../../../scutsCore/src
--cp ../../../hots/src
--cp ../../../scutsMacros/src
--cp ../../../scutsMCore/src
--swf-header 1200:900:31:FFFFFF
--swf bin/Example.swf
View
7 samples/06_Monoid/js.hxml
@@ -1,7 +0,0 @@
-main.hxml
--cp ../../src
--cp ../../../scutsCore/src
--cp ../../../hots/src
--cp ../../../scutsMacros/src
--cp ../../../scutsMCore/src
--js bin/Example.js
View
1  samples/06_Monoid/main.hxml
@@ -1 +0,0 @@
--main MonoidSample
View
9 samples/06_Monoid/neko.hxml
@@ -1,9 +0,0 @@
-main.hxml
--cp ../../src
--cp ../../../scutsCore/src
-
--cp ../../../hots/src
--cp ../../../scutsMacros/src
--cp ../../../scutsMCore/src
--cp .
--x bin/Example.n
View
7 samples/06_Monoid/php.hxml
@@ -1,7 +0,0 @@
--main.hxml
--cp ../../src
--cp ../../../scutsCore/src
--cp ../../../hots/src
--cp ../../../scutsMacros/src
--cp ../../../scutsMCore/src
--php bin/php
View
73 samples/07_GenEq/GenEqSample.hx
@@ -1,73 +0,0 @@
-package ;
-
-import haxe.macro.MacroType;
-import hots.classes.Collection;
-import hots.classes.Eq;
-import hots.classes.Foldable;
-import hots.classes.Monoid;
-import hots.instances.IntProductMonoid;
-
-import hots.Of;
-import hots.instances.OptionMonoid;
-import hots.instances.OptionSemigroup;
-import hots.instances.ArrayMonoid;
-import hots.instances.ArraySemigroup;
-import hots.instances.Tup2Monoid;
-import hots.instances.StringMonoid;
-import hots.instances.StringSemigroup;
-import hots.instances.IntSumMonoid;
-import hots.instances.IntSumSemigroup;
-
-import hots.instances.StringEq;
-
-
-
-import scuts.core.types.Tup2;
-
-using hots.macros.TcContext;
-using hots.macros.Box;
-
-import scuts.core.types.Option;
-
-enum MyEnum {
- Password(s:String);
- User(s:String);
- Rec(a:MyEnum);
-}
-
-typedef MyEnumEq = MacroType<[ hots.macros.GenEq.forType(MyEnum) ]>
-
-class GenEqSample
-{
-
-
-
- public static function main ()
- {
- {
- var a = Password("foo");
- var b = Password("bar");
- var c = Password("foo");
- var d = User("test");
- var e = User("test2");
- var f = Rec(a);
- var g = Rec(c);
-
- var eq = a.tc(Eq);
-
- trace(eq.eq(a,b));
- trace(eq.eq(a,c));
- trace(eq.eq(d,a));
- trace(eq.eq(f,g));
-
-
- }
-
-
-
- }
-
-
-}
-
-
View
5 samples/07_GenEq/all.hxml
@@ -1,5 +0,0 @@
-neko.hxml
-cpp.hxml
-flash.hxml
-js.hxml
-php.hxml
View
9 samples/07_GenEq/cpp.hxml
@@ -1,9 +0,0 @@
-main.hxml
--cp ../../src
--cp ../../../scutsCore/src
--cp ../../../hots/src
--cp ../../../scutsMacros/src
--cp ../../../scutsMCore/src
--cpp bin/cpp
---next
--cmd bin\cpp\ListSample.exe
View
8 samples/07_GenEq/flash.hxml
@@ -1,8 +0,0 @@
-main.hxml
--cp ../../src
--cp ../../../scutsCore/src
--cp ../../../hots/src
--cp ../../../scutsMacros/src
--cp ../../../scutsMCore/src
--swf-header 1200:900:31:FFFFFF
--swf bin/Example.swf
View
7 samples/07_GenEq/js.hxml
@@ -1,7 +0,0 @@
-main.hxml
--cp ../../src
--cp ../../../scutsCore/src
--cp ../../../hots/src
--cp ../../../scutsMacros/src
--cp ../../../scutsMCore/src
--js bin/Example.js
View
1  samples/07_GenEq/main.hxml
@@ -1 +0,0 @@
--main GenEqSample
View
9 samples/07_GenEq/neko.hxml
@@ -1,9 +0,0 @@
-main.hxml
--cp ../../src
--cp ../../../scutsCore/src
-
--cp ../../../hots/src
--cp ../../../scutsMacros/src
--cp ../../../scutsMCore/src
--cp .
--x bin/Example.n
View
7 samples/07_GenEq/php.hxml
@@ -1,7 +0,0 @@
--main.hxml
--cp ../../src
--cp ../../../scutsCore/src
--cp ../../../hots/src
--cp ../../../scutsMacros/src
--cp ../../../scutsMCore/src
--php bin/php
View
7 src/hots/Hots.hx
@@ -0,0 +1,7 @@
+package hots;
+
+import hots.macros.HotsMacros;
+
+typedef Hots = HotsMacros;
+
+
View
94 src/hots/Identity.hx
@@ -0,0 +1,94 @@
+package hots;
+#if macro
+private typedef IR = hots.macros.ImplicitResolver;
+import haxe.macro.Expr;
+
+#end
+
+import scuts.core.types.Option;
+
+private typedef Of_<M,A> = Dynamic;
+private typedef OfOf_<M,A,B> = Dynamic;
+
+
+
+class Identity
+{
+
+ @:macro public static function pure <M,A,B>(e:String):ExprOf<Of_<M,B>>
+ {
+ return IR.implicitByType("hots.classes.Pointed<"+e+">");
+ }
+
+ @:macro public static function flatMap <M,A,B>(e:ExprOf<Of_<M,A>>, f:ExprOf<A->Of_<M,B>>):ExprOf<Of_<M,B>>
+ {
+ return IR.apply(macro hots.extensions.Monads.flatMap, [e,f]);
+ }
+
+ @:macro public static function filter <M,A>(e:ExprOf<Of_<M,A>>, f:ExprOf<A->Bool>):ExprOf<Of_<M,A>>
+ {
+ return IR.apply(macro hots.extensions.MonadZeros.filter, [e,f]);
+ }
+
+ @:macro public static function map <M,A,B>(e:ExprOf<Of_<M,A>>, f:ExprOf<A->B>):ExprOf<Of_<M,B>>
+ {
+ return IR.apply(macro hots.extensions.Monads.map, [e,f]);
+ }
+
+
+ @:macro public static function eq <T>(e1:ExprOf<T>, e2:ExprOf<T>):ExprOf<Bool>
+ {
+ return IR.apply(macro hots.extensions.Eqs.eq, [e1,e2]);
+ }
+
+ @:macro public static function show <T>(e1:ExprOf<T>):ExprOf<String>
+ {
+ return IR.apply(macro hots.extensions.Shows.show, [e1]);
+ }
+
+ @:macro public static function append <T>(e1:ExprOf<T>, e2:ExprOf<T>):ExprOf<T>
+ {
+ return IR.apply(macro hots.extensions.Monoids.append, [e1,e2]);
+ }
+
+ @:macro public static function next <M,A,B,C>(e1:ExprOf<OfOf<M,A,B>>, e2:ExprOf<OfOf<M,B,C>>):ExprOf<OfOf<M,A,C>>
+ {
+ return IR.apply(macro hots.extensions.Arrows.next, [e1,e2]);
+ }
+
+ @:macro public static function optionT (e1:ExprOf<Dynamic>):ExprOf<Dynamic>
+ {
+ return IR.apply(macro hots.box.OptionBox.optionT, [e1]);
+ }
+
+ @:macro public static function optionFT (e1:ExprOf<Dynamic>):ExprOf<Dynamic>
+ {
+ return IR.apply(macro hots.box.OptionBox.boxFT, [e1]);
+ }
+
+
+ @:macro public static function arrayT (e1:ExprOf<Dynamic>):ExprOf<Dynamic>
+ {
+ return IR.apply(macro hots.box.ArrayBox.arrayT, [e1]);
+ }
+
+ @:macro public static function arrayFT (e1:ExprOf<Dynamic>):ExprOf<Dynamic>
+ {
+ return IR.apply(macro hots.box.ArrayBox.boxFT, [e1]);
+ }
+
+ @:macro public static function validationT (e1:ExprOf<Dynamic>):ExprOf<Dynamic>
+ {
+ return IR.apply(macro hots.box.ValidationBox.validationT, [e1]);
+ }
+
+ @:macro public static function validationFT (e1:ExprOf<Dynamic>):ExprOf<Dynamic>
+ {
+ return IR.apply(macro hots.box.ValidationBox.boxFT, [e1]);
+ }
+
+
+
+
+
+}
View
3  src/hots/Implicit.hx
@@ -0,0 +1,3 @@
+package hots;
+
+typedef Implicit<T> = T;
View
191 src/hots/ImplicitCasts.hx
@@ -0,0 +1,191 @@
+package hots;
+import hots.box.ArrayBox;
+import hots.box.FunctionBox;
+import hots.box.OptionBox;
+import hots.box.ValidationBox;
+import hots.instances.ArrayOf;
+import hots.instances.ArrayTOf;
+import hots.instances.FunctionOfOf;
+import hots.instances.OptionOf;
+import hots.instances.OptionTOf;
+import hots.instances.ValidationOf;
+import hots.instances.ValidationTOf;
+import scuts.core.types.Option;
+import scuts.core.types.Validation;
+
+// Option Casts
+
+class OptionOf_Casts
+{
+ public static inline function implicitUpcast <T>(a:Option<T>):OptionOf<T>
+ {
+ return OptionBox.box(a);
+ }
+
+ public static inline function implicitDowncast <T>(a:OptionOf<T>):Option<T>
+ {
+ return OptionBox.unbox(a);
+ }
+}
+
+class OptionOf_Function_Casts
+{
+ public static inline function implicitUpcast <T,X>(a:X->Option<T>):X->OptionOf<T>
+ {
+ return OptionBox.boxF(a);
+ }
+
+ public static inline function implicitDowncast <T,X>(a:X->OptionOf<T>):X->Option<T>
+ {
+ return OptionBox.unboxF(a);
+ }
+}
+
+class OptionTOf_Function_Casts
+{
+ public static inline function implicitUpcast <M,T,X>(a:X->Of<M, Option<T>>)
+ {
+ return OptionBox.boxFT(a);
+ }
+ public static inline function implicitDowncast <M,T,X>(a:X->OptionTOf<M,T> ):X->Of<M, Option<T>>
+ {
+ return OptionBox.unboxFT(a);
+ }
+}
+
+class OptionTOf_Casts
+{
+ public static inline function implicitUpcast <M, T>(a:Of<M, Option<T>>):OptionTOf<M,T>
+ {
+ return OptionBox.boxT(a);
+ }
+
+ public static inline function implicitDowncast <M, T>(a:OptionTOf<M,T>):Of<M, Option<T>>
+ {
+ return OptionBox.unboxT(a);
+ }
+}
+
+// Validation Casts
+
+class ValidationOf_Casts
+{
+ public static inline function implicitUpcast <F,S>(a:Validation<F,S>):ValidationOf<F,S>
+ {
+ return ValidationBox.box(a);
+ }
+
+ public static inline function implicitDowncast <F,S>(a:ValidationOf<F,S>):Validation<F,S>
+ {
+ return ValidationBox.unbox(a);
+ }
+}
+
+class ValidationOf_Function_Casts
+{
+ public static inline function implicitUpcast <F,S,X>(a:X->Validation<F,S>):X->ValidationOf<F,S>
+ {
+ return ValidationBox.boxF(a);
+ }
+
+ public static inline function implicitDowncast <F,S,X>(a:X->ValidationOf<F,S>):X->Validation<F,S>
+ {
+ return ValidationBox.unboxF(a);
+ }
+}
+
+class ValidationTOf_Function_Casts
+{
+ public static inline function implicitUpcast <M,F,S,X>(a:X->Of<M, Validation<F,S>>)
+ {
+ return ValidationBox.boxFT(a);
+ }
+ public static inline function implicitDowncast <M,F,S,X>(a:X->ValidationTOf<M,F,S> ):X->Of<M, Validation<F,S>>
+ {
+ return ValidationBox.unboxFT(a);
+ }
+}
+
+class ValidationTOf_Casts
+{
+ public static inline function implicitUpcast <M, F,S>(a:Of<M, Validation<F,S>>):ValidationTOf<M,F,S>
+ {
+ return ValidationBox.boxT(a);
+ }
+
+ public static inline function implicitDowncast <M, F,S>(a:ValidationTOf<M,F,S>):Of<M, Validation<F,S>>
+ {
+ return ValidationBox.unboxT(a);
+ }
+}
+
+
+// Array Casts
+
+class ArrayTOf_Casts
+{
+ public static inline function implicitUpcast <M,T>(a:Of<M, Array<T>>):ArrayTOf<M,T>
+ {
+ return ArrayBox.boxT(a);
+ }
+ public static inline function implicitDowncast <M,T>(a:ArrayTOf<M,T> ):Of<M, Array<T>>
+ {
+ return ArrayBox.unboxT(a);
+ }
+
+
+}
+
+
+
+
+class ArrayTOf_Function_Casts
+{
+ public static inline function implicitUpcast <M,T,X>(a:X->Of<M, Array<T>>)
+ {
+ return ArrayBox.boxFT(a);
+ }
+
+}
+
+
+
+
+
+
+class ArrayOf_Casts
+{
+ public static inline function implicitUpcast <T>(a:Array<T>):ArrayOf<T>
+ {
+ return ArrayBox.box(a);
+ }
+
+ public static inline function implicitDowncast <T>(a:ArrayOf<T>):Array<T>
+ {
+ return ArrayBox.unbox(a);
+ }
+}
+
+class ArrayOf_Function_Casts
+{
+ public static inline function implicitUpcast <X,T>(a:X->Array<T>):X->ArrayOf<T>
+ {
+ return ArrayBox.boxF(a);
+ }
+ public static inline function implicitDowncast <X,T>(a:X->ArrayOf<T>):X->Array<T>
+ {
+ return ArrayBox.unboxF(a);
+ }
+}
+
+class Function_Arrow_Casts
+{
+ public static inline function implicitUpcast <A,B>(f:A->B):FunctionOfOf<A, B>
+ {
+ return FunctionBox.asArrow(f);
+ }
+ public static inline function implicitDowncast <A,B>(f:FunctionOfOf<A, B>):A->B
+ {
+ return FunctionBox.runArrow(f);
+ }
+}
View
6 src/hots/ImplicitConversion.hx
@@ -0,0 +1,6 @@
+package hots;
+
+
+
+
+typedef ImplicitConversion<A,B > = { __impFrom:Void->A, __impTo:Void->B }
View
5 src/hots/ImplicitObject.hx
@@ -0,0 +1,5 @@
+package hots;
+
+class ImplicitGetter {}
+
+typedef ImplicitObject<A> = ImplicitGetter -> A;
View
419 src/hots/Objects.hx
@@ -0,0 +1,419 @@
+package hots;
+import hots.classes.Applicative;
+import hots.classes.Applicative;
+import hots.classes.Arrow;
+import hots.classes.Eq;
+import hots.classes.Functor;
+import hots.classes.Monad;
+import hots.classes.MonadZero;
+import hots.classes.Monoid;
+import hots.classes.Pointed;
+import hots.classes.Semigroup;
+import hots.classes.Show;
+import hots.extensions.Shows;
+import hots.instances.ArrayEq;
+import hots.instances.ArrayMonoid;
+import hots.instances.ArrayOfApplicative;
+import hots.instances.ArrayOfFoldable;
+import hots.instances.ArrayOfFunctor;
+import hots.instances.ArrayOfMonad;
+import hots.instances.ArrayOfMonadZero;
+import hots.instances.ArrayOfPointed;
+import hots.instances.ArraySemigroup;
+import hots.instances.ArrayShow;
+import hots.instances.ArrayTOfApplicative;
+import hots.instances.ArrayTOfFunctor;
+import hots.instances.ArrayTOfMonad;
+import hots.instances.ArrayTOfPointed;
+import hots.instances.BoolEq;
+import hots.instances.DateEq;
+import hots.instances.DateOrd;
+import hots.instances.DualMonoid;
+import hots.instances.DualSemigroup;
+import hots.instances.EitherEq;
+import hots.instances.EitherSemigroup;
+import hots.instances.EndoMonoid;
+import hots.instances.EndoSemigroup;
+import hots.instances.FloatEq;
+import hots.instances.FloatOrd;
+import hots.instances.FloatShow;
+import hots.instances.FunctionArrow;
+import hots.instances.FunctionCategory;
+import hots.instances.IntEq;
+import hots.instances.IntNum;
+import hots.instances.IntOrd;
+import hots.instances.IntProductMonoid;
+import hots.instances.IntProductSemigroup;
+import hots.instances.IntShow;
+import hots.instances.IntSumMonoid;
+import hots.instances.IntSumSemigroup;
+import hots.instances.KleisliArrow;
+import hots.instances.KleisliCategory;
+import hots.instances.LazyListOfFoldable;
+import hots.instances.LazyListOfFoldable;
+import hots.instances.OptionEq;
+import hots.instances.OptionMonoid;
+import hots.instances.OptionOfApplicative;
+import hots.instances.OptionOfFunctor;
+import hots.instances.OptionOfMonad;
+import hots.instances.OptionOfPointed;
+import hots.instances.OptionSemigroup;
+import hots.instances.OptionShow;
+import hots.instances.OptionTOfApplicative;
+import hots.instances.OptionTOfFunctor;
+import hots.instances.OptionTOfMonad;
+import hots.instances.OptionTOfMonad;
+import hots.instances.OptionTOfPointed;
+import hots.instances.StringEq;
+import hots.instances.StringMonoid;
+import hots.instances.StringOrd;
+import hots.instances.StringSemigroup;
+import hots.instances.StringShow;
+import hots.instances.Tup2Eq;
+import hots.instances.Tup2Semigroup;
+import hots.instances.Tup3Semigroup;
+import hots.instances.ValidationEq;
+import hots.instances.ValidationOfApplicative;
+import hots.instances.ValidationOfFunctor;
+import hots.instances.ValidationOfPointed;
+import hots.instances.ValidationSemigroup;
+import hots.instances.ValidationTOfApplicative;
+import hots.instances.ValidationTOfFunctor;
+import hots.instances.ValidationTOfMonad;
+import hots.instances.ValidationTOfPointed;
+import scuts.core.types.Option;
+import scuts.core.types.Tup2;
+import scuts.core.types.Validation;
+
+import hots.Of;
+
+class Objects
+{
+
+ // eqs
+
+ public static var floatEq (default, null) = new FloatEq();
+ public static var intEq (default, null) = new IntEq();
+ public static var boolEq (default, null) = new BoolEq();
+ public static var stringEq (default, null) = new StringEq();
+ public static var dateEq (default, null) = new DateEq(floatEq);
+
+
+ public static function eitherEq (eq1, eq2) return new EitherEq(eq1, eq2)
+ public static function tup2Eq (eq1, eq2) return new Tup2Eq(eq1, eq2)
+ public static function optionEq (eqT) return new OptionEq(eqT)
+ public static function arrayEq (eqT) return new ArrayEq(eqT)
+ public static function validationEq <F,S>(eqF,eqS):Eq<Validation<F,S>> return new ValidationEq(eqF,eqS)
+
+ // enumerations
+
+
+
+ // show
+ public static var stringShow (default, null) = new StringShow();
+ public static var intShow (default, null) = new IntShow();
+ public static var floatShow (default, null) = new FloatShow();
+
+ public static function arrayShow (showT) return new ArrayShow(showT)
+ public static function optionShow (showT) return new OptionShow(showT)
+ public static function tup2Show <A,B>(show1, show2) return Shows.create(function (t:Tup2<A,B>) return "(" + show1.show(t._1) + ", " + show2.show(t._2) + ")")
+ public static function validationShow (showF, showS) {
+ return Shows.create(function (v) return switch (v)
+ {
+ case Success(s): "Success(" + showS.show(s) + ")";
+ case Failure(f): "Failure(" + showF.show(f) + ")";
+ });
+ }
+ // num
+
+ public static var intNum (default, null) = new IntNum(intEq, intShow);
+
+ // ords
+
+ public static var intOrd (default, null) = new IntOrd(intEq);
+ public static var floatOrd (default, null) = new FloatOrd(floatEq);
+ public static var stringOrd (default, null) = new StringOrd(stringEq);
+ public static var dateOrd (default, null) = new DateOrd(dateEq, floatOrd);
+
+ // functor
+
+ public static var optionFunctor (default, null) = new OptionOfFunctor();
+ public static var arrayFunctor (default, null) = new ArrayOfFunctor();
+ public static var validationFunctor (default, null) = new ValidationOfFunctor();
+
+ public static function arrayTFunctor <M>(base:Functor<M>) return new ArrayTOfFunctor(base)
+ public static function optionTFunctor <M>(base:Functor<M>) return new OptionTOfFunctor(base)
+ public static function validationTFunctor <M>(base:Functor<M>) return new ValidationTOfFunctor(base)
+
+ // pointeds
+
+ public static var optionPointed (default, null) = new OptionOfPointed(optionFunctor);
+ public static var arrayPointed (default, null) = new ArrayOfPointed(arrayFunctor);
+ public static var validationPointed (default, null) = new ValidationOfPointed(validationFunctor);
+
+ public static function arrayTPointed <M>(base:Pointed<M>) return new ArrayTOfPointed(base, arrayTFunctor(base))
+ public static function optionTPointed <M>(base:Pointed<M>) return new OptionTOfPointed(base, optionTFunctor(base))
+ public static function validationTPointed <M>(base:Pointed<M>) return new ValidationTOfPointed(base, validationTFunctor(base))
+
+ // applicatives
+
+ public static var arrayApplicative (default, null) = new ArrayOfApplicative(arrayPointed);
+ public static var optionApplicative (default, null) = new OptionOfApplicative(optionPointed);
+ public static function validationApplicative (semiFailure) return new ValidationOfApplicative(semiFailure,validationPointed)
+
+ public static function arrayTApplicative <M>(base:Applicative<M>) return new ArrayTOfApplicative(base, arrayTPointed(base))
+ public static function optionTApplicative <M>(base:Applicative<M>) return new OptionTOfApplicative(base, optionTPointed(base))
+ public static function validationTApplicative <M>(base:Applicative<M>) return new ValidationTOfApplicative(base, validationTPointed(base))
+
+
+
+ // monads
+ public static var arrayMonad (default, null) = new ArrayOfMonad(arrayApplicative);
+ public static var optionMonad (default, null) = new OptionOfMonad(optionApplicative);
+
+ public static function arrayTMonad <M>(base:Monad<M>) return new ArrayTOfMonad(base, arrayTApplicative(base))
+ public static function optionTMonad <M>(base:Monad<M>) return new OptionTOfMonad(base, optionTApplicative(base))
+ public static function validationTMonad <M>(base:Monad<M>) return new ValidationTOfMonad(base, validationTApplicative(base))
+
+ // monadZeros
+ public static var arrayMonadZero (default, null) = new ArrayOfMonadZero(arrayMonad);
+
+ // categories
+ public static var functionCategory (default, null) = new FunctionCategory();
+
+ public static function kleisliCategory (m) return new KleisliCategory(m)
+
+ // arrows
+ public static var functionArrow (default, null) = new FunctionArrow(functionCategory);
+
+ public static function kleisliArrow (m) return new KleisliArrow(m, kleisliCategory(m))
+
+
+
+ // semigroups
+ public static var arraySemigroup (default, null) = new ArraySemigroup();
+ public static var intSumSemigroup (default, null) = new IntSumSemigroup(intNum);
+ public static var stringSemigroup (default, null) = new StringSemigroup();
+ public static var intProductSemigroup (default, null) = new IntProductSemigroup();
+ public static var endoSemigroup (default, null) = new EndoSemigroup();
+
+ public static function dualSemigroup (semiT) return new DualSemigroup(semiT)
+
+ public static function eitherSemigroup (semiL, semiR) return new EitherSemigroup(semiL, semiR)
+ public static function tup2Semigroup (semi1, semi2) return new Tup2Semigroup(semi1, semi2)
+ public static function tup3Semigroup (semi1, semi2, semi3) return new Tup3Semigroup(semi1, semi2, semi3)
+ public static function validationSemigroup (semiF, semiS) return new ValidationSemigroup(semiF, semiS)
+ public static function optionSemigroup (semiT) return new OptionSemigroup(semiT)
+
+ // monoid
+ public static var intSumMonoid (default, null) = new IntSumMonoid(intSumSemigroup);
+ public static var intProductMonoid (default, null) = new IntProductMonoid(intProductSemigroup);
+ public static var arrayMonoid (default, null) = new ArrayMonoid(arraySemigroup);
+
+ public static var stringMonoid (default, null) = new StringMonoid(stringSemigroup);
+ public static var endoMonoid (default, null) = EndoMonoid.endo();
+
+ public static function optionMonoid (semiT) return new OptionMonoid(optionSemigroup(semiT))
+ public static function dualMonoid (monoidT) return new DualMonoid(monoidT, dualSemigroup(monoidT))
+
+ // foldables
+
+ public static var arrayFoldable (default, null) = new ArrayOfFoldable();
+ public static var lazyListFoldable (default, null) = new LazyListOfFoldable();
+
+
+}
+
+private typedef O = Objects.Objects;
+
+// Monads
+
+private typedef OptionIn = Option<In>;
+private typedef ArrayIn = Array<In>;
+
+private typedef IOMonad<T> = ImplicitObject<Monad<T>>;
+private typedef IMonad<T> = Implicit<Monad<T>>;
+
+private typedef IOEq<T> = ImplicitObject<Eq<T>>;
+private typedef IEq<T> = Implicit<Eq<T>>;
+
+class ArrayEq_Obj
+{
+ public static inline function implicitObj <T>(_:IOEq<Array<T>>, eqT:IEq<T>):Eq<Array<T>> return O.arrayEq(eqT)
+}
+class OptionEq_Obj
+{
+ public static inline function implicitObj <T>(_:IOEq<Option<T>>,eqT:IEq<T>):Eq<Option<T>> return O.optionEq(eqT)
+}
+class ValidationEq_Obj
+{
+ public static inline function implicitObj <F,S>(_:IOEq<Validation<F,S>>,eqF:IEq<F>, eqS:IEq<S>):Eq<Validation<F,S>> return O.validationEq(eqF,eqS)
+}
+
+class Tup2Eq_Obj
+{
+ public static inline function implicitObj <A,B>(_:IOEq<Tup2<A,B>>,eq1:IEq<A>, eq2:IEq<B>):Eq<Tup2<A,B>> return O.tup2Eq(eq1,eq2)
+}
+
+class IntEq_Obj
+{
+ public static inline function implicitObj <A,B>(_:IOEq<Int>) return O.intEq
+}
+
+class FloatEq_Obj
+{
+ public static inline function implicitObj <A,B>(_:IOEq<Float>) return O.floatEq
+}
+
+class StringEq_Obj
+{
+ public static inline function implicitObj <A,B>(_:IOEq<String>) return O.stringEq
+}
+/// SHOWS
+
+private typedef IOShow<T> = ImplicitObject<Show<T>>;
+private typedef IShow<T> = Implicit<Show<T>>;
+
+
+class ValidationShow_Obj
+{
+ public static inline function implicitObj <F,S>(_:IOShow<Validation<F,S>>, f:IShow<F>, s:IShow<S>) return O.validationShow(f,s)
+}
+
+class IntShow_Obj
+{
+ public static inline function implicitObj (_:IOShow<Int>) return O.intShow
+}
+
+class Tup2Show_Obj
+{
+ public static inline function implicitObj <A,B>(_:IOShow<Tup2<A,B>>,a:IShow<A>,b:IShow<B>):Show<Tup2<A,B>> return O.tup2Show(a,b)
+}
+class OptionShow_Obj
+{
+ public static inline function implicitObj <T>(_:IOShow<Option<T>>,a:IShow<T>) return O.optionShow(a)
+}
+class String_Show_Obj
+{
+ public static inline function implicitObj (_:IOShow<String>):Show<String> return O.stringShow
+}
+
+class Float_Show_Obj
+{
+ public static inline function implicitObj <F,S>(_:IShow<Float>):Show<Float> return O.floatShow
+}
+
+////////////////////////////////
+
+class ArrayOf_Monad_Obj
+{
+ public static inline function implicitObj (_:IOMonad<ArrayIn>):Monad<ArrayIn>
+ {
+ return O.arrayMonad;
+ }
+}
+
+class OptionOf_Monad_Obj
+{
+ public static inline function implicitObj (_:IOMonad<OptionIn>):Monad<OptionIn>
+ {
+ return O.optionMonad;
+ }
+}
+
+
+private typedef ValidationIn<F> = Validation<F,In>
+
+// Monad Transformers
+
+class OptionTOf_Monad_Obj
+{
+ public static inline function implicitObj <M>(_:IOMonad<Of<M,OptionIn>>, base: IMonad<M>):Monad<Of<M,OptionIn>> return O.optionTMonad(base)
+}
+
+class ValidationTOf_Monad_Obj
+{
+ public static inline function implicitObj <M,F>(_:IOMonad<Of<M,ValidationIn<F>>>, base: IMonad<M>):Monad<Of<M,ValidationIn<F>>> return O.validationTMonad(base)
+}
+
+
+
+class ArrayTOf_Monad_Obj
+{
+ public static inline function implicitObj <M>(_:IOMonad<Of<M,ArrayIn>>, base: IMonad<M>):Monad<Of<M,ArrayIn>> return O.arrayTMonad(base)
+}
+
+private typedef IArrow<X> = ImplicitObject<Arrow<X>>;
+
+
+class FunctionArrowObj
+{
+ public static inline function implicitObj (_:IArrow<In->In>):Arrow<In->In> return O.functionArrow
+}
+
+
+private typedef IMonZero<T> = ImplicitObject<MonadZero<T>>;
+
+
+class ArrayOf_MonadZero_Obj
+{
+ public static inline function implicitObj (_:IMonZero<Array<In>>):MonadZero<Array<In>> return O.arrayMonadZero
+}
+
+
+
+
+
+
+
+
+
+// Monoids
+
+private typedef IMon<T> = ImplicitObject<Monoid<T>>;
+
+class Int_Sum_Monoid_Obj
+{
+
+ public static inline function implicitObj (_:IMon<Int>):Monoid<Int> return O.intSumMonoid
+}
+
+class Array_Monoid_Obj
+{
+ public static inline function implicitObj <T>(_:IMon<Array<T>>):Monoid<Array<T>> return O.arrayMonoid
+}
+
+class String_Monoid_Obj
+{
+ public static inline function implicitObj <T>(_:IMon<String>) return O.stringMonoid
+}
+
+
+
+// Semigroups
+
+private typedef IOSemi<T> = ImplicitObject<Semigroup<T>>
+private typedef ISemi<T> = Implicit<Semigroup<T>>
+
+class Int_Sum_Semigroup_Obj
+{
+ public static inline function implicitObj (_:IOSemi<Int>) return O.intSumSemigroup
+}
+
+
+private typedef IOSemiValid<F,S> = IOSemi<Validation<F,S>>
+
+class Validation_Semigroup_Obj
+{
+ public static inline function implicitObj <F,S>(_:IOSemiValid<F,S>, semiF:ISemi<F>, semiS:ISemi<S>) return O.validationSemigroup(semiF, semiS)
+}
+
+class StringSemigroupObj
+{
+ public static inline function implicitObj <T>(_:IOSemi<String>) return O.stringSemigroup
+}
+
+class OptionSemigroupImp
+{
+ public static inline function implicitObj <T>(_:IOSemi<Option<T>>, s:ISemi<T>) return O.optionSemigroup(s)
+}
View
40 src/hots/Of.hx
@@ -1,25 +1,27 @@
package hots;
-#if (macro || display)
-import haxe.macro.Expr;
-import haxe.PosInfos;
-import hots.macros.Box;
+// Of is like a newtype, it's compiled as Dynamic, but at compilation time it is a full featured type.
+#if flash
+@:native('Object')
+#else
+@:native('Dynamic')
+#end
+class Of<M,A> { }
+/*
+#if flash
+@:native('Object')
+#else
+@:native('Dynamic')
#end
+*/
+//typedef Of<M,A> = Of<M,A>;
-// Of is like a newtype, it's compiled as Dynamic, but at compilation time it is a full featured type.
+/*
+#if flash
+@:native('Object')
+#else
@:native('Dynamic')
-class Of<M,A>
-{
- // tries to create an Of type of val
- @:macro public static function box (val:Expr):Expr
- {
- return Box.box1(val);
- }
-
- /*
- @:macro public function unbox (ethis):Expr {
- return Box.unbox1(ethis);
- }
- */
-}
+#end
+*/
+//class OfT<M,A> { }
View
5 src/hots/OfOf.hx
@@ -4,6 +4,11 @@ import hots.Of;
/**
* Represents a type constructor that needs two types to construct a real type.
*/
+#if flash
+@:native('Object')
+#else
+@:native('Dynamic')
+#end
typedef OfOf<M,A,B> = Of<Of<M, A>, B>;
View
8 src/hots/TC.hx
@@ -1,8 +0,0 @@
-package hots;
-
-
-
-#if !macro
-@:autoBuild(hots.macros.TcRegistry.build())
-#end
-interface TC {}
View
41 src/hots/box/ArrayBox.hx
@@ -2,24 +2,47 @@ package hots.box;
import hots.In;
import hots.instances.ArrayOf;
import hots.instances.ArrayTOf;
-import hots.macros.Box;
+import hots.instances.KleisliOf;
+
import hots.Of;
+
class ArrayBox
{
- public static inline function box <X>(a:Array<X>):ArrayOf<X> return Box.box(a)
- public static inline function unbox <X>(a:ArrayOf<X>):Array<X> return Box.unbox(a)
+ // Kleisli Conversions
+
+ public static inline function asKleisli <M,A,B>(f:A->Array<B>):KleisliOf<Array<In>,A,B> return cast f
+
+ public static inline function runKleisli <M,A,B>(f:KleisliOf<Array<In>,A,B>):A->Array<B> return cast f
+
+
+
+
+
+ // Normal wrappers
+
+ public static inline function box <X>(a:Array<X>):ArrayOf<X> return cast a
+
+ public static inline function unbox <X>(a:ArrayOf<X>):Array<X> return cast a
+
+ public static inline function boxF <X,Y>(a:X->Array<Y>):X->ArrayOf<Y> return cast a
+
+ public static inline function unboxF <A,B>(e:A->ArrayOf<B>):A->Array<B> return cast e
+
+ // Transformers
+
+ public static inline function arrayT <X,Y>(a:Of<X, Array<Y>>):ArrayTOf<X,Y> return boxT(a)
+
+ public static inline function runT <X,Y>(a:ArrayTOf<X,Y>):Of<X, Array<Y>> return unboxT(a)
- public static inline function boxF <X,Y>(a:X->Array<Y>):X->ArrayOf<Y> return cast a // Box.boxF(a)
- public static function unboxF <A,B>(e:A->ArrayOf<B>):A->Array<B> {