1 module Types where
    2 import Array
    3 
    4 type Name             = String
    5 type Seed             = Integer
    6 type Time             = Exact
    7 type Temperature        = Approx
    8 type RBC               = Approx
    9 
   10 type State           = Vector Approx
   11 type Output         = Vector Approx
   12 type Random         = [Approx]
   13 
   14 type Circuit       = [(Index, Index, Index, Element)]
   15 data Element       = Conductor Exact
   16                      | Resistor  Exact
   17                      | Capacitor (Exact, Exact)
   18                      | Inductor  (Exact, Exact)
   19                      | Vsource   List
   20                      | Isource   List
   21                      | Junction  (Exact, Exact, Exact)    deriving Show
   22 type List             = [(Approx, Approx)]
   23 
   24 type Index           = Int
   25 type Vector a     = Array  Index         a
   26 type Matrix a     = Array (Index, Index) a
   27 
   28 type Exact           = Rational
   29 type Approx         = Double
   30 
   31 circa :: Exact -> Approx
   32 circa            = fromRational