Permalink
Browse files

dependencies

  • Loading branch information...
1 parent 2814706 commit e3038b60243235586753d018f28c313bf0b738ef @ekmett committed May 8, 2011
Showing with 9 additions and 1 deletion.
  1. +4 −0 Data/Copointed.hs
  2. +4 −0 Data/Pointed.hs
  3. +1 −1 pointed.cabal
View
@@ -19,6 +19,7 @@ import qualified Control.Comonad.Trans.Env.Strict as Strict
import qualified Control.Comonad.Trans.Store.Lazy as Lazy
import qualified Control.Comonad.Trans.Store.Memo as Memo
import qualified Control.Comonad.Trans.Store.Strict as Strict
+import Data.List.NonEmpty (NonEmpty(..))
-- | 'Copointed' does not require a 'Functor', as the only relationship
-- between 'copoint' and 'fmap' is given by a free theorem.
@@ -65,6 +66,9 @@ instance Copointed Dual where
instance Copointed Sum where
copoint = getSum
+instance Copointed NonEmpty where
+ copoint ~(a :| _) = a
+
instance Copointed Semigroup.First where
copoint = Semigroup.getFirst
View
@@ -20,6 +20,7 @@ import Control.Monad.Trans.Error
import Control.Monad.Trans.List
import Control.Monad.Trans.Maybe
import Control.Monad.Trans.Identity
+import Data.List.NonEmpty
import qualified Control.Monad.Trans.RWS.Lazy as Lazy
import qualified Control.Monad.Trans.RWS.Strict as Strict
import qualified Control.Monad.Trans.Writer.Lazy as Lazy
@@ -52,6 +53,9 @@ instance Pointed STM where
instance Pointed Tree where
point a = Node a []
+instance Pointed NonEmpty where
+ point a = a :| []
+
instance Pointed ZipList where
point = pure
View
@@ -1,6 +1,6 @@
name: pointed
category: Data
-version: 0.1.1
+version: 0.1.2
license: BSD3
cabal-version: >= 1.6
license-file: LICENSE

0 comments on commit e3038b6

Please sign in to comment.