levi.stephen wrote: > My concern (which may be inexperience ;) ) is with the monads here > though. What if I hadn't seen that the IO monad (or any other Monad) > was going to be necessary in the type signatures?
You'd have some refactoring to do :-) But actually, it's not possible to create an interface that works this way without using some monad, as the interface relies on side-effects. A pure interface would have to look something like: data ObjectStore = ObjectStore { save :: Object -> (ID,ObjectStore), retrieve :: ID -> Maybe Object, retrieveByName :: Maybe Object } (ie the save method would have to return a new object store). Instead of using IO, you could have parameterised the store over the monad: data ObjectStore m = ObjectStore { save :: Object -> m ID, retrieve :: ID -> m (Maybe Object), retrieveByName :: String -> m (Maybe Object) } but given your planned use, this may well be over-abstraction. Tim _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe