Skip to content

Commit

Permalink
Refactor to avoid star-is-type
Browse files Browse the repository at this point in the history
  • Loading branch information
maciejpirog committed Aug 31, 2023
1 parent f3276c2 commit 3e65ec2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## v1.1.1

- Refactor to avoid the noncanonical-monad-instances warning
- Refactor to avoid the noncanonical-monad-instances and star-is-type warnings

## v1.1.0

Expand Down
3 changes: 2 additions & 1 deletion src/Control/Monad/List/Exotic.hs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ module Control.Monad.List.Exotic

import Prelude hiding ((<>))
import Control.Monad (ap, join)
import Data.Kind (Type)
import GHC.Exts (IsList(..), IsString(..), Constraint)
import GHC.TypeLits
import Data.Proxy
Expand Down Expand Up @@ -320,7 +321,7 @@ instance PointedMagma [a] where
-- @
-- instance FreeRBPM [] 'Data.Monoid.Monoid'
-- @
class (ListMonad m) => FreeRBPM m (c :: * -> Constraint) | m -> c where
class (ListMonad m) => FreeRBPM m (c :: Type -> Constraint) | m -> c where
foldRBPM :: (PointedMagma a, c a) => (x -> a) -> m x -> a
foldRBPM _ (unwrap -> []) = eps
foldRBPM f (unwrap -> xs) = foldr1 (<>) (map f xs)
Expand Down
3 changes: 2 additions & 1 deletion src/Control/Monad/List/NonEmpty/Exotic.hs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ import Data.List.NonEmpty (NonEmpty(..))
import qualified Data.List.NonEmpty as NonEmpty
import Prelude hiding ((<>))
import Control.Monad (ap, join)
import Data.Kind (Type)
import GHC.Exts (IsList(..), IsString(..), Constraint)
import GHC.TypeLits
import Data.Proxy
Expand Down Expand Up @@ -284,7 +285,7 @@ class Magma a where
-- @
-- instance FreeRBM 'NonEmpty' 'Data.Semigroup.Semigroup'
-- @
class (NonEmptyMonad m) => FreeRBM m (c :: * -> Constraint) | m -> c where
class (NonEmptyMonad m) => FreeRBM m (c :: Type -> Constraint) | m -> c where
foldRBM :: (Magma a, c a) => (x -> a) -> m x -> a
foldRBM f (unwrap -> toList -> xs) = foldr1 (<>) (map f xs)

Expand Down

0 comments on commit 3e65ec2

Please sign in to comment.