TV-0.5.0: Tangible Values -- composable interfaces

PortabilityGADTs
Stabilityexperimental
Maintainerconal@conal.net
Safe HaskellNone

Interface.TV.Output

Contents

Description

Outputs (interfaces) -- means of presenting values

Synopsis

Output data type

data Output whereSource

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.

Constructors

OPrim :: snk a -> Output src snk a 
OLambda :: Input src a -> Output src snk b -> Output src snk (a -> b) 
OPair :: Output src snk a -> Output src snk b -> Output src snk (a, b) 
OTitle :: String -> Output src snk a -> Output src snk a 

Instances

Lambda (Input src) (Output src snk) 
Pair (Output src snk) 
Title_f (Output src snk) 
ContraFunctor snk => ContraFunctor (Output src snk) 
FunArr (OFun dom ran) (Output dom ran) 
Show (Output src snk a) 

output :: (Pair src, Pair snk, Lambda src snk, Title_f src, Title_f snk) => Output src snk t -> snk tSource

Output functions

Builders

oPrim :: snk a -> Output src snk aSource

Output primitive

oLambda :: Input src a -> Output src snk b -> Output src snk (a -> b)Source

Visualize a function. Akin to lambda

oPair :: Output src snk a -> Output src snk b -> Output src snk (a, b)Source

Visualize a pair

oTitle :: String -> Output src snk a -> Output src snk aSource

Title (label) an output

Canonicalizers

asOLambda :: Output src snk (a -> b) -> (Input src a, Output src snk b)Source

Dissect a function-valued output into input & output. Loses outer oTitles. Must be a (possibly titled) pair-style input.

asOPair :: Output src snk (a, b) -> (Output src snk a, Output src snk b)Source