diff options
Diffstat (limited to 'compiler/utils/State.hs')
-rw-r--r-- | compiler/utils/State.hs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/utils/State.hs b/compiler/utils/State.hs index 11bd7686d7..92269e91e7 100644 --- a/compiler/utils/State.hs +++ b/compiler/utils/State.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE UnboxedTuples #-} module State where @@ -5,10 +6,7 @@ module State where import GhcPrelude newtype State s a = State { runState' :: s -> (# a, s #) } - -instance Functor (State s) where - fmap f m = State $ \s -> case runState' m s of - (# r, s' #) -> (# f r, s' #) + deriving (Functor) instance Applicative (State s) where pure x = State $ \s -> (# x, s #) |