purescript / purescript-prelude

The PureScript Prelude

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add Data.Reflectable

purefunctor opened this issue · comments

The type-level integers PR for the compiler was recently merged and it introduces automatic solving for the Reflectable class which is defined as the following.

module Data.Reflectable where

class Reflectable :: forall k. k -> Type -> Constraint
class Reflectable v t | v -> t where
  reflectType :: forall proxy. proxy v -> t

I'll open a PR once ES modules land in this repository.

I believe the proxy type should be Proxy:

- reflectType :: forall proxy. proxy v -> t
+ reflectType :: Proxy v -> t

See #231 / #281

@purefunctor The ES modules PR has been merged to this repo. Do you want to work on adding Reflectable now?

Yes, I'll do it in a few hours