Skip to content

Commit

Permalink
Fix warnings revealed by v0.14.1 PS release; export functions (#139)
Browse files Browse the repository at this point in the history
* Fix warnings revealed by v0.14.1 PS release; export functions

Exported functions
- mapCont
- withCont

* Update changelog
  • Loading branch information
JordanMartinez committed Apr 25, 2021
1 parent 8465817 commit 28e569b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ Notable changes to this project are documented in this file. The format is based
Breaking changes:

New features:
- Export `mapCont` and `withCont` functions originally added in #70 by @parsonsmatt (#139 by @JordanMartinez)

Bugfixes:

Other improvements:
- Fix warnings revealed by v0.14.1 PS release (#139 by @JordanMartinez)

## [v5.0.0](https://github.com/purescript/purescript-transformers/releases/tag/v5.0.0) - 2021-02-26

Expand Down
4 changes: 2 additions & 2 deletions src/Control/Comonad/Env/Trans.purs
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ instance extendEnvT :: Extend w => Extend (EnvT e w) where
extend f (EnvT (Tuple e x)) = EnvT $ Tuple e (f <$> ((Tuple e >>> EnvT) <<= x))

instance comonadEnvT :: Comonad w => Comonad (EnvT e w) where
extract (EnvT (Tuple e x)) = extract x
extract (EnvT (Tuple _ x)) = extract x

instance comonadTransEnvT :: ComonadTrans (EnvT e) where
lower (EnvT (Tuple e x)) = x
lower (EnvT (Tuple _ x)) = x

instance foldableEnvT :: Foldable f => Foldable (EnvT e f) where
foldl fn a (EnvT (Tuple _ x)) = foldl fn a x
Expand Down
2 changes: 1 addition & 1 deletion src/Control/Comonad/Store/Class.purs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ seeks :: forall s a w. ComonadStore s w => (s -> s) -> w a -> w a
seeks f = peeks f <<< duplicate

instance comonadStoreStoreT :: Comonad w => ComonadStore s (StoreT s w) where
pos (StoreT (Tuple f s)) = s
pos (StoreT (Tuple _ s)) = s
peek s (StoreT (Tuple f _)) = extract f s

instance comonadStoreEnvT :: ComonadStore s w => ComonadStore s (EnvT e w) where
Expand Down
2 changes: 2 additions & 0 deletions src/Control/Monad/Cont.purs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ module Control.Monad.Cont
( Cont
, cont
, runCont
, mapCont
, withCont
, module Control.Monad.Cont.Trans
, module Control.Monad.Cont.Class
) where
Expand Down
4 changes: 2 additions & 2 deletions src/Control/Monad/List/Trans.purs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ repeat = iterate identity

-- | Take a number of elements from the front of a list.
take :: forall f a. Applicative f => Int -> ListT f a -> ListT f a
take 0 fa = nil
take 0 _ = nil
take n fa = stepMap f fa where
f (Yield a s) = Yield a (take (n - 1) <$> s)
f (Skip s) = Skip (take n <$> s)
Expand All @@ -159,7 +159,7 @@ takeWhile f = stepMap g where
drop :: forall f a. Applicative f => Int -> ListT f a -> ListT f a
drop 0 fa = fa
drop n fa = stepMap f fa where
f (Yield a s) = Skip (drop (n - 1) <$> s)
f (Yield _ s) = Skip (drop (n - 1) <$> s)
f (Skip s) = Skip (drop n <$> s)
f Done = Done

Expand Down

0 comments on commit 28e569b

Please sign in to comment.