{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE StrictData #-}
module Data.Stream.Internal where
data JointState a b = JointState a b
data Alternatively stateL stateR = Undecided | DecideL stateL | DecideR stateR
data Many state x = NotStarted | Ongoing x state | Finished
data Fix t = Fix {forall (t :: Type -> Type). Fix t -> t (Fix t)
getFix :: ~(t (Fix t))}
fixState :: (forall s. s -> t s) -> Fix t
fixState :: forall (t :: Type -> Type). (forall s. s -> t s) -> Fix t
fixState forall s. s -> t s
transformState = Fix t
go
where
go :: Fix t
go = t (Fix t) -> Fix t
forall (t :: Type -> Type). t (Fix t) -> Fix t
Fix (t (Fix t) -> Fix t) -> t (Fix t) -> Fix t
forall a b. (a -> b) -> a -> b
$ Fix t -> t (Fix t)
forall s. s -> t s
transformState Fix t
go