[commit: base] imp-param-class: Add a class to be used for implementing implicit parameters. (5126528)
Iavor Diatchki
diatchki at galois.com
Thu May 24 23:35:05 CEST 2012
Repository : ssh://darcs.haskell.org//srv/darcs/packages/base
On branch : imp-param-class
http://hackage.haskell.org/trac/ghc/changeset/5126528206e442e2f1859593b573456798ace41a
>---------------------------------------------------------------
commit 5126528206e442e2f1859593b573456798ace41a
Author: Iavor S. Diatchki <diatchki at galois.com>
Date: Thu May 24 14:32:19 2012 -0700
Add a class to be used for implementing implicit parameters.
>---------------------------------------------------------------
GHC/IP.hs | 14 ++++++++++++++
base.cabal | 1 +
2 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/GHC/IP.hs b/GHC/IP.hs
new file mode 100644
index 0000000..7cb3209
--- /dev/null
+++ b/GHC/IP.hs
@@ -0,0 +1,14 @@
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE FunctionalDependencies #-}
+{-# LANGUAGE KindSignatures #-}
+{-# LANGUAGE DataKinds #-}
+{-# OPTIONS_GHC -XNoImplicitPrelude #-}
+module GHC.IP where
+
+import GHC.TypeLits
+
+-- | This class is used to implement implicit parameters.
+class IP (name :: Symbol) t | name -> t where
+ ipValue :: t
+
+
diff --git a/base.cabal b/base.cabal
index ea553d2..367f45b 100644
--- a/base.cabal
+++ b/base.cabal
@@ -84,6 +84,7 @@ Library {
GHC.IOArray,
GHC.IOBase,
GHC.IORef,
+ GHC.IP,
GHC.Int,
GHC.List,
GHC.MVar,
More information about the Cvs-libraries
mailing list