Skip to content

Commit 73e3cc6

Browse files
authored
Merge pull request #104 from witchcrafters/quinn/docs-and-types
Fix various documentation references and typespecs
2 parents af3e4ee + 5e9b17d commit 73e3cc6

File tree

5 files changed

+13
-9
lines changed

5 files changed

+13
-9
lines changed

lib/witchcraft/apply.ex

+2-2
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ defclass Witchcraft.Apply do
545545
[-2, -3, -1, -2, 1, 0, 3, 2]
546546
547547
"""
548-
@spec over(fun(), Apply.t(), Apply.t(), Apply.t()) :: Apply.t()
548+
@spec over(fun(), Apply.t(), Apply.t(), Apply.t(), Apply.t()) :: Apply.t()
549549
def over(fun, a, b, c, d), do: fun |> over(a, b, c) |> ap(d)
550550

551551
@doc """
@@ -587,7 +587,7 @@ defclass Witchcraft.Apply do
587587
[-2, -3, -1, -2, 1, 0, 3, 2]
588588
589589
"""
590-
@spec async_over(fun(), Apply.t(), Apply.t(), Apply.t()) :: Apply.t()
590+
@spec async_over(fun(), Apply.t(), Apply.t(), Apply.t(), Apply.t()) :: Apply.t()
591591
def async_over(fun, a, b, c, d), do: fun |> async_over(a, b, c) |> async_ap(d)
592592
end
593593

lib/witchcraft/arrow.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ defclass Witchcraft.Arrow do
449449
430
450450
451451
"""
452-
@spec precompose(Arrow.t(), fun()) :: Arrow.t()
452+
@spec postcompose(Arrow.t(), fun()) :: Arrow.t()
453453
def postcompose(arrow, fun), do: arrow <~> arrowize(arrow, fun)
454454
end
455455

lib/witchcraft/chain.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ defclass Witchcraft.Chain do
254254
255255
Sequences chainable actions. Note that each line must be of the same type.
256256
257-
For a version with `return`, please see `Witchcraft.Monad.do/2`
257+
For a version with `return`, please see `Witchcraft.Monad.monad/2`
258258
259259
## Examples
260260

lib/witchcraft/foldable.ex

+3-3
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ defclass Witchcraft.Foldable do
337337
2
338338
339339
"""
340-
@spec max(Foldable.t(), by: (any, any -> Order.ordering())) :: Ord.t()
340+
@spec max(Foldable.t(), by: (any, any -> Ord.ordering())) :: Ord.t()
341341
def max(foldable, by: comparator) do
342342
Witchcraft.Foldable.right_fold(foldable, fn focus, acc ->
343343
case comparator.(focus, acc) do
@@ -395,7 +395,7 @@ defclass Witchcraft.Foldable do
395395
8
396396
397397
"""
398-
@spec min(Foldable.t(), by: (any(), any() -> Order.t())) :: any() | Maybe.t()
398+
@spec min(Foldable.t(), by: (any(), any() -> Ord.t())) :: any()
399399
def min(foldable, by: comparitor) do
400400
right_fold(foldable, fn focus, acc ->
401401
case comparitor.(focus, acc) do
@@ -787,6 +787,6 @@ defclass Witchcraft.Foldable do
787787
]
788788
789789
"""
790-
@spec then_traverse(Apply.fun(), Foldable.t()) :: Apply.t()
790+
@spec then_through(Apply.fun(), Foldable.t()) :: Apply.t()
791791
def then_through(fun, traversable), do: then_traverse(traversable, fun)
792792
end

lib/witchcraft/monad.ex

+6-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ defclass Witchcraft.Monad do
1919
For a nice, illustrated introduction,
2020
see [Functors, Applicatives, And Monads In Pictures](http://adit.io/posts/2013-04-17-functors,_applicatives,_and_monads_in_pictures.html).
2121
22-
Having `of` also lets us enhance do-notation with a convenuenct `return` function (see `monad/2`)
22+
Having `of` also lets us enhance do-notation with a convenient `return` function (see `monad/2`)
2323
2424
## Type Class
2525
@@ -36,6 +36,8 @@ defclass Witchcraft.Monad do
3636
[_]
3737
"""
3838

39+
alias Witchcraft.Chain
40+
3941
extend Witchcraft.Applicative
4042
extend Witchcraft.Chain
4143

@@ -44,6 +46,8 @@ defclass Witchcraft.Monad do
4446
use Witchcraft.Applicative
4547
use Witchcraft.Chain
4648

49+
@type t :: any()
50+
4751
properties do
4852
import Witchcraft.Applicative
4953
import Witchcraft.Chain
@@ -110,7 +114,7 @@ defclass Witchcraft.Monad do
110114
end
111115

112116
@doc "Alias for `async_chain/2`"
113-
@spec async_chain(Chain.t(), Chain.link()) :: Chain.t()
117+
@spec async_bind(Chain.t(), Chain.link()) :: Chain.t()
114118
def async_bind(chainable, link), do: async_chain(chainable, link)
115119

116120
@doc """

0 commit comments

Comments
 (0)