{-# OPTIONS_GHC -fglasgow-exts -fallow-undecidable-instances
-fparr #-}  module MO.Base (module MO.Base, Invocant,
stubInvocant) where import {-# SOURCE #-} MO.Run import
Data.Maybe import Data.Typeable import StringTable.Atom import
MO.Capture import GHC.PArr import StringTable.AtomMap as AtomMap
-- Codeable is an abstraction of possible different pieces of
code that -- a method may use as implementation. It's supposed
to be used as member -- of the MethodCompiled structure. A
Codeable type need to have a function -- "run" that accepts
Arguments and returns some Invocant.  -- | open type to
represent Code class Monad m => Codeable m c where     run :: c
-> Arguments m -> m (Invocant m)  -- | stub code which always
return the same newtype NoCode m = NoCode (Invocant m)  instance
(Typeable (NoCode m), Monad m) => Codeable m (NoCode m) where
run (NoCode obj) _ = return obj instance Show (NoCode m) where
show _ = "<NoCode>"  -- | Pure code that works with any monad.
newtype PureCode = PureCode (forall m