Skip to content

Commit

Permalink
Merge pull request #18 from kini/applicative-in-base
Browse files Browse the repository at this point in the history
Remove check for APPLICATIVE_IN_BASE cpp def
  • Loading branch information
meiersi committed Sep 17, 2014
2 parents 0a078e1 + f197cbb commit 23a77f0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
4 changes: 0 additions & 4 deletions Blaze/ByteString/Builder/Internal/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
--
module Blaze.ByteString.Builder.Internal.Types where

#ifdef APPLICATIVE_IN_BASE
import Control.Applicative
#endif

import Data.Monoid
import qualified Data.ByteString as S
Expand Down Expand Up @@ -86,7 +84,6 @@ instance Functor Put where
fmap f (Put put) = Put $ \k -> put (\x -> k (f x))
{-# INLINE fmap #-}

#ifdef APPLICATIVE_IN_BASE
instance Applicative Put where
pure x = Put $ \k -> k x
{-# INLINE pure #-}
Expand All @@ -96,7 +93,6 @@ instance Applicative Put where
{-# INLINE (<*) #-}
a *> b = Put $ \k -> unPut a (\_ -> unPut b k)
{-# INLINE (*>) #-}
#endif

instance Monad Put where
return x = Put $ \k -> k x
Expand Down
4 changes: 0 additions & 4 deletions benchmarks/Throughput/BlazePutMonad.hs
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ import Data.Word
import qualified Data.ByteString as S
import qualified Data.ByteString.Lazy as L

#ifdef APPLICATIVE_IN_BASE
import Control.Applicative
#endif


------------------------------------------------------------------------
Expand All @@ -82,14 +80,12 @@ instance Functor PutM where
fmap f m = Put $ let PairS a w = unPut m in PairS (f a) w
{-# INLINE fmap #-}

#ifdef APPLICATIVE_IN_BASE
instance Applicative PutM where
pure = return
m <*> k = Put $
let PairS f w = unPut m
PairS x w' = unPut k
in PairS (f x) (w `mappend` w')
#endif

-- Standard Writer monad, with aggressive inlining
instance Monad PutM where
Expand Down

0 comments on commit 23a77f0

Please sign in to comment.