Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

removing Multi-lens for 3.9 release

  • Loading branch information...
commit 348431c41f45f33eb8dd6337c4a4f4a007d6857e 1 parent 5c31478
@tonymorris tonymorris authored
Showing with 3 additions and 42 deletions.
  1. +1 −1  .ghci
  2. +2 −2 data-lens.cabal
  3. +0 −39 src/Data/Lens/Multi/Common.hs
View
2  .ghci
@@ -1,4 +1,4 @@
:set -isrc
-:l Control.Category.Choice Control.Category.Codiagonal Control.Category.Product Control.Comonad.StaredStore Data.Lens.Common Data.Lens.Lazy Data.Lens.Strict Data.Lens.Multi.Common Data.Lens.Partial.Common Data.Lens.Partial.Lazy
+:l Control.Category.Choice Control.Category.Codiagonal Control.Category.Product Control.Comonad.StaredStore Data.Lens.Common Data.Lens.Lazy Data.Lens.Strict Data.Lens.Partial.Common Data.Lens.Partial.Lazy
:set -Wall
View
4 data-lens.cabal
@@ -1,6 +1,6 @@
name: data-lens
category: Control, Comonads
-version: 4.0.0
+version: 3.9.0
license: BSD3
cabal-version: >= 1.6
license-file: LICENSE
@@ -45,7 +45,7 @@ library
Data.Lens.Partial.Common
Data.Lens.Partial.Lazy
-- Data.Lens.Partial.Strict
- Data.Lens.Multi.Common
+ -- Data.Lens.Multi.Common
-- Data.Lens.Multi.Lazy
-- Data.Lens.Multi.Strict
Control.Comonad.StaredStore
View
39 src/Data/Lens/Multi/Common.hs
@@ -1,39 +0,0 @@
-module Data.Lens.Multi.Common where
-
-import Prelude hiding ((.), id, null)
-import Control.Applicative
-import Control.Category
-import Data.Lens.Common (Lens(..))
-import Data.Lens.Partial.Common (PartialLens(..), runPLens)
-import Control.Comonad.Trans.Store
-import Control.Comonad.StaredStore
-import Data.Functor.Identity
-import Data.Functor.Coproduct
-
-newtype MultiLens a b = MLens {runMLens :: a -> StaredStore b a}
-
-instance Category MultiLens where
- id = totalLens id
- MLens f . MLens g = MLens $ composeHelper f . g
- where
- {- this explicit passing of f is here to allow polymorphic recursion while remaining haskell 98 -}
- composeHelper :: (b -> StaredStore c b) -> StaredStore b d -> StaredStore c d
- composeHelper k (StaredStore x) = coproduct (pure . runIdentity) h' x
- where
- h' y = composeHelper k v <*> k b
- where
- (v, b) = runStoreT y
-
--- totalLens is a homomorphism of categories; ie a functor.
-totalLens :: Lens a b -> MultiLens a b
-totalLens (Lens f) = MLens $ fromStore . f
-
--- totalLens is a homomorphism of categories; ie a functor.
-partialLens :: PartialLens a b -> MultiLens a b
-partialLens l = MLens $ coproduct (pure . runIdentity) fromStore . runPLens l
-
-getML :: MultiLens a b -> a -> [b]
-getML (MLens f) = poss . f
-
-modML :: MultiLens a b -> (b -> b) -> a -> a
-modML (MLens f) g = peekss g . f
Please sign in to comment.
Something went wrong with that request. Please try again.