[Haskell-cafe] where to put handy functions?

Chad Scherrer chad.scherrer at gmail.com
Fri Aug 10 11:38:31 EDT 2007


Hmm, this would make a good QuickCheck property. I wonder, is listify
a contravariant functor? Fun to work through the details of that some
time, I think.

Chad

On 8/10/07, Brent Yorgey <byorgey at gmail.com> wrote:
>
> Amusingly, extract is intimately related to function composition. Suppose we
> have
>
> listify :: (Int -> Int) -> [Int]
> listify = flip map [0..]
>
> Then if f, g :: Int -> Int, and f is monotonically increasing, we have the
> identity
>
> (listify f) `extract` (listify g) = listify (g . f)
>
> This randomly occurred to me as I was falling asleep last night and I
> thought I would share. =)
>
> -Brent


More information about the Haskell-Cafe mailing list