On Dec 4, 2016 12:22 AM, "David Menendez" <dave@zednenem.com> wrote:

You can also use it with contra-variant or invariant type constructors, e.g.,

instance Siftable a (a -> Bool) where
    sift f g = \x -> f x && g x

That looks backwards for your composition law, but I'm a bit tired so I wouldn't swear to it.

Surely you can do the same with the constructor class.

newtype Ab a = Ab (a -> Bool)
instance Siftable Ab where
  siftAway _ = Ab (const False)
  sift p (Ab g) = Ab ...

I'm not sure if my siftAway excludes anything it shouldn't....