Skip to content

Fix kind warnings #211

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Control/Category.purs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import Control.Semigroupoid (class Semigroupoid, compose, (<<<), (>>>))
-- | `Semigroupoid` law:
-- |
-- | - Identity: `identity <<< p = p <<< identity = p`
class Category :: forall k. (k -> k -> Type) -> Constraint
class Semigroupoid a <= Category a where
identity :: forall t. a t t

Expand Down
1 change: 1 addition & 0 deletions src/Control/Semigroupoid.purs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ module Control.Semigroupoid where
-- |
-- | One example of a `Semigroupoid` is the function type constructor `(->)`,
-- | with `(<<<)` defined as function composition.
class Semigroupoid :: forall k. (k -> k -> Type) -> Constraint
class Semigroupoid a where
compose :: forall b c d. a c d -> a b c -> a b d

Expand Down
1 change: 1 addition & 0 deletions src/Data/Monoid/Endo.purs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import Prelude
-- | Endo f <> Endo g == Endo (f <<< g)
-- | (mempty :: Endo _) == Endo identity
-- | ```
newtype Endo :: forall k. (k -> k -> Type) -> k -> Type
newtype Endo c a = Endo (c a a)

derive newtype instance eqEndo :: Eq (c a a) => Eq (Endo c a)
Expand Down
7 changes: 4 additions & 3 deletions src/Data/NaturalTransformation.purs
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@ module Data.NaturalTransformation where
-- | A type for natural transformations.
-- |
-- | A natural transformation is a mapping between type constructors of kind
-- | `Type -> Type` where the mapping operation has no ability to manipulate the
-- | inner values.
-- | `k -> Type`, for any kind `k`, where the mapping operation has no ability
-- | to manipulate the inner values.
-- |
-- | An example of this is the `fromFoldable` function provided in
-- | `purescript-lists`, where some foldable structure containing values of
-- | type `a` is converted into a `List a`.
-- |
-- | The definition of a natural transformation in category theory states that
-- | `f` and `g` should be functors, but the `Functor` constraint is not
-- | enforced here; that the types are of kind `Type -> Type` is enough for our
-- | enforced here; that the types are of kind `k -> Type` is enough for our
-- | purposes.
type NaturalTransformation :: forall k. (k -> Type) -> (k -> Type) -> Type
Copy link
Contributor

@hdgarrood hdgarrood Mar 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This kind signature disagrees with the doc-comments. I feel like perhaps we should make this (Type -> Type) -> (Type -> Type) -> Type unless there is a specific example where the generalized version would be useful.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Or alternatively update the doc comments)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good point, I've updated the doc comments.

type NaturalTransformation f g = forall a. f a -> g a

infixr 4 type NaturalTransformation as ~>
2 changes: 1 addition & 1 deletion src/Type/Data/RowList.purs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Type.Data.RowList where

import Prim.RowList (kind RowList)
import Prim.RowList (RowList)

-- | A proxy to carry information about a rowlist.
data RLProxy (rowlist :: RowList Type)
Expand Down