On Tue, Jun 15, 2010 at 7:23 PM, Martin Drautzburg
<[email protected]> wrote:
> When I know my supplies I want to know what I can produce. When I know what I
> want to produce I want to know what supplies I need for that. Both kinds of
> questions should be answered by a singe Process thingy.
Your Process thingy reminds me of a natural isomorphism:
data Iso a b = Iso { ab :: a -> b
, ba :: b -> a
}
> I want to be able to chain processes and the whole thing should still act like
> a Process.
These isomorphisms can be chained together using the standard Category
method '.':
import qualified Control.Category as C
instance C.Category Iso where
id = Iso id id
Iso bc cb . Iso ab ba = Iso (bc . ab) (ba . cb)
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe