Guest User

Untitled

a guest
Dec 17th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. -- Normal fixed point
  2. fix f = f (fix f)
  3.  
  4. -- | Slow comonadic fixed point à la Kenneth Foner:
  5. pfix :: Comonad w => w (w a -> a) -> w a
  6. pfix = extend wfix
  7.  
  8. -- | Comonadic fixed point à la Kenneth Foner:
  9. kfix :: ComonadApply w => w (w a -> a) -> w a
  10. kfix w = fix $ \u -> w <@> duplicate u
  11.  
  12. -- | Comonadic fixed point à la Blom:
  13. bfix :: ComonadApply w => w (w a -> a) -> w a
  14. bfix w = w <@> extend bfix w
Add Comment
Please, Sign In to add comment