Permalink
Browse files

Switch back to simple IP class.

  • Loading branch information...
1 parent c1177ef commit c6ff62c1f9e6d4b0e2d5be1830624cffcaff8450 @yav yav committed Jun 10, 2012
Showing with 3 additions and 18 deletions.
  1. +3 −18 GHC/IP.hs
View
@@ -3,27 +3,12 @@
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE DataKinds #-}
{-# OPTIONS_GHC -XNoImplicitPrelude #-}
-module GHC.IP (IP, IPName(..), ipUse) where
+module GHC.IP (IP(..)) where
import GHC.TypeLits
--- | A singleton type used to name implicit parameters.
-data IPName (name :: Symbol) = IPName
-
--- | A type used to give values to implicit parameters.
--- The name is a phantom parameter because it needs no run-time representation.
-newtype IPValue (name :: Symbol) a = IPValue a
-
-
--- | The syntax @?x@ is desuagred into @ipUse (IPName :: "x")@
-ipUse :: IP x a => IPName x -> a
-ipUse x = case val x of
- IPValue a -> a
- where val :: IP x a => IPName x -> IPValue x a
- val _ = ip
-
-- | The syntax @?x :: a@ is desugared into @IP "x" a@
-class IP x a | x -> a where
- ip :: IPValue x a
+class IP (x :: Symbol) a | x -> a where
+ ip :: a

0 comments on commit c6ff62c

Please sign in to comment.