Rattus-0.1.0.0: A modal FRP language

Safe HaskellSafe
LanguageHaskell2010

Rattus.Arrow

Description

This module provides a variant of the standard Arrow type class with a different arr method so that it can be implemented for signal functions in Rattus.

Synopsis

Documentation

class Category a => Arrow a where Source #

Variant of the standard Arrow type class with a different arr method so that it can be implemented for signal functions in Rattus.

Minimal complete definition

arrBox, (first | (***))

Methods

arrBox :: Box (b -> c) -> a b c Source #

Lift a function to an arrow. It is here the definition of the Arrow class differs from the standard one. The function to be lifted has to be boxed.

first :: a b c -> a (b, d) (c, d) Source #

Send the first component of the input through the argument arrow, and copy the rest unchanged to the output.

second :: a b c -> a (d, b) (d, c) Source #

A mirror image of first.

The default definition may be overridden with a more efficient version if desired.

(***) :: a b c -> a b' c' -> a (b, b') (c, c') Source #

Split the input between the two argument arrows and combine their output. Note that this is in general not a functor.

(&&&) :: a b c -> a b c' -> a b (c, c') Source #

Fanout: send the input to both argument arrows and combine their output.

The default definition may be overridden with a more efficient version if desired.

Instances
Arrow SF Source # 
Instance details

Defined in Rattus.Yampa

Methods

arrBox :: Box (b -> c) -> SF b c Source #

first :: SF b c -> SF (b, d) (c, d) Source #

second :: SF b c -> SF (d, b) (d, c) Source #

(***) :: SF b c -> SF b' c' -> SF (b, b') (c, c') Source #

(&&&) :: SF b c -> SF b c' -> SF b (c, c') Source #

arr :: Arrow a => (b -> c) -> a b c Source #

This combinator is subject to the same restrictions as the box primitive of Rattus. That is,

  Γ☐ ⊢ t :: b -> c
--------------------
 Γ ⊢ arr t :: a b c

where Γ☐ is obtained from Γ by removing ✓ and any variables x :: 𝜏, where 𝜏 is not a stable type.

returnA :: Arrow a => a b b Source #

The identity arrow, which plays the role of return in arrow notation.