Skip to content

Added generalize function#2

Merged
Gabriella439 merged 2 commits intoGabriella439:masterfrom
fizruk:master
Nov 7, 2013
Merged

Added generalize function#2
Gabriella439 merged 2 commits intoGabriella439:masterfrom
fizruk:master

Conversation

@fizruk
Copy link
Copy Markdown
Contributor

@fizruk fizruk commented Nov 6, 2013

Okay, this may be naive, but I think the function is useful.

If this makes sense, I think it could be also useful to define something like:

generalizeBase :: (MFunctor t, Monad m) => t Identity a -> t m a
generalizeBase = hoist generalize

I don't like the name generalizeBase because it overlaps with MonadBase thing.
generalizeT seems to be a better fit, but I'd expect it to be of type (MonadTrans t, Monad m) => IdentityT m a -> t m a.

@Gabriella439
Copy link
Copy Markdown
Owner

Yeah, I agree that this is worth adding. I made two line comments, but otherwise it looks good.

I would probably not include generalizeBase, mainly because it's easy to derive from generalize and hoist, and it's not much shorter character-wise.

@fizruk
Copy link
Copy Markdown
Contributor Author

fizruk commented Nov 7, 2013

Done :)

@Gabriella439
Copy link
Copy Markdown
Owner

Awesome! Thank you very much for taking the time to contribute this.

Gabriella439 added a commit that referenced this pull request Nov 7, 2013
Added generalize function
@Gabriella439 Gabriella439 merged commit 4bd6125 into Gabriella439:master Nov 7, 2013
mamash pushed a commit to TritonDataCenter/pkgsrc-wip that referenced this pull request Jan 1, 2014
changes:
1.0.1
 - Polished @duairc's work in `Control.Monad.Trans.Compose`
   * Merge pull request #7 from duairc/composet
 - Merge pull request #5 from duairc/data-functor-instances
   Add MFunctor instances for the Compose, Product, Backwards and Lift
   types from the transformers package.
 - Merge pull request #6 from duairc/listt-instances
   Add MFunctor and MMonad instances for ListT
 - Merge pull request #2 from fizruk/master
   Added generalize function

( #7 => Gabriella439/Haskell-MMorph-Library#7 )
( #6 => Gabriella439/Haskell-MMorph-Library#6 )
( #5 => Gabriella439/Haskell-MMorph-Library#5 )
( #2 => Gabriella439/Haskell-MMorph-Library#2 )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants