Skip to content

Commit

Permalink
dunai: Wrap lines at 80 columns (KSG Haskell 1.3.0 - 4.3). Refs #285.
Browse files Browse the repository at this point in the history
We set the code limit for Haskell files at 80 characters. A "character"
means any Unicode code point. Any line that would exceed this limit
should be line-wrapped.
  • Loading branch information
ivanperez-keera committed Jun 3, 2022
1 parent 090ab1b commit 1866e54
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions dunai/src/Control/Monad/Trans/MSF/State.hs
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,13 @@ runStateS = morphGS $ \f (s, a) -> (\((b, c), s') -> ((s', b), c))
-- | Build an 'MSF' /function/ that takes a fixed state as additional input,
-- from an 'MSF' in the 'State' monad, and outputs the new state with every
-- transformation step.
runStateS_ :: (Functor m, Monad m) => MSF (StateT s m) a b -> s -> MSF m a (s, b)
runStateS_ msf s = feedback s
$ arr swap >>> runStateS msf >>> arr (\(s', b) -> ((s', b), s'))
runStateS_ :: (Functor m, Monad m)
=> MSF (StateT s m) a b
-> s
-> MSF m a (s, b)
runStateS_ msf s =
feedback s $
arr swap >>> runStateS msf >>> arr (\(s', b) -> ((s', b), s'))

-- TODO Rename this to execStateS!
-- | Build an 'MSF' /function/ that takes a fixed state as additional
Expand Down

0 comments on commit 1866e54

Please sign in to comment.