Packages

Monads and other dark magic (monoids, functors, traversables, &c), forked by doma for maintenance and testing packagesets

Current section

3 Versions

Jump to

Compare versions

8 files changed
+33 additions
-43 deletions
  @@ -1,4 +1,4 @@
1 - ![](https://github.com/expede/witchcraft/raw/master/brand/Wordmark/PNG/WC-wordmark-lrg@2x.png)
1 + ![](https://github.com/expede/witchcraft/raw/main/brand/Wordmark/PNG/WC-wordmark-lrg@2x.png)
2 2
3 3 `Witchcraft` is a library providing common algebraic and categorical abstractions to Elixir.
4 4 Monoids, functors, monads, arrows, categories, and other dark magic right at your fingertips.
  @@ -44,9 +44,9 @@
44 44 {<<"optional">>,false},
45 45 {<<"repository">>,<<"hexpm">>},
46 46 {<<"requirement">>,<<"~> 2.3.2-doma2">>}],
47 - [{<<"app">>,<<"type_class">>},
48 - {<<"name">>,<<"type_class">>},
47 + [{<<"app">>,<<"doma_type_class">>},
48 + {<<"name">>,<<"doma_type_class">>},
49 49 {<<"optional">>,false},
50 50 {<<"repository">>,<<"hexpm">>},
51 - {<<"requirement">>,<<"~> 1.2">>}]]}.
52 - {<<"version">>,<<"1.0.4-doma">>}.
51 + {<<"requirement">>,<<"~> 1.2.10-blazing">>}]]}.
52 + {<<"version">>,<<"1.0.5-doma">>}.
  @@ -545,7 +545,7 @@ defclass Witchcraft.Apply do
545 545 [-2, -3, -1, -2, 1, 0, 3, 2]
546 546
547 547 """
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()
549 549 def over(fun, a, b, c, d), do: fun |> over(a, b, c) |> ap(d)
550 550
551 551 @doc """
  @@ -587,7 +587,7 @@ defclass Witchcraft.Apply do
587 587 [-2, -3, -1, -2, 1, 0, 3, 2]
588 588
589 589 """
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()
591 591 def async_over(fun, a, b, c, d), do: fun |> async_over(a, b, c) |> async_ap(d)
592 592 end
  @@ -238,22 +238,6 @@ defclass Witchcraft.Arrow do
238 238 @spec beside(Arrow.t(), Arrow.t()) :: Arrow.t()
239 239 defalias beside(a, b), as: :product
240 240
241 - @doc """
242 - Operator alias for `product/2`.
243 -
244 - ## Examples
245 -
246 - iex> arr = fn x -> x - 10 end ^^^ fn y -> y <> "!" end
247 - ...> arr.({42, "Hi"})
248 - {32, "Hi!"}
249 -
250 - iex> {42, "Hi"} |> (fn x -> x - 10 end ^^^ fn y -> y <> "!" end).()
251 - {32, "Hi!"}
252 -
253 - """
254 - @spec Arrow.t() ^^^ Arrow.t() :: Arrow.t()
255 - defalias a ^^^ b, as: :product
256 -
257 241 @doc """
258 242 Swap positions of elements in a tuple.
259 243
  @@ -334,7 +318,7 @@ defclass Witchcraft.Arrow do
334 318 """
335 319 @spec fanout(Arrow.t(), Arrow.t()) :: Arrow.t()
336 320 def fanout(arrow_f, arrow_g) do
337 - arrow_f |> arrowize(&split/1) <~> (arrow_f ^^^ arrow_g)
321 + arrow_f |> arrowize(&split/1) <~> product(arrow_f, arrow_g)
338 322 end
339 323
340 324 @doc """
  @@ -254,7 +254,7 @@ defclass Witchcraft.Chain do
254 254
255 255 Sequences chainable actions. Note that each line must be of the same type.
256 256
257 - For a version with `return`, please see `Witchcraft.Monad.do/2`
257 + For a version with `return`, please see `Witchcraft.Monad.monad/2`
258 258
259 259 ## Examples
Loading more files…