Replace all the different ErrM.hs modules with GF.Data.ErrM.

This commit is contained in:
bringert
2007-12-20 17:34:12 +00:00
parent 4ab0df67c5
commit 5b01d912ce
23 changed files with 22 additions and 117 deletions

View File

@@ -1,16 +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.JavaScript.ErrM where
-- the Error monad: like Maybe type with error msgs
data Err a = Ok a | Bad String
deriving (Read, Show, Eq)
instance Monad Err where
return = Ok
fail = Bad
Ok a >>= f = f a
Bad s >>= f = Bad s

View File

@@ -3,7 +3,7 @@
module GF.JavaScript.ParJS where
import GF.JavaScript.AbsJS
import GF.JavaScript.LexJS
import GF.JavaScript.ErrM
import GF.Data.ErrM
#if __GLASGOW_HASKELL__ >= 503
import Data.Array
#else

View File

@@ -4,7 +4,7 @@
module GF.JavaScript.ParJS where
import GF.JavaScript.AbsJS
import GF.JavaScript.LexJS
import GF.JavaScript.ErrM
import GF.Data.ErrM
}
%name pProgram Program

View File

@@ -3,7 +3,7 @@ module GF.JavaScript.SkelJS where
-- Haskell module generated by the BNF converter
import GF.JavaScript.AbsJS
import GF.JavaScript.ErrM
import GF.Data.ErrM
type Result = Err String
failure :: Show a => a -> Result

View File

@@ -14,7 +14,7 @@ import GF.JavaScript.AbsJS
import GF.JavaScript.ErrM
import GF.Data.ErrM
type ParseFun a = [Token] -> Err a