Skip to content

Instantly share code, notes, and snippets.

@spockz
Created June 20, 2013 14:48
Show Gist options
  • Select an option

  • Save spockz/5823379 to your computer and use it in GitHub Desktop.

Select an option

Save spockz/5823379 to your computer and use it in GitHub Desktop.
data R v where
...
-- Notice the extra R as upposed to Fix
newtype RFix f = RIn { out :: R (f (RFix f)) }
instance Monad R where
...
foo :: (f (RFix f) -> R b) -> RFix f -> R b
foo c = (>>= c) . out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment