Skip to content

Instantly share code, notes, and snippets.

@wuct
Created October 3, 2017 11:01
Show Gist options
  • Save wuct/bf06a8e7923c71fda76e01247caae930 to your computer and use it in GitHub Desktop.
Save wuct/bf06a8e7923c71fda76e01247caae930 to your computer and use it in GitHub Desktop.
Answers of PureScript by Example Ch7 exercises.
liftedAdd :: forall f a. Apply f => Semiring a => f a -> f a -> f a
liftedAdd = lift2 (+)
combineMaybe :: forall a f. Applicative f => Maybe (f a) -> f (Maybe a)
combineMaybe Nothing = pure Nothing
combineMaybe (Just f) = Just <$> f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment