moo

Not on Stackage, so not searched. Genetic algorithm library
Create a synchronous function from a combinational function describing a moore machine
macT
:: Int        -- Current state
-> (Int,Int)  -- Input
-> (Int,Int)  -- Updated state
macT s (x,y) = x * y + s

mac
:: KnownDomain dom
=> Clock dom
-> Reset dom
-> Enable dom
-> Signal dom (Int, Int)
-> Signal dom Int
mac clk rst en = moore clk rst en macT id 0
>>> simulate (mac systemClockGen systemResetGen enableGen) [(0,0),(1,1),(2,2),(3,3),(4,4)]
[0,0,1,5,14...
...
Synchronous sequential functions can be composed just like their combinational counterpart:
dualMac
:: KnownDomain dom
=> Clock dom
-> Reset dom
-> Enable dom
-> (Signal dom Int, Signal dom Int)
-> (Signal dom Int, Signal dom Int)
-> Signal dom Int
dualMac clk rst en (a,b) (x,y) = s1 + s2
where
s1 = moore clk rst en macT id 0 (bundle (a,x))
s2 = moore clk rst en macT id 0 (bundle (b,y))
A version of moore that does automatic Bundleing Given a functions t and o of types:
t :: Int -> (Bool, Int) -> Int
o :: Int -> (Int, Bool)
When we want to make compositions of t and o in g using moore, we have to write:
g clk rst en a b c = (b1,b2,i2)
where
(i1,b1) = unbundle (moore clk rst en t o 0 (bundle (a,b)))
(i2,b2) = unbundle (moore clk rst en t o 3 (bundle (c,i1)))
Using mooreB however we can write:
g clk rst en a b c = (b1,b2,i2)
where
(i1,b1) = mooreB clk rst en t o 0 (a,b)
(i2,b2) = mooreB clk rst en t o 3 (c,i1)
Create a synchronous function from a combinational function describing a moore machine
macT
:: Int        -- Current state
-> (Int,Int)  -- Input
-> Int        -- Updated state
macT s (x,y) = x * y + s

mac
:: HiddenClockResetEnable dom
=> Signal dom (Int, Int)
-> Signal dom Int
mac = moore mac id 0
>>> simulate @System mac [(0,0),(1,1),(2,2),(3,3),(4,4)]
[0,0,1,5,14,30,...
...
Synchronous sequential functions can be composed just like their combinational counterpart:
dualMac
:: HiddenClockResetEnable dom
=> (Signal dom Int, Signal dom Int)
-> (Signal dom Int, Signal dom Int)
-> Signal dom Int
dualMac (a,b) (x,y) = s1 + s2
where
s1 = moore macT id 0 (bundle (a,x))
s2 = moore macT id 0 (bundle (b,y))
A version of moore that does automatic Bundleing Given a functions t and o of types:
t :: Int -> (Bool, Int) -> Int
o :: Int -> (Int, Bool)
When we want to make compositions of t and o in g using moore, we have to write:
g a b c = (b1,b2,i2)
where
(i1,b1) = unbundle (moore t o 0 (bundle (a,b)))
(i2,b2) = unbundle (moore t o 3 (bundle (c,i1)))
Using mooreB however we can write:
g a b c = (b1,b2,i2)
where
(i1,b1) = mooreB t o 0 (a,b)
(i2,b2) = mooreB t o 3 (c,i1)
Create a DataFlow circuit from a Moore machine description as those of Clash.Prelude.Moore
The returned arrow has intentionally no s type parameter, in order to let you apply the parameter generator to control signals with control sampling rate that is different from the one target audio sampling rate.
Calculate the Moon's angular size at the given distance.
Calculate the Moon's position-angle of the bright limb. It takes the Moon's coordinates and the Sun's coordinates. Position-angle is the angle of the midpoint of the illuminated limb measured eastwards from the north point of the disk.
Calculates the Moon's Distance at the given julian date. Returns distance to the Moon moonDistance1 :: JulianDate -> MoonDistanceUnits you can use mduToKm (defined in Data.Astro.Moon.MoonDetails) to convert result to kilometers
Calculates the Moon's horizontal parallax at the given distance.
Calculates the Moon's phase (the area of the visible segment expressed as a fraction of the whole disk) at the given universal time.
Calculate Equatorial Coordinates of the Moon with the given MoonDetails and at the given JulianDate. It is recommended to use j2010MoonDetails as a first parameter.