TV 0.4.9 → 0.5.0
raw patch · 4 files changed
+42/−62 lines, 4 filesdep ~DeepArrowPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: DeepArrow
API changes (from Hackage documentation)
- Interface.TV.Input: data Input src :: * -> *
+ Interface.TV.Input: data Input :: (* -> *) -> * -> *
- Interface.TV.Output: data Output src snk :: * -> *
+ Interface.TV.Output: data Output :: (* -> *) -> (* -> *) -> * -> *
Files
- TV.cabal +35/−33
- src/Interface/TV/Input.hs +2/−3
- src/Interface/TV/OFun.hs +3/−20
- src/Interface/TV/Output.hs +2/−6
TV.cabal view
@@ -1,7 +1,7 @@-Name: TV-Version: 0.4.9-Synopsis: Tangible Values -- composable interfaces-Category: Interfaces+Name: TV+Version: 0.5.0+Synopsis: Tangible Values -- composable interfaces+Category: Interfaces Description: TV is a library for composing /tangible values/ (\"TVs\"), i.e., values that carry along external interfaces. Values and interfaces are@@ -12,32 +12,34 @@ For more information, including examples, please see the project wiki page <http://haskell.org/haskellwiki/TV> .- This page and the module documentation pages have links to colorized- source code and to wiki pages where you can read and contribute /user- comments/. Enjoy!- .- © 2006-2012 by Conal Elliott; BSD3 license.-Author: Conal Elliott -Maintainer: conal@conal.net-Homepage: http://haskell.org/haskellwiki/TV-Package-Url: http://code.haskell.org/~conal/code/TV-Copyright: (c) 2006-2012 by Conal Elliott-License: BSD3-License-File: COPYING-Stability: experimental-Hs-Source-Dirs: src-Build-Depends: base<5, DeepArrow>=0.3.1, TypeCompose >= 0.9.1-tested-with: GHC==6.6-build-type: Simple-Exposed-Modules: - Interface.TV- Interface.TV.Input- Interface.TV.Output- Interface.TV.Tangible- Interface.TV.OFun- Interface.TV.Common- Interface.TV.IO- Interface.TV.Defaults-Extra-Source-Files: - src/Examples.hs-ghc-options: -Wall+ © 2006-2013 by Conal Elliott; BSD3 license.+Author: Conal Elliott +Maintainer: conal@conal.net+Copyright: (c) 2006-2013 by Conal Elliott+Homepage: http://haskell.org/haskellwiki/TV+License: BSD3+License-File: COPYING+Cabal-Version: >= 1.8+Build-type: Simple+Stability: experimental+Extra-source-files:+ src/Examples.hs++source-repository head+ type: git+ location: git://github.com/conal/TV.git+++Library+ Hs-Source-Dirs: src+ Build-Depends: base<5, DeepArrow>=0.4.0, TypeCompose >= 0.9.1+ Exposed-Modules:+ Interface.TV+ Interface.TV.Input+ Interface.TV.Output+ Interface.TV.Tangible+ Interface.TV.OFun+ Interface.TV.Common+ Interface.TV.IO+ Interface.TV.Defaults+ ghc-options: -Wall
src/Interface/TV/Input.hs view
@@ -2,7 +2,7 @@ ---------------------------------------------------------------------- -- | -- Module : Interface.TV.Input--- Copyright : (c) Conal Elliott 2007+-- Copyright : (c) Conal Elliott 2007-2013 -- License : BSD3 -- -- Maintainer : conal@conal.net@@ -33,7 +33,7 @@ -- | An /Input/ describes a way to obtain a functional value from a user. -- Used in @Output@ for making function visualizations. -- The constructors: primitive, pairing, and title.-data Input src :: * -> * where+data Input :: (* -> *) -> * -> * where -- -- | Input primitive IPrim :: src a -> Input src a -- -- | Input a pair@@ -42,7 +42,6 @@ -- ICompose :: Input src a -> src (a -> b) -> Input src b -- -- | Title/label an input ITitle :: String -> Input src a -> Input src a- -- As of 2010-09-10, Haddock still doesn't support doc comments for GADT -- constructors. See <http://trac.haskell.org/haddock/ticket/43>.
src/Interface/TV/OFun.hs view
@@ -1,9 +1,9 @@-{-# LANGUAGE MultiParamTypeClasses, CPP #-}+{-# LANGUAGE MultiParamTypeClasses #-} {-# OPTIONS -fno-warn-orphans #-} ---------------------------------------------------------------------- -- | -- Module : Interface.TV.OFun--- Copyright : (c) Conal Elliott 2006+-- Copyright : (c) Conal Elliott 2006-2013 -- License : BSD3 -- -- Maintainer : conal@conal.net@@ -15,25 +15,15 @@ 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 (ContraFunctor(..)) import Data.FunArr import Control.Arrow.DeepArrow-#if __GLASGOW_HASKELL__ >= 609 && __GLASGOW_HASKELL__ < 612-import Control.Category-import Prelude hiding ((.), id)-#endif import Interface.TV.Output import Interface.TV.Input@@ -47,21 +37,15 @@ -- TODO: consider generalizing from "->" in IFun? -#if __GLASGOW_HASKELL__ >= 609 instance Category (OFun dom ran) where- id = idA+ id = OFun id 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)@@ -74,7 +58,6 @@ f &&& g = dupA >>> f *** g instance DeepArrow (OFun dom ran) where- idA = OFun id dupA = postFun "dup" dupO fstA = postFun "first half" fstO sndA = postFun "second half" sndO
src/Interface/TV/Output.hs view
@@ -2,7 +2,7 @@ ---------------------------------------------------------------------- -- | -- Module : Interface.TV.Output--- Copyright : (c) Conal Elliott 2006+-- Copyright : (c) Conal Elliott 2006-2013 -- License : BSD3 -- -- Maintainer : conal@conal.net@@ -25,17 +25,13 @@ -- , Output', oPrim' ) where - import Control.Compose (ContraFunctor(..)) import Data.Pair (Pair(..)) import Data.Lambda (Lambda(..)) import Data.Title (Title_f(..)) - import Interface.TV.Input -- {---------------------------------------------------------- Output data type ----------------------------------------------------------}@@ -43,7 +39,7 @@ -- | An /Output/ describes a way to present a functional value, perhaps -- interactively. It is the user-interface half of a tangible value. -- The constructors: primitive, function, pairing, and title.-data Output src snk :: * -> * where+data Output :: (* -> *) -> (* -> *) -> * -> * where -- -- | Output primitive OPrim :: snk a -> Output src snk a -- -- | Visualize a function. Akin to /lambda/