Wired-0.2.1: Wire-aware hardware descriptionSource codeContentsIndex
Data.Hardware.Internal
Contents
Type-parameterized results
Difference strings
Identifiers
Numerical types
Misc. types
Total lookup in partial maps
Spanning trees
Properties
Bilinear interpolation
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
data Res t a = R {
result :: !a
}
(.+) :: ShowS -> ShowS -> ShowS
unwordS :: [ShowS] -> ShowS
unlineS :: [ShowS] -> ShowS
type Name = String
type Tag = String
class Num n => IntCast n where
toInt :: n -> Int
fromInt :: Int -> n
class Num n => DoubleCast n where
toDouble :: n -> Double
fromDouble :: Double -> n
icast :: (IntCast m, IntCast n) => m -> n
dcast :: (DoubleCast m, DoubleCast n) => m -> n
class Multiply n1 n2 n3 | n1 n2 -> n3, n1 n3 -> n2, n2 n3 -> n1 where
(><) :: n1 -> n2 -> n3
newtype InPin = InPin Int
newtype OutPin = OutPin Int
newtype PrimInpId = PrimInpId Int
newtype CellId = CellId Int
newtype Length = Length {
unLength :: Integer
}
type XPos = Length
type YPos = Length
type Width = Length
type Height = Length
class Value v where
value :: v -> Rational
addLen :: Length -> Length -> Length
subLen :: Length -> Length -> Length
mulLen :: Integral n => Length -> n -> Length
mulLen2 :: Length -> Length -> Integer
divLen :: Integral n => Length -> n -> Length
newtype Layer_ = Layer Int
type Layer = Int
newtype Capacitance = Cap Double
newtype Resistance = Res Double
newtype Time = Time Double
type Delay = Time
newtype TransitionTime = TransitionTime Double
class DoubleCast t => IsTime t
timeCast :: (IsTime t1, IsTime t2) => t1 -> t2
type Position = (XPos, YPos)
type Size = (Width, Height)
data Angle
= Horizontal
| Vertical
data Direction
= Rightwards
| Leftwards
| Upwards
| Downwards
type Orientation = (Bool, Direction)
directionAngle :: Direction -> Angle
north :: Orientation
totalLookup :: Ord k => k -> Map k [a] -> [a]
spanning :: ((Position, Position) -> Double) -> [Position] -> [(Position, Position)]
euclidDistance :: (Position, Position) -> Double
rectiDistance :: (Position, Position) -> Double
euclidSpanning :: [Position] -> [(Position, Position)]
rectiSpanning :: [Position] -> [(Position, Position)]
data Table2D i x y q = Table2D {
tableLengthX :: i
tableLengthY :: i
tableAxisX :: i -> x
tableAxisY :: i -> y
tableValues :: i -> i -> q
}
nearestPoints :: (Num i, Ord a) => i -> (i -> a) -> a -> ((i, a), (i, a))
bilinInterpolate1 :: (Fractional x, Fractional y, Fractional q, DoubleCast x, DoubleCast y, DoubleCast q) => (x, y) -> (x, y) -> (q, q, q, q) -> x -> y -> q
findPoints :: (Num i, Ord x, Ord y) => Table2D i x y q -> x -> y -> ((x, y), (x, y), (q, q, q, q))
bilinInterpolate :: (Num i, Ord x, Ord y, Fractional x, Fractional y, Fractional q, DoubleCast x, DoubleCast y, DoubleCast q) => Table2D i x y q -> x -> y -> q
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
result :: !a
show/hide Instances
Functor (Res t)
Eq a => Eq (Res t a)
Show a => Show (Res t a)
Difference strings
(.+) :: ShowS -> ShowS -> ShowSSource
unwordS :: [ShowS] -> ShowSSource
unlineS :: [ShowS] -> ShowSSource
Identifiers
type Name = StringSource
type Tag = StringSource
Numerical types
class Num n => IntCast n whereSource
Methods
toInt :: n -> IntSource
fromInt :: Int -> nSource
show/hide Instances
class Num n => DoubleCast n whereSource
Methods
toDouble :: n -> DoubleSource
fromDouble :: Double -> nSource
show/hide Instances
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
show/hide Instances
newtype InPin Source
Constructors
InPin Int
show/hide Instances
newtype OutPin Source
Constructors
OutPin Int
show/hide Instances
newtype PrimInpId Source
Constructors
PrimInpId Int
show/hide Instances
newtype CellId Source
Constructors
CellId Int
show/hide Instances
newtype Length Source
Constructors
Length
unLength :: Integer
show/hide Instances
type XPos = LengthSource
type YPos = LengthSource
type Width = LengthSource
type Height = LengthSource
class Value v whereSource
Methods
value :: v -> RationalSource
show/hide Instances
addLen :: Length -> Length -> LengthSource
subLen :: Length -> Length -> LengthSource
mulLen :: Integral n => Length -> n -> LengthSource
mulLen2 :: Length -> Length -> IntegerSource
divLen :: Integral n => Length -> n -> LengthSource
newtype Layer_ Source
Constructors
Layer Int
show/hide Instances
type Layer = IntSource
newtype Capacitance Source
Constructors
Cap Double
show/hide Instances
newtype Resistance Source
Constructors
Res Double
show/hide Instances
newtype Time Source
Constructors
Time Double
show/hide Instances
type Delay = TimeSource
newtype TransitionTime Source
Constructors
TransitionTime Double
show/hide Instances
class DoubleCast t => IsTime t Source
show/hide Instances
timeCast :: (IsTime t1, IsTime t2) => t1 -> t2Source
Misc. types
type Position = (XPos, YPos)Source
type Size = (Width, Height)Source
data Angle Source
Constructors
Horizontal
Vertical
show/hide Instances
data Direction Source
Constructors
Rightwards
Leftwards
Upwards
Downwards
show/hide Instances
type Orientation = (Bool, Direction)Source
directionAngle :: Direction -> AngleSource
north :: OrientationSource
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.
euclidDistance :: (Position, Position) -> DoubleSource
rectiDistance :: (Position, Position) -> DoubleSource
euclidSpanning :: [Position] -> [(Position, Position)]Source
rectiSpanning :: [Position] -> [(Position, Position)]Source
Properties
Bilinear interpolation
data Table2D i x y q Source
Constructors
Table2D
tableLengthX :: i
tableLengthY :: i
tableAxisX :: i -> x
tableAxisY :: i -> y
tableValues :: i -> i -> q
nearestPoints :: (Num 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, Ord x, Ord y) => Table2D i x y q -> x -> y -> ((x, y), (x, y), (q, q, q, q))Source
bilinInterpolate :: (Num 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
Produced by Haddock version 2.4.2