Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove StaredStore.

  • Loading branch information...
commit 8fc43d047adc87786e2a4deae2c8532e094ad254 1 parent e4f4a1f
@tonymorris tonymorris authored
Showing with 0 additions and 56 deletions.
  1. +0 −4 data-lens.cabal
  2. +0 −52 src/Control/Comonad/StaredStore.hs
View
4 data-lens.cabal
@@ -45,10 +45,6 @@ library
Data.Lens.Partial.Common
Data.Lens.Partial.Lazy
-- Data.Lens.Partial.Strict
- -- Data.Lens.Multi.Common
- -- Data.Lens.Multi.Lazy
- -- Data.Lens.Multi.Strict
- Control.Comonad.StaredStore
Control.Category.Choice
Control.Category.Codiagonal
Control.Category.Product
View
52 src/Control/Comonad/StaredStore.hs
@@ -1,52 +0,0 @@
-module Control.Comonad.StaredStore where
-
-import Control.Applicative
-import Control.Comonad
-import Control.Comonad.Trans.Store
-import Data.Functor.Coproduct
-import Data.Functor.Identity
-
-newtype StaredStore s a = StaredStore {runStaredStore :: Coproduct Identity (StoreT s (StaredStore s)) a}
-
-instance Functor (StaredStore s) where
- fmap f (StaredStore x) = StaredStore (fmap f x)
-
-instance Extend (StaredStore s) where
- duplicate (StaredStore x) = StaredStore (fmap StaredStore (duplicate x))
- extend f (StaredStore x) = StaredStore (extend (f . StaredStore) x)
-
-instance Comonad (StaredStore s) where
- extract (StaredStore x) = extract x
-
-instance Applicative (StaredStore s) where
- pure = StaredStore . left . pure
- f <*> (StaredStore x) = coproduct l r x
- where
- l (Identity y) = fmap ($ y) f
- r y = StaredStore (right (StoreT ((.) <$> f <*> v) s))
- where
- (v, s) = runStoreT y
-
-fromStore :: Store b a -> StaredStore b a
-fromStore st = StaredStore (right (StoreT (pure g) v))
- where
- (g,v) = runStore st
-
-poss :: StaredStore b a -> [b]
-poss x = go x []
- where
- go :: StaredStore b a -> [b] -> [b]
- go = coproduct (const id) h . runStaredStore
- h s = go g . (v:)
- where
- (g, v) = runStoreT s
-
-seekss :: (b -> b) -> StaredStore b a -> StaredStore b a
-seekss f = coproduct (pure . runIdentity) h . runStaredStore
- where
- h s = StaredStore (right (StoreT (seekss f g) (f v)))
- where
- (g, v) = runStoreT s
-
-peekss :: (b -> b) -> StaredStore b a -> a
-peekss f = extract . seekss f
Please sign in to comment.
Something went wrong with that request. Please try again.