objective 0.0.1 → 0.0.2
raw patch · 2 files changed
+3/−2 lines, 2 files
Files
- objective.cabal +1/−1
- src/Control/Object.hs +2/−1
objective.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: objective -version: 0.0.1 +version: 0.0.2 synopsis: Extensible objects description: Stateful effect transducer homepage: https://github.com/fumieval/objective
src/Control/Object.hs view
@@ -7,6 +7,7 @@ import Control.Monad.Trans.State import Control.Monad import Data.Typeable +import Control.Applicative -- | The type 'Object e m' represents objects which can handle messages 'e', perform actions in the environment 'm'. -- It can be thought of as a function between effects. @@ -22,7 +23,7 @@ transObject f (Object m) = Object $ fmap (fmap (transObject f)) . f . m -- | Apply a function to the messages coming into the object. -adaptObject :: Functor f => (forall x. e x -> f x) -> Object f m -> Object e m +adaptObject :: Functor m => (forall x. e x -> f x) -> Object f m -> Object e m adaptObject f (Object m) = Object $ fmap (fmap (adaptObject f)) . m . f -- | Parrots messages given.