Skip to content

Commit

Permalink
correct Moore diagonalization
Browse files Browse the repository at this point in the history
  • Loading branch information
fumieval committed Mar 2, 2014
1 parent b692fbe commit d5b640f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Data/Machine/Moore.hs
Expand Up @@ -90,8 +90,8 @@ instance Pointed (Moore a) where
instance Monad (Moore a) where
return a = r where r = Moore a (const r)
{-# INLINE return #-}
Moore a k >>= f = case f a of
Moore b _ -> Moore b (k >=> f)
k >>= f = j (fmap f k) where
j (Moore a g) = Moore (extract a) (\x -> j $ fmap (\(Moore _ h) -> h x) (g x))
_ >> m = m

instance Copointed (Moore a) where
Expand Down

0 comments on commit d5b640f

Please sign in to comment.