Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- blinking :: Behavior Bool
- firstIteration :: Behavior Bool
- frequency :: Integer -> Behavior Bool
- data MilliSeconds = MilliSeconds (Stream Word32)
- data MicroSeconds = MicroSeconds (Stream Word32)
- delay :: Delay
- data Delay = Delay
- class IfThenElse t a where
- ifThenElse :: Behavior Bool -> t a -> t a -> t a
- scheduleB :: (Typed t, Eq t, Ord pinid) => Behavior t -> [(t, GenSketch pinid ())] -> GenSketch pinid ()
- sketchSpec :: Ord pinid => GenSketch pinid a -> Spec
- liftB :: (Behavior a -> Behavior r) -> TypedBehavior t a -> Behavior r
- liftB2 :: (Behavior a -> Behavior b -> Behavior r) -> TypedBehavior t a -> TypedBehavior t b -> Behavior r
Documentation
firstIteration :: Behavior Bool Source #
True on the first iteration of the Sketch
, and False thereafter.
frequency :: Integer -> Behavior Bool Source #
Use this to make an event occur 1 time out of n.
This is implemented using Copilot's clk
:
frequency = clk (period n) (phase 1)
class IfThenElse t a where Source #
ifThenElse :: Behavior Bool -> t a -> t a -> t a Source #
This allows "if then else" expressions to be written that choose between two Streams, or Behaviors, or TypedBehaviors, or Sketches, when the RebindableSyntax language extension is enabled.
{-# LANGUAGE RebindableSyntax #-} buttonpressed <- input pin3 if buttonpressed then ... else ...
Instances
Typed a => IfThenElse Stream a Source # | |
Defined in Copilot.FRPSketch | |
Ord pinid => IfThenElse (GenSketch pinid) () Source # | |
Defined in Copilot.FRPSketch | |
(Ord pinid, Typed a) => IfThenElse (GenSketch pinid) (Behavior a) Source # | |
Typed a => IfThenElse (TypedBehavior p) a Source # | |
Defined in Copilot.FRPSketch ifThenElse :: Behavior Bool -> TypedBehavior p a -> TypedBehavior p a -> TypedBehavior p a Source # |
scheduleB :: (Typed t, Eq t, Ord pinid) => Behavior t -> [(t, GenSketch pinid ())] -> GenSketch pinid () Source #
Schedule when to perform different Sketches.
liftB :: (Behavior a -> Behavior r) -> TypedBehavior t a -> Behavior r Source #
Apply a Copilot DSL function to a TypedBehavior
.
liftB2 :: (Behavior a -> Behavior b -> Behavior r) -> TypedBehavior t a -> TypedBehavior t b -> Behavior r Source #
Apply a Copilot DSL function to two TypedBehavior
s.