forked from GitHub/gf-core
Replace all the different ErrM.hs modules with GF.Data.ErrM.
This commit is contained in:
@@ -18,7 +18,7 @@ import GF.GFCC.Macros
|
||||
import GF.Devel.PrintGFCC
|
||||
import GF.GFCC.DataGFCC ----
|
||||
|
||||
import GF.Command.ErrM ----
|
||||
import GF.Data.ErrM ----
|
||||
|
||||
import qualified Data.Map as Map
|
||||
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
-- BNF Converter: Error Monad
|
||||
-- Copyright (C) 2004 Author: Aarne Ranta
|
||||
|
||||
-- This file comes with NO WARRANTY and may be used FOR ANY PURPOSE.
|
||||
module GF.Command.ErrM where
|
||||
|
||||
-- the Error monad: like Maybe type with error msgs
|
||||
|
||||
import Control.Monad (MonadPlus(..), liftM)
|
||||
|
||||
data Err a = Ok a | Bad String
|
||||
deriving (Read, Show, Eq, Ord)
|
||||
|
||||
instance Monad Err where
|
||||
return = Ok
|
||||
fail = Bad
|
||||
Ok a >>= f = f a
|
||||
Bad s >>= f = Bad s
|
||||
|
||||
instance Functor Err where
|
||||
fmap = liftM
|
||||
|
||||
instance MonadPlus Err where
|
||||
mzero = Bad "Err.mzero"
|
||||
mplus (Bad _) y = y
|
||||
mplus x _ = x
|
||||
@@ -11,7 +11,7 @@ import GF.GFCC.API
|
||||
import GF.GFCC.Macros
|
||||
import GF.GFCC.DataGFCC
|
||||
|
||||
import GF.Command.ErrM ----
|
||||
import GF.Data.ErrM ----
|
||||
|
||||
import qualified Data.Map as Map
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import GF.GFCC.Macros
|
||||
import qualified GF.Command.ParGFShell as P
|
||||
import GF.Command.PrintGFShell
|
||||
import GF.Command.AbsGFShell
|
||||
import GF.Command.ErrM
|
||||
import GF.Data.ErrM
|
||||
|
||||
pTree :: String -> Exp
|
||||
pTree s = case P.pTree (P.myLexer s) of
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
module GF.Command.ParGFShell where
|
||||
import GF.Command.AbsGFShell
|
||||
import GF.Command.LexGFShell
|
||||
import GF.Command.ErrM
|
||||
import GF.Data.ErrM
|
||||
#if __GLASGOW_HASKELL__ >= 503
|
||||
import Data.Array
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user