Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Kind-Polymorphism and Show #260

Copy link
Copy link
@csicar

Description

@csicar
Issue body actions

As of 0.14, the Proxy-Zoo should get reduced to just one: Proxy. This means that creating type-class instances for proxied values is no longer possible (as far as I know)

For example in typelevel-peano (https://github.com/csicar/purescript-typelevel-peano/pull/4/files#diff-7de00383917fea851d52cc5de4f18f87329b6b3f4e2819a8ebcbf9d8c0d85a80R47) I had a Show-Instance for typelevel Ints, that would print the value representation:

>>> instance showNat :: Show (IProxy a) where show = reflectInt
>>> show (IProxy :: IProxy N10)
10

I think it would be nice to have the same functionality for Proxy as well:

-- In Type.Proxy
class KindShow a where
  kindShow :: Proxy a -> String

instance showkindShow :: (KindShow a) => Show (Proxy a) where
  show a = kindShow a

---- In client
data Int

reflectInt = ...

instance show :: KindShow Int where
  kindShow p = reflectInt p

Does that make sense? Is there an easier way?

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: needs more infoThis issue needs more info before any action can be done.This issue needs more info before any action can be done.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.