[Haskell-cafe] What to call Occult Effects

David Feuer david.feuer at gmail.com
Thu Nov 12 02:47:43 UTC 2020


Interesting. There seem to be quite a few of these.

const id (Identity x) (Identity y) = Identity y = liftA2 (const id)
(Identity x) (Identity y)

If m is occlusive, so is ReaderT e m:

liftA2 (const id) (ReaderT f) (ReaderT g) = ReaderT $ \r -> liftA2 (const
id) (f r) (g r) = ReaderT $ \r -> g r = ReaderT g

I believe this works for StateT as well. The first counterexample is Writer
w for a non-trivial monoid w.

On Tue, Nov 10, 2020, 6:23 PM Kim-Ee Yeoh <ky3 at atamo.com> wrote:

> By an occult effect I mean that under the type signature (M a -> M b -> M
> b) of a particular monad M, the two expressions (const id) and (liftM2 $
> const id) are equivalent.
>
> Occult here refers to how the effect of the second parameter blocks the
> effect of the first one.
>
> In your opinion, is there a better word than occult to describe the
> property of such monads?
> --
> -- Kim-Ee
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20201111/3ee6fe0a/attachment.html>


More information about the Haskell-Cafe mailing list