This repository was archived by the owner on Jun 6, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +44
-13
lines changed
Expand file tree Collapse file tree 2 files changed +44
-13
lines changed Original file line number Diff line number Diff line change 22
33## Module Data.Functor.Coproduct
44
5- ### Types
5+ #### ` Coproduct `
66
7- newtype Coproduct f g a where
8- Coproduct :: Either (f a) (g a) -> Coproduct f g a
7+ ``` purescript
8+ newtype Coproduct f g a
9+ = Coproduct (Either (f a) (g a))
10+ ```
911
1012
11- ### Type Class Instances
13+ #### ` runCoproduct `
1214
13- instance foldableCoproduct :: (Foldable f, Foldable g) => Foldable (Coproduct f g)
15+ ``` purescript
16+ runCoproduct :: forall f g a. Coproduct f g a -> Either (f a) (g a)
17+ ```
1418
15- instance functorCoproduct :: (Functor f, Functor g) => Functor (Coproduct f g)
1619
17- instance traversableCoproduct :: (Traversable f, Traversable g) => Traversable (Coproduct f g)
20+ #### ` left `
1821
22+ ``` purescript
23+ left :: forall f g a. f a -> Coproduct f g a
24+ ```
1925
20- ### Values
2126
22- coproduct :: forall f g a b. (f a -> b) -> (g a -> b) -> Coproduct f g a -> b
27+ #### ` right `
2328
24- left :: forall f g a. f a -> Coproduct f g a
29+ ``` purescript
30+ right :: forall f g a. g a -> Coproduct f g a
31+ ```
2532
26- right :: forall f g a. g a -> Coproduct f g a
2733
28- runCoproduct :: forall f g a. Coproduct f g a -> Either (f a) (g a)
34+ #### ` coproduct `
35+
36+ ``` purescript
37+ coproduct :: forall f g a b. (f a -> b) -> (g a -> b) -> Coproduct f g a -> b
38+ ```
39+
40+
41+ #### ` functorCoproduct `
42+
43+ ``` purescript
44+ instance functorCoproduct :: (Functor f, Functor g) => Functor (Coproduct f g)
45+ ```
46+
47+
48+ #### ` foldableCoproduct `
49+
50+ ``` purescript
51+ instance foldableCoproduct :: (Foldable f, Foldable g) => Foldable (Coproduct f g)
52+ ```
53+
54+
55+ #### ` traversableCoproduct `
56+
57+ ``` purescript
58+ instance traversableCoproduct :: (Traversable f, Traversable g) => Traversable (Coproduct f g)
59+ ```
Original file line number Diff line number Diff line change 1717 ],
1818 "dependencies" : {
1919 "purescript-either" : " ~0.1.4" ,
20- "purescript-foldable-traversable" : " ~0.2.1 "
20+ "purescript-foldable-traversable" : " ~0.3.0 "
2121 }
2222}
You can’t perform that action at this time.
0 commit comments