@@ -468,78 +468,68 @@ unclosure rtable (Closure dec env) = do
468
468
return (f env)
469
469
470
470
-- | Convert a static value into a closure.
471
- staticClosure :: Typeable a => Static a -> Closure a
471
+ staticClosure :: Static a -> Closure a
472
472
staticClosure dec = closure (staticConst dec) empty
473
473
474
474
--------------------------------------------------------------------------------
475
475
-- Predefined static values --
476
476
--------------------------------------------------------------------------------
477
477
478
478
-- | 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 )
481
480
composeStatic = staticLabel " $compose"
482
481
483
482
-- | Static version of 'const'
484
- constStatic :: (Typeable a , Typeable b )
485
- => Static (a -> b -> a )
483
+ constStatic :: Static (a -> b -> a )
486
484
constStatic = staticLabel " $const"
487
485
488
486
-- | 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' ))
491
488
splitStatic = staticLabel " $split"
492
489
493
490
-- | Static version of 'Arrow.app'
494
- appStatic :: (Typeable a , Typeable b )
495
- => Static ((a -> b , a ) -> b )
491
+ appStatic :: Static ((a -> b , a ) -> b )
496
492
appStatic = staticLabel " $app"
497
493
498
494
-- | 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 )
501
496
flipStatic = staticLabel " $flip"
502
497
503
498
--------------------------------------------------------------------------------
504
499
-- Combinators on static values --
505
500
--------------------------------------------------------------------------------
506
501
507
502
-- | 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 )
510
504
staticCompose g f = composeStatic `staticApply` g `staticApply` f
511
505
512
506
-- | 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' ))
515
508
staticSplit f g = splitStatic `staticApply` f `staticApply` g
516
509
517
510
-- | Static version of 'Prelude.const'
518
- staticConst :: (Typeable a , Typeable b )
519
- => Static a -> Static (b -> a )
511
+ staticConst :: Static a -> Static (b -> a )
520
512
staticConst x = constStatic `staticApply` x
521
513
522
514
-- | 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 )
525
516
staticFlip f = flipStatic `staticApply` f
526
517
527
518
--------------------------------------------------------------------------------
528
519
-- Combinators on Closures --
529
520
--------------------------------------------------------------------------------
530
521
531
522
-- | 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
534
524
closureApplyStatic f (Closure decoder env) =
535
525
closure (f `staticCompose` decoder) env
536
526
537
527
decodeEnvPairStatic :: Static (ByteString -> (ByteString , ByteString ))
538
528
decodeEnvPairStatic = staticLabel " $decodeEnvPair"
539
529
540
530
-- | 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
543
533
closureApply (Closure fdec fenv) (Closure xdec xenv) =
544
534
closure decoder (encode (fenv, xenv))
545
535
where
@@ -551,11 +541,9 @@ closureApply (Closure fdec fenv) (Closure xdec xenv) =
551
541
decodeEnvPairStatic
552
542
553
543
-- | 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 )
556
545
closureCompose g f = composeStatic `closureApplyStatic` g `closureApply` f
557
546
558
547
-- | 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' ))
561
549
closureSplit f g = splitStatic `closureApplyStatic` f `closureApply` g
0 commit comments