{-# LANGUAGE NoImplicitPrelude #-} module Synthesizer.Causal.Cut where import qualified Synthesizer.Causal.Process as Causal import Control.Monad.Trans.State (StateT(StateT), ) import Data.Maybe.HT (toMaybe, ) import NumericPrelude.Numeric import NumericPrelude.Base {-# INLINE take #-} take :: Int -> Causal.T a a take :: forall a. Int -> T a a take = (a -> StateT Int Maybe a) -> Int -> T a a forall a s b. (a -> StateT s Maybe b) -> s -> T a b Causal.fromStateMaybe (\a x -> (Int -> Maybe (a, Int)) -> StateT Int Maybe a forall s (m :: * -> *) a. (s -> m (a, s)) -> StateT s m a StateT (\Int i -> Bool -> (a, Int) -> Maybe (a, Int) forall a. Bool -> a -> Maybe a toMaybe (Int iInt -> Int -> Bool forall a. Ord a => a -> a -> Bool >Int 0) (a x, Int -> Int forall a. Enum a => a -> a pred Int i)))