Wired-0.3: Wire-aware hardware description

Safe HaskellNone

Data.Hardware.Internal

Contents

Description

This module defines types of a general nature that are used by the Lava, Layout and Wired libraries. It also defines operations on those types.

Synopsis

Type-parameterized results

data Res t a Source

The phantom parameter t can be used to pass a type constraint to an overloaded function.

Constructors

R 

Fields

result :: !a
 

Instances

Functor (Res t) 
Eq a => Eq (Res t a) 
Show a => Show (Res t a) 

Difference strings

Identifiers

Numerical types

icast :: (IntCast m, IntCast n) => m -> nSource

dcast :: (DoubleCast m, DoubleCast n) => m -> nSource

class Multiply n1 n2 n3 | n1 n2 -> n3, n1 n3 -> n2, n2 n3 -> n1 whereSource

Methods

(><) :: n1 -> n2 -> n3Source

class Value v whereSource

Methods

value :: v -> RationalSource

Instances

timeCast :: (IsTime t1, IsTime t2) => t1 -> t2Source

Misc. types

data Angle Source

Constructors

Horizontal 
Vertical 

Instances

Total lookup in partial maps

totalLookup :: Ord k => k -> Map k [a] -> [a]Source

A lookup function that is defined for all keys.

Spanning trees

spanning :: ((Position, Position) -> Double) -> [Position] -> [(Position, Position)]Source

Computes the minimal spanning tree based on the given distance function.

Properties

Bilinear interpolation

data Table2D i x y q Source

Constructors

Table2D 

Fields

tableLengthX :: i
 
tableLengthY :: i
 
tableAxisX :: i -> x
 
tableAxisY :: i -> y
 
tableValues :: i -> i -> q
 

nearestPoints :: (Num i, Eq i, Ord a) => i -> (i -> a) -> a -> ((i, a), (i, a))Source

bilinInterpolate1 :: (Fractional x, Fractional y, Fractional q, DoubleCast x, DoubleCast y, DoubleCast q) => (x, y) -> (x, y) -> (q, q, q, q) -> x -> y -> qSource

findPoints :: (Num i, Eq i, Ord x, Ord y) => Table2D i x y q -> x -> y -> ((x, y), (x, y), (q, q, q, q))Source

bilinInterpolate :: (Num i, Eq i, Ord x, Ord y, Fractional x, Fractional y, Fractional q, DoubleCast x, DoubleCast y, DoubleCast q) => Table2D i x y q -> x -> y -> qSource