summaryrefslogtreecommitdiff
path: root/src/tools/c/GFCC
diff options
context:
space:
mode:
authorAndreas Källberg <anka.213@gmail.com>2022-10-04 13:06:43 +0200
committerAndreas Källberg <anka.213@gmail.com>2022-10-04 13:07:07 +0200
commitfef03e755b5ba1d1d34e001e09b1968323f89324 (patch)
tree2f33f4a32c573d1bf3a32121a96f5cc63b3244f4 /src/tools/c/GFCC
parent223f92d4f67bc4a168409b20e019b0ec6ad4b904 (diff)
Update some old unused code to support newer ghc
Diffstat (limited to 'src/tools/c/GFCC')
-rw-r--r--src/tools/c/GFCC/ErrM.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/tools/c/GFCC/ErrM.hs b/src/tools/c/GFCC/ErrM.hs
index 78295d30e..872a8aec0 100644
--- a/src/tools/c/GFCC/ErrM.hs
+++ b/src/tools/c/GFCC/ErrM.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE DeriveFunctor #-}
-- BNF Converter: Error Monad
-- Copyright (C) 2004 Author: Aarne Ranta
@@ -6,12 +8,17 @@ module GFCC.ErrM where
-- Control.Monad.Fail import will become redundant in GHC 8.8+
import qualified Control.Monad.Fail as Fail
+import Control.Monad (ap)
-- the Error monad: like Maybe type with error msgs
data Err a = Ok a | Bad String
- deriving (Read, Show, Eq)
+ deriving (Read, Show, Eq, Functor)
+
+instance Applicative Err where
+ pure = Ok
+ (<*>) = ap
instance Monad Err where
return = Ok