[Haskell-cafe] Fixed points

Alexander Solla alex.solla at gmail.com
Fri Jun 10 00:46:26 CEST 2011

Hi Everybody,

I have a function which computes a fixed point in terms of iterate:

equivalenceClosure :: (Ord a) => Relation a -> Relation a
equivalenceClosure = fst . List.head                -- "guaranteed" to
                   . List.dropWhile (uncurry (/=))  -- removes pairs that
are not equal
                   . U.List.pairwise (,)            -- applies (,) to
adjacent list elements
                   . iterate ( reflexivity
                             . symmetry
                             . transitivity

Can this function be written in terms of fix?  It seems like there should be
a transformation from this scheme to something with fix in it, but I don't
see it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20110609/1628e4af/attachment.htm>

More information about the Haskell-Cafe mailing list