Permalink
Browse files

Improved format of header of TH.hs / improved cabal file / added README

  • Loading branch information...
1 parent 51cd744 commit 156e4e0ced2f618a10f1ba1ed1be6674e3ab9b0e Michael Sloan committed Jun 29, 2011
Showing with 46 additions and 19 deletions.
  1. +20 −12 Control/Newtype/TH.hs
  2. +13 −0 README
  3. +13 −7 newtype-th.cabal
View
@@ -1,18 +1,26 @@
{-# LANGUAGE TemplateHaskell #-}
-{- |
-This module provides a template Haskell based mechanism for deriving
-instances of the Newtype class, defined in Control.Newtype. Example usage:
-> newtype CartesianList a = CartesianList [a]
-> $(mkNewTypes [''CartesianList])
->
-> instance Monoid (CartesianList a) where
-> mempty = pack [[]]
-> a `mappend` b = pack [x ++ y | x <- unpack a, y <- unpack b]
+-----------------------------------------------------------------------------
+-- |
+-- Module : Control.Newtype.TH
+-- Copyright : Michael Sloan 2011
+--
+-- Maintainer : Michael Sloan (mgsloan@gmail.com)
+-- Portability : unportable
+--
+-- This module provides a template Haskell based mechanism for deriving
+-- instances of the Newtype class, defined in Control.Newtype. Example usage:
+--
+-- > newtype CartesianList a = CartesianList [a]
+-- > $(mkNewTypes [''CartesianList])
+-- >
+-- > instance Monoid (CartesianList a) where
+-- > mempty = pack [[]]
+-- > a `mappend` b = pack [x ++ y | x <- unpack a, y <- unpack b]
+--
+-- > *Main> print $ underF CartesianList (\xs -> [fold xs]) ([[[4],[5],[6]], [[1],[2]], [[0]]])
+-- > [[[4,1,0],[4,2,0],[5,1,0],[5,2,0],[6,1,0],[6,2,0]]]
-> *Main> print $ underF CartesianList (\xs -> [fold xs]) ([[[4],[5],[6]], [[1],[2]], [[0]]])
-> [[[4,1,0],[4,2,0],[5,1,0],[5,2,0],[6,1,0],[6,2,0]]]
--}
module Control.Newtype.TH (mkNewTypes) where
import Control.Monad (liftM)
View
13 README
@@ -0,0 +1,13 @@
+http://hackage.haskell.org/package/newtype-th
+
+Provides a template haskell based mechanism for
+deriving instances of djahandarie's Control.Newtype class.
+
+To build / install:
+
+chmod ugo+x Setup.hs
+./Setup.hs configure --user
+./Setup.hs build
+./Setup.hs install
+
+See the haddock or Control/Newtype/TH.hs for documentation.
View
@@ -1,17 +1,23 @@
Name: newtype-th
-Version: 0.1
-Synopsis: Provides a template haskell based mechanism for
- deriving Control.Newtype class instances.
-Description:
+Version: 0.1.0.1
+Synopsis: A template haskell deriver to create Control.Newtype instances.
+Description: Provides a template haskell based mechanism for
+ deriving instances of djahandarie's Control.Newtype class.
License: BSD3
License-file: LICENSE
Author: Michael Sloan
Maintainer: Michael Sloan <mgsloan at gmail>
--- Copyright:
+Homepage: http://github.com/mgsloan/newtype-th
+Copyright: Michael Sloan 2011
Category: Control
Build-type: Simple
--- Extra-source-files:
-Cabal-version: >=1.2
+Extra-source-files: Tests.hs
+Data-files: README
+Cabal-version: >=1.6
+Bug-Reports: http://github.com/mgsloan/newtype-th/issues
+Source-Repository head
+ Type: git
+ Location: git://github.com/mgsloan/newtype-th
Library
Extensions: TemplateHaskell

0 comments on commit 156e4e0

Please sign in to comment.