[Haskell-cafe] f^n for functional iteration

Danny Gratzer danny.gratzer at gmail.com
Thu Dec 12 03:48:32 UTC 2013


This seems to work

{-# LANGUAGE FlexibleInstances #-}
instance Num (a -> a) where
  (*) = (.)

Of course, using anything else from the Num class will blow up in your face
so it's probably not worth it.

Cheers,
Danny Gratzer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20131211/edf11082/attachment-0001.html>


More information about the Haskell-Cafe mailing list