diff options
Diffstat (limited to 'devel')
7 files changed, 164 insertions, 4 deletions
diff --git a/devel/hs-reactive/Makefile b/devel/hs-reactive/Makefile index 6b691a0acd3e..06b74fd3d348 100644 --- a/devel/hs-reactive/Makefile +++ b/devel/hs-reactive/Makefile @@ -13,11 +13,11 @@ CATEGORIES= devel haskell MAINTAINER= haskell@FreeBSD.org COMMENT= Push-pull functional reactive programming -BROKEN= cannot be compiled +FILE_LICENSE= COPYING -USE_CABAL= category-extras>=0.53.5 checkers>=0.2.3 \ - QuickCheck>=2.1.0.2 Stream>=0.3.1 TypeCompose>=0.8.0 \ - unamb>=0.1.5 vector-space>=0.5 +USE_CABAL= categories checkers>=0.2.3 comonad QuickCheck>=2.1.0.2 pointed \ + semigroups Stream>=0.3.1 TypeCompose>=0.8.0 unamb>=0.1.5 \ + vector-space>=0.5 .include "${.CURDIR}/../../lang/ghc/bsd.cabal.mk" .include <bsd.port.mk> diff --git a/devel/hs-reactive/files/patch-reactive.cabal b/devel/hs-reactive/files/patch-reactive.cabal new file mode 100644 index 000000000000..8a666a19567a --- /dev/null +++ b/devel/hs-reactive/files/patch-reactive.cabal @@ -0,0 +1,11 @@ +--- ./reactive.cabal.orig 2010-07-28 18:48:55.000000000 +0200 ++++ ./reactive.cabal 2011-07-16 11:00:09.000000000 +0200 +@@ -46,7 +46,7 @@ + Build-Depends: base >=4 && <5, old-time, random, QuickCheck >= 2.1.0.2, + TypeCompose>=0.8.0, vector-space>=0.5, + unamb>=0.1.5, checkers >= 0.2.3, +- category-extras >= 0.53.5, Stream >= 0.3.1 ++ categories, comonad, pointed, semigroups, Stream >= 0.3.1 + -- This library uses the ImpredicativeTypes flag, and it depends + -- on vector-space, which needs ghc >= 6.9 + if impl(ghc < 6.9) { diff --git a/devel/hs-reactive/files/patch-src__FRP__Reactive__Behavior.hs b/devel/hs-reactive/files/patch-src__FRP__Reactive__Behavior.hs new file mode 100644 index 000000000000..2161b4f2c1fc --- /dev/null +++ b/devel/hs-reactive/files/patch-src__FRP__Reactive__Behavior.hs @@ -0,0 +1,29 @@ +--- ./src/FRP/Reactive/Behavior.hs.orig 2010-07-28 18:48:55.000000000 +0200 ++++ ./src/FRP/Reactive/Behavior.hs 2011-07-16 11:20:55.000000000 +0200 +@@ -33,6 +33,8 @@ + + import Control.Compose ((:.)(..),unO) + ++import Data.Copointed ++import Data.Semigroup + import Data.VectorSpace + import Data.AffineSpace + +@@ -276,7 +278,7 @@ + + instance (Functor g, Functor f, Copointed g, Copointed f) + => Copointed (g :. f) where +- extract = extract . extract . unO ++ copoint = copoint . copoint . unO + + -- instance (Comonad g, Comonad f) => Comonad (g :. f) where + -- duplicate = inO (fmap duplicate . duplicate) +@@ -297,7 +299,7 @@ + -- instance Comonad (g :. f) where + -- duplicate + +-deriving instance (Monoid tr, Monoid tf) => Copointed (BehaviorG tr tf) ++deriving instance (Monoid tr, Monoid tf, Semigroup tf) => Copointed (BehaviorG tr tf) + + -- ITime and TimeT are not currently monoids. They can be when I wrap + -- them in the Sum monoid constructor, in which mempty = 0 and mappend = diff --git a/devel/hs-reactive/files/patch-src__FRP__Reactive__Fun.hs b/devel/hs-reactive/files/patch-src__FRP__Reactive__Fun.hs new file mode 100644 index 000000000000..1dc970e7c709 --- /dev/null +++ b/devel/hs-reactive/files/patch-src__FRP__Reactive__Fun.hs @@ -0,0 +1,29 @@ +--- ./src/FRP/Reactive/Fun.hs.orig 2010-07-28 18:48:55.000000000 +0200 ++++ ./src/FRP/Reactive/Fun.hs 2011-07-16 10:59:47.000000000 +0200 +@@ -37,6 +37,9 @@ + import Control.Comonad + + import Data.Zip (Zip(..)) ++import Data.Pointed ++import Data.Copointed ++import Data.Semigroup + + import Test.QuickCheck + import Test.QuickCheck.Checkers +@@ -120,14 +123,8 @@ + instance Pointed (Fun t) where + point = K + +-instance Monoid t => Copointed (Fun t) where +- extract = extract . apply +- +-instance Monoid t => Comonad (Fun t) where +- duplicate (K a) = K (K a) +- duplicate (Fun f) = Fun (Fun . duplicate f) +- +- ++instance (Semigroup t, Monoid t) => Copointed (Fun t) where ++ copoint = extract . apply + + ---------------------------------- + diff --git a/devel/hs-reactive/files/patch-src__FRP__Reactive__Internal__Future.hs b/devel/hs-reactive/files/patch-src__FRP__Reactive__Internal__Future.hs new file mode 100644 index 000000000000..b1aff91a64cb --- /dev/null +++ b/devel/hs-reactive/files/patch-src__FRP__Reactive__Internal__Future.hs @@ -0,0 +1,21 @@ +--- ./src/FRP/Reactive/Internal/Future.hs.orig 2010-07-28 18:48:55.000000000 +0200 ++++ ./src/FRP/Reactive/Internal/Future.hs 2011-07-16 11:01:46.000000000 +0200 +@@ -23,7 +23,8 @@ + + import Control.Applicative (Applicative(..)) + +-import Control.Comonad (Copointed,Comonad) ++import Control.Comonad ++import Data.Copointed + + import Test.QuickCheck + +@@ -44,7 +45,7 @@ + -- time\/value pair. Particularly useful with time types that have + -- non-flat structure. + newtype FutureG t a = Future { unFuture :: (Time t, a) } +- deriving (Functor, Applicative, Monad, Copointed, Comonad {-, Show-} ++ deriving (Functor, Applicative, Monad, Extend, Copointed, Comonad {-, Show-} + , Arbitrary, CoArbitrary) + + isNeverF :: (Bounded t, Eq t) => FutureG t t1 -> Bool diff --git a/devel/hs-reactive/files/patch-src__FRP__Reactive__Internal__Serial.hs b/devel/hs-reactive/files/patch-src__FRP__Reactive__Internal__Serial.hs new file mode 100644 index 000000000000..67007508e842 --- /dev/null +++ b/devel/hs-reactive/files/patch-src__FRP__Reactive__Internal__Serial.hs @@ -0,0 +1,23 @@ +--- ./src/FRP/Reactive/Internal/Serial.hs.orig 2010-07-28 18:48:55.000000000 +0200 ++++ ./src/FRP/Reactive/Internal/Serial.hs 2011-07-16 10:54:01.000000000 +0200 +@@ -1,4 +1,4 @@ +-{-# LANGUAGE Rank2Types, ImpredicativeTypes #-} ++{-# LANGUAGE Rank2Types #-} + -- We need ImpredicativeTypes, but GHC 6.8 doesn't think it + -- has them. The cabal file configures this in a compiler-dependent + -- way. +@@ -24,7 +24,7 @@ + import Control.Exception (bracket_) + + -- | Serializer. Turns actions into equivalent but serialized actions +-type Serial = forall a. IO a -> IO a ++newtype Serial = Serial { unSerial :: forall a. IO a -> IO a } + + -- | Make a locking serializer + makeSerial :: IO Serial +@@ -32,4 +32,4 @@ + + -- | Make a locking serializer with a given lock + locking :: MVar () -> Serial +-locking lock = bracket_ (putMVar lock ()) (takeMVar lock) ++locking lock = Serial $ bracket_ (putMVar lock ()) (takeMVar lock) diff --git a/devel/hs-reactive/files/patch-src__FRP__Reactive__PrimReactive.hs b/devel/hs-reactive/files/patch-src__FRP__Reactive__PrimReactive.hs new file mode 100644 index 000000000000..6fdadf331f7d --- /dev/null +++ b/devel/hs-reactive/files/patch-src__FRP__Reactive__PrimReactive.hs @@ -0,0 +1,47 @@ +--- ./src/FRP/Reactive/PrimReactive.hs.orig 2010-07-28 18:48:55.000000000 +0200 ++++ ./src/FRP/Reactive/PrimReactive.hs 2011-07-16 11:19:19.000000000 +0200 +@@ -63,6 +63,8 @@ + import Prelude hiding (zip,zipWith) + + import Data.Monoid ++import Data.Pointed ++import Data.Copointed + import Control.Applicative + import Control.Arrow (first) + import Control.Monad +@@ -708,17 +710,7 @@ + + instance Copointed (EventG t) where + -- E a -> F (R a) -> R a -> a +- extract = extract . extract . eFuture +- +--- Here's the plan for 'duplicate': +--- +--- E a -> F (R a) -> F (R (R a)) -> F (F (R (R a))) +--- -> F (R (F (R a))) -> E (F (R a)) -> E (E a) +- +- +-instance Monoid t => Comonad (EventG t) where +- duplicate = +- fmap Event . Event . fmap frTOrf . duplicate . fmap duplicate . eFuture ++ copoint = copoint . copoint . eFuture + + -- This frTOrf definition type-checks. Is it what we want? + frTOrf :: FutureG t (ReactiveG t a) -> ReactiveG t (FutureG t a) +@@ -738,14 +730,14 @@ + -- Semantically: extract == extract . rat == (`rat` mempty) But mempty + -- is the earliest time (since I'm using the Max monoid *), so here's a + -- cheap alternative that also doesn't require Ord t: +- extract (a `Stepper` _) = a ++ copoint (a `Stepper` _) = a + + -- extract r == extract (rat r) == rat r mempty + + -- * Moreover, mempty is the earliest time in the Sum monoid on + -- non-negative values, for relative-time behaviors. + +-instance Monoid t => Comonad (ReactiveG t) where ++instance Monoid t => Extend (ReactiveG t) where + duplicate r@(_ `Stepper` Event u) = + r `Stepper` Event (duplicate <$> u) + |