rob-brown / MonadEx

Upgrade your pipelines with monads.
MIT License
309 stars 13 forks source link

update exdoc, try to fix Monad.Behaviour doc test #5

Closed henry-hz closed 8 years ago

henry-hz commented 8 years ago

Dear Rob,

The new exdoc makes a better documentation view. I tried to fix the Monad.Behaviour test, was an arithmetic error. Strangely, when manually typing in iex iex> m = Monad.Identity.Sample.return 33 iex> Monad.Identity.Sample.unwrap m 33 iex> m2 = Monad.Identity.Sample.bind(m, fn(x) -> Monad.Identity.Sample.return(x * 2) end) %Monad.Identity.Sample{value: 66} iex> Monad.Identity.Sample.unwrap m2 66

It works, but when using the doctest, it crashes.

rob-brown commented 8 years ago

Thanks for pointing this out. I've fixed the issue in 05977894741c024d49541e975ae1e63f6d5b81b2. This was the issue: warning: the Monad protocol has already been consolidated, an implementation for Monad.Test.Monad.Identity.Sample has no effect. The solution is to add this line to mix.exs:

consolidate_protocols: Mix.env != :test