mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-11 05:49:31 -06:00
Replace all the different ErrM.hs modules with GF.Data.ErrM.
This commit is contained in:
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -14,7 +14,7 @@ import GF.JavaScript.AbsJS
|
||||
|
||||
|
||||
|
||||
import GF.JavaScript.ErrM
|
||||
import GF.Data.ErrM
|
||||
|
||||
type ParseFun a = [Token] -> Err a
|
||||
|
||||
|
||||
Reference in New Issue
Block a user