module FRP.Yampa.Basic (
identity,
constant,
(-->),
(-:>),
(>--),
(-=>),
(>=-),
initially
) where
import FRP.Yampa.InternalCore (SF(..), SF'(..), sfConst, sfId)
infixr 0 -->, -:>, >--, -=>, >=-
identity :: SF a a
identity :: SF a a
identity = SF :: forall a b. (a -> Transition a b) -> SF a b
SF {sfTF :: a -> Transition a a
sfTF = \a
a -> (SF' a a
forall a. SF' a a
sfId, a
a)}
{-# ANN constant "HLint: ignore Use const" #-}
constant :: b -> SF a b
constant :: b -> SF a b
constant b
b = SF :: forall a b. (a -> Transition a b) -> SF a b
SF {sfTF :: a -> Transition a b
sfTF = \a
_ -> (b -> SF' a b
forall b a. b -> SF' a b
sfConst b
b, b
b)}
(-->) :: b -> SF a b -> SF a b
b
b0 --> :: b -> SF a b -> SF a b
--> (SF {sfTF :: forall a b. SF a b -> a -> Transition a b
sfTF = a -> Transition a b
tf10}) = SF :: forall a b. (a -> Transition a b) -> SF a b
SF {sfTF :: a -> Transition a b
sfTF = \a
a0 -> (Transition a b -> SF' a b
forall a b. (a, b) -> a
fst (a -> Transition a b
tf10 a
a0), b
b0)}
(-:>) :: b -> SF a b -> SF a b
b
b0 -:> :: b -> SF a b -> SF a b
-:> (SF {sfTF :: forall a b. SF a b -> a -> Transition a b
sfTF = a -> Transition a b
tf10}) = SF :: forall a b. (a -> Transition a b) -> SF a b
SF {sfTF :: a -> Transition a b
sfTF = \a
_a0 -> (SF' a b
ct, b
b0)}
where ct :: SF' a b
ct = (DTime -> a -> Transition a b) -> SF' a b
forall a b. (DTime -> a -> Transition a b) -> SF' a b
SF' ((DTime -> a -> Transition a b) -> SF' a b)
-> (DTime -> a -> Transition a b) -> SF' a b
forall a b. (a -> b) -> a -> b
$ \DTime
_dt a
a0 -> a -> Transition a b
tf10 a
a0
(>--) :: a -> SF a b -> SF a b
a
a0 >-- :: a -> SF a b -> SF a b
>-- (SF {sfTF :: forall a b. SF a b -> a -> Transition a b
sfTF = a -> Transition a b
tf10}) = SF :: forall a b. (a -> Transition a b) -> SF a b
SF {sfTF :: a -> Transition a b
sfTF = \a
_ -> a -> Transition a b
tf10 a
a0}
(-=>) :: (b -> b) -> SF a b -> SF a b
b -> b
f -=> :: (b -> b) -> SF a b -> SF a b
-=> (SF {sfTF :: forall a b. SF a b -> a -> Transition a b
sfTF = a -> Transition a b
tf10}) =
SF :: forall a b. (a -> Transition a b) -> SF a b
SF {sfTF :: a -> Transition a b
sfTF = \a
a0 -> let (SF' a b
sf1, b
b0) = a -> Transition a b
tf10 a
a0 in (SF' a b
sf1, b -> b
f b
b0)}
{-# ANN (>=-) "HLint: ignore Avoid lambda" #-}
(>=-) :: (a -> a) -> SF a b -> SF a b
a -> a
f >=- :: (a -> a) -> SF a b -> SF a b
>=- (SF {sfTF :: forall a b. SF a b -> a -> Transition a b
sfTF = a -> Transition a b
tf10}) = SF :: forall a b. (a -> Transition a b) -> SF a b
SF {sfTF :: a -> Transition a b
sfTF = \a
a0 -> a -> Transition a b
tf10 (a -> a
f a
a0)}
initially :: a -> SF a a
initially :: a -> SF a a
initially = (a -> SF a a -> SF a a
forall b a. b -> SF a b -> SF a b
--> SF a a
forall a. SF a a
identity)