packages feed

TV 0.4 → 0.4.2

raw patch · 8 files changed

+38/−31 lines, 8 filesdep ~DeepArrowdep ~base

Dependency ranges changed: DeepArrow, base

Files

TV.cabal view
@@ -1,5 +1,5 @@ Name:                TV-Version:             0.4+Version:             0.4.2 Synopsis:	     Tangible Values -- composable interfaces Category:            Interfaces Description:@@ -21,11 +21,11 @@ Maintainer:          conal@conal.net Homepage:            http://haskell.org/haskellwiki/TV Package-Url:	     http://darcs.haskell.org/packages/TV-Copyright:           (c) 2006 by Conal Elliott+Copyright:           (c) 2006,2009 by Conal Elliott License:             BSD3 Stability:	     experimental Hs-Source-Dirs:      src-Build-Depends:       base, DeepArrow, TypeCompose >= 0.2+Build-Depends:       base<5, DeepArrow>=0.3.1, TypeCompose >= 0.2 tested-with:	     GHC==6.6 build-type:	     Simple Exposed-Modules:     @@ -39,4 +39,4 @@                      Interface.TV.Defaults Extra-Source-Files:                        Examples-ghc-options:         -W+ghc-options:         -Wall
src/Examples.hs view
@@ -1,8 +1,7 @@ {-# LANGUAGE OverlappingInstances, UndecidableInstances-           , IncoherentInstances, FlexibleContexts #-}--- For ghc 6.6 compatibility--- {-# OPTIONS -fglasgow-exts #-}-+           , IncoherentInstances, FlexibleContexts +           , FlexibleInstances+           #-} ---- Some TV examples.  See also GuiTV.  module Examples where@@ -10,6 +9,7 @@ import Data.List (sort) import Control.Compose (cofmap,OI) import Control.Arrow.DeepArrow ((->|))+import Data.FunArr  -- TypeCompose import Data.Title@@ -33,14 +33,17 @@ -- GHC wants to use the [a] rather than the String instances of DefaultIn -- and DefaultOut.  I thought the rule is most specific instance wins. ---  This one reverses twice-revTwice :: CTV (String -> String)-revTwice = reverseT ->| reverseT+-- --  This one reverses twice+-- revTwice :: CTV (String -> String)+-- revTwice = reverseT ->| reverseT  -- Same problem with more general type: --   revTwice :: (Read a, Show a, CommonIns src, CommonOuts snk) => --               TV src snk ([a] -> [a]) +-- I'm getting a type error even with the more specifically-typed+-- revTwice.  "Could not deduce (FunArr ...)".  Is it a bug in+-- type-checking with mutual dependencies?   Investigate.   ---- IO examples
src/Interface/TV/Common.hs view
@@ -1,7 +1,5 @@ {-# LANGUAGE Rank2Types, TypeOperators, TypeSynonymInstances,     PatternGuards, FlexibleInstances #-}--- For ghc 6.6 compatibility--- {-# OPTIONS -fglasgow-exts #-}  ---------------------------------------------------------------------- -- |
src/Interface/TV/Defaults.hs view
@@ -1,8 +1,6 @@ {-# LANGUAGE MultiParamTypeClasses, OverlappingInstances            , TypeSynonymInstances, FlexibleInstances, UndecidableInstances            , IncoherentInstances #-}--- For ghc 6.6 compatibility--- {-# OPTIONS -fglasgow-exts -fallow-overlapping-instances -fallow-incoherent-instances #-}  ---------------------------------------------------------------------- -- |
src/Interface/TV/Input.hs view
@@ -1,8 +1,4 @@ {-# LANGUAGE GADTs, KindSignatures #-}--- For ghc 6.6 compatibility--- {-# OPTIONS -fglasgow-exts #-}-- ---------------------------------------------------------------------- -- | -- Module      :  Interface.TV.Input
src/Interface/TV/OFun.hs view
@@ -1,7 +1,5 @@-{-# LANGUAGE MultiParamTypeClasses #-}--- For ghc 6.6 compatibility--- {-# OPTIONS -fglasgow-exts #-}-+{-# LANGUAGE MultiParamTypeClasses, CPP #-}+{-# OPTIONS -fno-warn-orphans #-} ---------------------------------------------------------------------- -- | -- Module      :  Interface.TV.OFun@@ -17,12 +15,25 @@  module Interface.TV.OFun (OX,OFun, wrapO{-,wrapAO-}) where +#if __GLASGOW_HASKELL__ >= 609+import Control.Category+import Prelude hiding ((.), id)+#endif+ import Control.Arrow+#if __GLASGOW_HASKELL__ < 610+                      hiding (pure)+#endif + import Control.Compose (Cofunctor(..))  import Data.FunArr import Control.Arrow.DeepArrow+#if __GLASGOW_HASKELL__ >= 609+import Control.Category+import Prelude hiding ((.), id)+#endif  import Interface.TV.Output import Interface.TV.Input@@ -36,14 +47,21 @@  -- TODO: consider generalizing from "->" in IFun? +#if __GLASGOW_HASKELL__ >= 609+instance Category (OFun dom ran) where+  id              = idA+  OFun g . OFun f = OFun (g . f)+#endif+ instance Arrow (OFun dom ran) where   -- (a->b) -> OFun dom ran a b   arr = error "Interface.TV.OFun: no 'arr' method"         -- We could use the following definition instead.         -- const $ OFun (const OEmpty)-+#if __GLASGOW_HASKELL__ < 609   -- OFun dom ran a b -> OFun dom ran b c -> OFun dom ran a c   OFun f >>> OFun g = OFun (f >>> g)+#endif    -- OFun dom ran a a' -> OFun dom ran (a,b) (a',b)   first (OFun f) = OFun (firstO f)
src/Interface/TV/Output.hs view
@@ -1,7 +1,4 @@ {-# LANGUAGE GADTs, KindSignatures, MultiParamTypeClasses #-}--- For ghc 6.6 compatibility--- {-# OPTIONS -fglasgow-exts #-}- ---------------------------------------------------------------------- -- | -- Module      :  Interface.TV.Output@@ -83,7 +80,7 @@     Canonicalizers ----------------------------------------------------------} --- | Dissect a pair-valued input into two inputs.  Loses outer 'oTitle's.+-- | Dissect a function-valued output into input & output.  Loses outer 'oTitle's. -- Must be a (possibly titled) pair-style input. asOLambda :: Output src snk (a->b) -> (Input src a, Output src snk b) asOLambda (OLambda a b) = (a,b)
src/Interface/TV/Tangible.hs view
@@ -1,7 +1,4 @@ {-# LANGUAGE Rank2Types, TypeOperators #-}--- For ghc 6.6 compatibility--- {-# OPTIONS -fglasgow-exts #-}- ---------------------------------------------------------------------- -- | -- Module      :  Interface.TV.Tangible