From 161d1b0e24fd88e3d9d0af07ba2d0fd9c930d4a0 Mon Sep 17 00:00:00 2001 From: Tony Morris Date: Thu, 21 May 2015 14:19:44 +1000 Subject: [PATCH] No longer use Data.Bool for GHC 7.6 users --- src/Lets/Data.hs | 13 +++++++++++++ src/Lets/GetSetLens.hs | 3 +-- src/Lets/Lens.hs | 3 +-- src/Lets/OpticPolyLens.hs | 3 +-- src/Lets/StoreLens.hs | 3 +-- 5 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/Lets/Data.hs b/src/Lets/Data.hs index 81e76ee..42a9df7 100644 --- a/src/Lets/Data.hs +++ b/src/Lets/Data.hs @@ -16,6 +16,7 @@ module Lets.Data ( , Identity(..) , AlongsideLeft(..) , AlongsideRight(..) +, bool ) where import Control.Applicative(Applicative(..)) @@ -178,3 +179,15 @@ data AlongsideRight f a b = instance Functor f => Functor (AlongsideRight f a) where fmap f (AlongsideRight x) = AlongsideRight (fmap (\(a, b) -> (a, f b)) x) + +---- + +bool :: + a + -> a + -> Bool + -> a +bool f _ False = + f +bool _ t True = + t diff --git a/src/Lets/GetSetLens.hs b/src/Lets/GetSetLens.hs index dc77d70..2221d10 100644 --- a/src/Lets/GetSetLens.hs +++ b/src/Lets/GetSetLens.hs @@ -38,13 +38,12 @@ module Lets.GetSetLens ( ) where import Control.Applicative(Applicative((<*>))) -import Data.Bool(bool) import Data.Char(toUpper) import Data.Map(Map) import qualified Data.Map as Map(insert, delete, lookup) import Data.Set(Set) import qualified Data.Set as Set(insert, delete, member) -import Lets.Data(Person(Person), Locality(Locality), Address(Address)) +import Lets.Data(Person(Person), Locality(Locality), Address(Address), bool) import Prelude hiding (product) -- $setup diff --git a/src/Lets/Lens.hs b/src/Lets/Lens.hs index 896f5b3..fcbed2f 100644 --- a/src/Lets/Lens.hs +++ b/src/Lets/Lens.hs @@ -74,7 +74,6 @@ module Lets.Lens ( ) where import Control.Applicative(Applicative((<*>), pure)) -import Data.Bool(bool) import Data.Char(toUpper) import Data.Foldable(Foldable(foldMap)) import Data.Functor((<$>)) @@ -83,7 +82,7 @@ import qualified Data.Map as Map(insert, delete, lookup) import Data.Monoid(Monoid) import qualified Data.Set as Set(Set, insert, delete, member) import Data.Traversable(Traversable(traverse)) -import Lets.Data(AlongsideLeft(AlongsideLeft, getAlongsideLeft), AlongsideRight(AlongsideRight, getAlongsideRight), Identity(Identity, getIdentity), Const(Const, getConst), Tagged(Tagged, getTagged), IntOr(IntOrIs, IntOrIsNot), IntAnd(IntAnd), Person(Person), Locality(Locality), Address(Address)) +import Lets.Data(AlongsideLeft(AlongsideLeft, getAlongsideLeft), AlongsideRight(AlongsideRight, getAlongsideRight), Identity(Identity, getIdentity), Const(Const, getConst), Tagged(Tagged, getTagged), IntOr(IntOrIs, IntOrIsNot), IntAnd(IntAnd), Person(Person), Locality(Locality), Address(Address), bool) import Lets.Choice(Choice(left, right)) import Lets.Profunctor(Profunctor(dimap)) import Prelude hiding (product) diff --git a/src/Lets/OpticPolyLens.hs b/src/Lets/OpticPolyLens.hs index 15dea17..e17c8c1 100644 --- a/src/Lets/OpticPolyLens.hs +++ b/src/Lets/OpticPolyLens.hs @@ -42,13 +42,12 @@ module Lets.OpticPolyLens ( , modifyIntandLengthEven ) where -import Data.Bool(bool) import Data.Char(toUpper) import Data.Map(Map) import qualified Data.Map as Map(insert, delete, lookup) import Data.Set(Set) import qualified Data.Set as Set(insert, delete, member) -import Lets.Data(AlongsideLeft(AlongsideLeft, getAlongsideLeft), AlongsideRight(AlongsideRight, getAlongsideRight), Identity(Identity, getIdentity), Const(Const, getConst), IntAnd(IntAnd), Person(Person), Locality(Locality), Address(Address)) +import Lets.Data(AlongsideLeft(AlongsideLeft, getAlongsideLeft), AlongsideRight(AlongsideRight, getAlongsideRight), Identity(Identity, getIdentity), Const(Const, getConst), IntAnd(IntAnd), Person(Person), Locality(Locality), Address(Address), bool) import Prelude hiding (product) -- $setup diff --git a/src/Lets/StoreLens.hs b/src/Lets/StoreLens.hs index 064cd43..1352a8a 100644 --- a/src/Lets/StoreLens.hs +++ b/src/Lets/StoreLens.hs @@ -45,14 +45,13 @@ module Lets.StoreLens ( ) where import Control.Applicative(Applicative((<*>))) -import Data.Bool(bool) import Data.Char(toUpper) import Data.Functor((<$>)) import Data.Map(Map) import qualified Data.Map as Map(insert, delete, lookup) import Data.Set(Set) import qualified Data.Set as Set(insert, delete, member) -import Lets.Data(Store(Store), Person(Person), Locality(Locality), Address(Address)) +import Lets.Data(Store(Store), Person(Person), Locality(Locality), Address(Address), bool) import Prelude hiding (product) -- $setup