numeric-prelude-0.4.4: An experimental alternative hierarchy of numeric type classes
Safe HaskellSafe-Inferred
LanguageHaskell98

NumericPrelude.Elementwise

Synopsis
  • newtype T v a = Cons {}
  • with :: a -> T v a
  • element :: (v -> a) -> T v a
  • run2 :: T (x, y) a -> x -> y -> a
  • run3 :: T (x, y, z) a -> x -> y -> z -> a
  • run4 :: T (x, y, z, w) a -> x -> y -> z -> w -> a
  • run5 :: T (x, y, z, u, w) a -> x -> y -> z -> u -> w -> a

Documentation

newtype T v a Source #

A reader monad for the special purpose of defining instances of certain operations on tuples and records. It does not add any new functionality to the common Reader monad, but it restricts the functions to the required ones and exports them from one module. That is you do not have to import both Control.Monad.Trans.Reader and Control.Applicative. The type also tells the user, for what the Reader monad is used. We can more easily replace or extend the implementation when needed.

Constructors

Cons 

Fields

  • run :: v -> a
     

Instances

Instances details
Functor (T v) Source # 
Instance details

Defined in NumericPrelude.Elementwise

Methods

fmap :: (a -> b) -> T v a -> T v b #

(<$) :: a -> T v b -> T v a #

Applicative (T v) Source # 
Instance details

Defined in NumericPrelude.Elementwise

Methods

pure :: a -> T v a #

(<*>) :: T v (a -> b) -> T v a -> T v b #

liftA2 :: (a -> b -> c) -> T v a -> T v b -> T v c #

(*>) :: T v a -> T v b -> T v b #

(<*) :: T v a -> T v b -> T v a #

with :: a -> T v a Source #

element :: (v -> a) -> T v a Source #

run2 :: T (x, y) a -> x -> y -> a Source #

run3 :: T (x, y, z) a -> x -> y -> z -> a Source #

run4 :: T (x, y, z, w) a -> x -> y -> z -> w -> a Source #

run5 :: T (x, y, z, u, w) a -> x -> y -> z -> u -> w -> a Source #