Skip to content
This repository was archived by the owner on Sep 3, 2024. It is now read-only.

Commit 7fba10d

Browse files
Merge pull request #14 from haskell-distributed/ghc-8.0.1
Add GHC-8.0.1 support
2 parents 19659a0 + 7431065 commit 7fba10d

File tree

2 files changed

+17
-27
lines changed

2 files changed

+17
-27
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ matrix:
1010
addons: {apt: {packages: [cabal-install-1.22,ghc-7.8.4], sources: [hvr-ghc]}}
1111
- env: CABALVER=1.22 GHCVER=7.10.3
1212
addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3],sources: [hvr-ghc]}}
13+
- env: CABALVER=1.24 GHCVER=8.0.1
14+
addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.1], sources: [hvr-ghc]}}
1315

1416
before_install:
1517
- export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:~/.cabal/bin:$PATH

src/Control/Distributed/Static.hs

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -468,78 +468,68 @@ unclosure rtable (Closure dec env) = do
468468
return (f env)
469469

470470
-- | Convert a static value into a closure.
471-
staticClosure :: Typeable a => Static a -> Closure a
471+
staticClosure :: Static a -> Closure a
472472
staticClosure dec = closure (staticConst dec) empty
473473

474474
--------------------------------------------------------------------------------
475475
-- Predefined static values --
476476
--------------------------------------------------------------------------------
477477

478478
-- | Static version of ('Prelude..')
479-
composeStatic :: (Typeable a, Typeable b, Typeable c)
480-
=> Static ((b -> c) -> (a -> b) -> a -> c)
479+
composeStatic :: Static ((b -> c) -> (a -> b) -> a -> c)
481480
composeStatic = staticLabel "$compose"
482481

483482
-- | Static version of 'const'
484-
constStatic :: (Typeable a, Typeable b)
485-
=> Static (a -> b -> a)
483+
constStatic :: Static (a -> b -> a)
486484
constStatic = staticLabel "$const"
487485

488486
-- | Static version of ('Arrow.***')
489-
splitStatic :: (Typeable a, Typeable a', Typeable b, Typeable b')
490-
=> Static ((a -> b) -> (a' -> b') -> (a, a') -> (b, b'))
487+
splitStatic :: Static ((a -> b) -> (a' -> b') -> (a, a') -> (b, b'))
491488
splitStatic = staticLabel "$split"
492489

493490
-- | Static version of 'Arrow.app'
494-
appStatic :: (Typeable a, Typeable b)
495-
=> Static ((a -> b, a) -> b)
491+
appStatic :: Static ((a -> b, a) -> b)
496492
appStatic = staticLabel "$app"
497493

498494
-- | Static version of 'flip'
499-
flipStatic :: (Typeable a, Typeable b, Typeable c)
500-
=> Static ((a -> b -> c) -> b -> a -> c)
495+
flipStatic :: Static ((a -> b -> c) -> b -> a -> c)
501496
flipStatic = staticLabel "$flip"
502497

503498
--------------------------------------------------------------------------------
504499
-- Combinators on static values --
505500
--------------------------------------------------------------------------------
506501

507502
-- | Static version of ('Prelude..')
508-
staticCompose :: (Typeable a, Typeable b, Typeable c)
509-
=> Static (b -> c) -> Static (a -> b) -> Static (a -> c)
503+
staticCompose :: Static (b -> c) -> Static (a -> b) -> Static (a -> c)
510504
staticCompose g f = composeStatic `staticApply` g `staticApply` f
511505

512506
-- | Static version of ('Control.Arrow.***')
513-
staticSplit :: (Typeable a, Typeable a', Typeable b, Typeable b')
514-
=> Static (a -> b) -> Static (a' -> b') -> Static ((a, a') -> (b, b'))
507+
staticSplit :: Static (a -> b) -> Static (a' -> b') -> Static ((a, a') -> (b, b'))
515508
staticSplit f g = splitStatic `staticApply` f `staticApply` g
516509

517510
-- | Static version of 'Prelude.const'
518-
staticConst :: (Typeable a, Typeable b)
519-
=> Static a -> Static (b -> a)
511+
staticConst :: Static a -> Static (b -> a)
520512
staticConst x = constStatic `staticApply` x
521513

522514
-- | Static version of 'Prelude.flip'
523-
staticFlip :: (Typeable a, Typeable b, Typeable c)
524-
=> Static (a -> b -> c) -> Static (b -> a -> c)
515+
staticFlip :: Static (a -> b -> c) -> Static (b -> a -> c)
525516
staticFlip f = flipStatic `staticApply` f
526517

527518
--------------------------------------------------------------------------------
528519
-- Combinators on Closures --
529520
--------------------------------------------------------------------------------
530521

531522
-- | Apply a static function to a closure
532-
closureApplyStatic :: (Typeable a, Typeable b)
533-
=> Static (a -> b) -> Closure a -> Closure b
523+
closureApplyStatic :: Static (a -> b) -> Closure a -> Closure b
534524
closureApplyStatic f (Closure decoder env) =
535525
closure (f `staticCompose` decoder) env
536526

537527
decodeEnvPairStatic :: Static (ByteString -> (ByteString, ByteString))
538528
decodeEnvPairStatic = staticLabel "$decodeEnvPair"
539529

540530
-- | Closure application
541-
closureApply :: forall a b. (Typeable a, Typeable b)
542-
=> Closure (a -> b) -> Closure a -> Closure b
531+
closureApply :: forall a b .
532+
Closure (a -> b) -> Closure a -> Closure b
543533
closureApply (Closure fdec fenv) (Closure xdec xenv) =
544534
closure decoder (encode (fenv, xenv))
545535
where
@@ -551,11 +541,9 @@ closureApply (Closure fdec fenv) (Closure xdec xenv) =
551541
decodeEnvPairStatic
552542

553543
-- | Closure composition
554-
closureCompose :: (Typeable a, Typeable b, Typeable c)
555-
=> Closure (b -> c) -> Closure (a -> b) -> Closure (a -> c)
544+
closureCompose :: Closure (b -> c) -> Closure (a -> b) -> Closure (a -> c)
556545
closureCompose g f = composeStatic `closureApplyStatic` g `closureApply` f
557546

558547
-- | Closure version of ('Arrow.***')
559-
closureSplit :: (Typeable a, Typeable a', Typeable b, Typeable b')
560-
=> Closure (a -> b) -> Closure (a' -> b') -> Closure ((a, a') -> (b, b'))
548+
closureSplit :: Closure (a -> b) -> Closure (a' -> b') -> Closure ((a, a') -> (b, b'))
561549
closureSplit f g = splitStatic `closureApplyStatic` f `closureApply` g

0 commit comments

Comments
 (0)