1
0
Fork 0
mirror of https://github.com/tensorflow/haskell.git synced 2024-11-23 11:29:43 +01:00

Support a couple more ops by allowing larger tuples. (#93)

This commit is contained in:
Judah Jacobson 2017-04-06 19:00:18 -07:00 committed by Christian Berentsen
parent a7cbc27d36
commit 73eb81f6ab
2 changed files with 76 additions and 3 deletions

View file

@ -66,7 +66,4 @@ generatingOpsWrappers = hooks
blackList = blackList =
[ -- Requires the "func" type: [ -- Requires the "func" type:
"SymbolicGradient" "SymbolicGradient"
-- Easy: support larger result tuples.
, "ParseSingleSequenceExample"
, "Skipgram"
] ]

View file

@ -81,6 +81,44 @@ instance ( BuildResult a1
<*> buildResult <*> buildResult
<*> buildResult <*> buildResult
instance ( BuildResult a1
, BuildResult a2
, BuildResult a3
, BuildResult a4
, BuildResult a5
, BuildResult a6
, BuildResult a7
)
=> BuildResult (a1, a2, a3, a4, a5, a6, a7) where
buildResult = (,,,,,,)
<$> buildResult
<*> buildResult
<*> buildResult
<*> buildResult
<*> buildResult
<*> buildResult
<*> buildResult
instance ( BuildResult a1
, BuildResult a2
, BuildResult a3
, BuildResult a4
, BuildResult a5
, BuildResult a6
, BuildResult a7
, BuildResult a8
)
=> BuildResult (a1, a2, a3, a4, a5, a6, a7, a8) where
buildResult = (,,,,,,,)
<$> buildResult
<*> buildResult
<*> buildResult
<*> buildResult
<*> buildResult
<*> buildResult
<*> buildResult
<*> buildResult
recordResult :: Result Output recordResult :: Result Output
recordResult = do recordResult = do
o <- ask o <- ask
@ -184,6 +222,44 @@ instance ( PureResult a1
<*> pureResult <*> pureResult
<*> pureResult <*> pureResult
instance ( PureResult a1
, PureResult a2
, PureResult a3
, PureResult a4
, PureResult a5
, PureResult a6
, PureResult a7
)
=> PureResult (a1, a2, a3, a4, a5, a6, a7) where
pureResult = (,,,,,,)
<$> pureResult
<*> pureResult
<*> pureResult
<*> pureResult
<*> pureResult
<*> pureResult
<*> pureResult
instance ( PureResult a1
, PureResult a2
, PureResult a3
, PureResult a4
, PureResult a5
, PureResult a6
, PureResult a7
, PureResult a8
)
=> PureResult (a1, a2, a3, a4, a5, a6, a7, a8) where
pureResult = (,,,,,,,)
<$> pureResult
<*> pureResult
<*> pureResult
<*> pureResult
<*> pureResult
<*> pureResult
<*> pureResult
<*> pureResult
instance PureResult a => PureResult [a] where instance PureResult a => PureResult [a] where
pureResult = do pureResult = do
ResultState i ns <- get ResultState i ns <- get