Skip to content

Commit

Permalink
Starts NoLoop example with a bang
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Solomon committed Feb 27, 2022
1 parent ae4e606 commit dc97925
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions examples/no-loop/NoLoop.purs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@ module WAGS.Example.NoLoop where

import Prelude

import Control.Alt ((<|>))
import Data.Array.NonEmpty (NonEmptyArray, fromArray, fromNonEmpty)
import Data.Foldable (for_)
import Data.Functor.Indexed (ivoid)
import Data.Maybe (Maybe(..), fromMaybe)
import Data.Newtype (unwrap)
import Data.NonEmpty ((:|))
import Data.Tuple (fst)
import Data.Tuple.Nested (type (/\), (/\))
import Effect (Effect)
import Effect.Aff.Class (class MonadAff)
import Effect.Class (class MonadEffect)
import Data.NonEmpty ((:|))
import FRP.Event (fold, subscribe)
import FRP.Event.Time (interval)
import Halogen as H
Expand Down Expand Up @@ -159,13 +160,13 @@ handleAction = case _ of
H.liftEffect
$ subscribe
( runNoLoop
( fold
(( fold
( \_ (b /\ u) ->
if b >= 4.0 then (b - 1.0) /\ false else if b <= 1.0 then (b + 1.0) /\ true else (if u then add else sub) b 1.0 /\ u
)
(interval 2000)
(1.0 /\ true) <#> fst
)
) <|> pure 1.0 )
(pure unit)
{}
ffiAudio
Expand Down

0 comments on commit dc97925

Please sign in to comment.