File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import Prelude
55import Data.Functor.Invariant (class Invariant )
66import Data.Newtype (class Newtype )
77import Data.Profunctor (class Profunctor , dimap )
8+ import Data.Monoid (class Monoid )
89
910-- | Turns a `Profunctor` into a `Invariant` functor by equating the two type
1011-- | arguments.
@@ -17,5 +18,11 @@ derive newtype instance ordJoin :: Ord (p a a) => Ord (Join p a)
1718instance showJoin :: Show (p a a ) => Show (Join p a ) where
1819 show (Join x) = " (Join " <> show x <> " )"
1920
21+ instance semigroupJoin :: Semigroupoid p => Semigroup (Join p a ) where
22+ append (Join a) (Join b) = Join (a <<< b)
23+
24+ instance monoidJoin :: Category p => Monoid (Join p a ) where
25+ mempty = Join id
26+
2027instance invariantJoin :: Profunctor p => Invariant (Join p ) where
2128 imap f g (Join a) = Join (dimap g f a)
You can’t perform that action at this time.
0 commit comments