-
Notifications
You must be signed in to change notification settings - Fork 16
Closed
Description
Several functions in the library require a Monad f
constraint where the constraint is unnecessary:
purescript-machines/src/Data/Machine/Mealy.purs
Lines 117 to 119 in d558e0e
-- | Execute (unroll) a single step on a machine. | |
stepMealy :: forall f s a. (Monad f) => s -> MealyT f s a -> f (Step f s a) | |
stepMealy = flip runMealyT |
purescript-machines/src/Data/Machine/Mealy.purs
Lines 148 to 152 in d558e0e
take :: forall f s a. (Monad f) => Int -> MealyT f s a -> MealyT f s a | |
take n m = if n <= 0 then halt | |
else mealy $ \s -> f <$> stepMealy s m | |
where f Halt = Halt | |
f (Emit a m') = Emit a (take (n - 1) m') |
For some of these there is no constraint necessary, and for others something weaker like Applicative
would do; perhaps due to functions used internally these really do eventually need the constraint and so it's here for convenience, but if not we could relax them.
Metadata
Metadata
Assignees
Labels
No labels