I did in ghci:
> :set -XTypeOperators
> import Data.Proxy
> import Data.Type.Equality
> import Data.Singletons.Prelude
> :let p1 = Proxy :: Proxy (Int == Int)
> :let p2 = Proxy :: Proxy (Int :== Int)
> :t p1
p1 :: Proxy 'True
> :t p2
p2 :: Proxy (Int :== Int)
Why in the second case type is not calculated? Can I workaround it somehow? Can I make an instance for class PEq
(where :==
is defined)?
(ghc 7.10.3)
Update: I found how to make an instance. Are there some reasons why it is not included?
> instance PEq ('KProxy :: KProxy *) where { type (:==) x y = x == y }
or simple (as pointed by dfeuer in comments)
> instance PEq ('KProxy :: KProxy *)
or import this instance from TypeRepStar:
> import Data.Singletons.TypeRepStar()
==
is bad, but it's still not quite clear to me why the*
instance isn't included by default. – András Kovács*
could be implemented for requried set of types, not for all*
-types. Probably with better performance? Is it really important here? – Dmitry Olshansky