packages feed

groupoids (empty) → 0.1

raw patch · 5 files changed

+99/−0 lines, 5 filesdep +basedep +semigroupoidssetup-changed

Dependencies added: base, semigroupoids

Files

+ Data/Groupoid.hs view
@@ -0,0 +1,9 @@+module Data.Groupoid+  ( Groupoid(..)+  ) where++import Data.Semigroupoid++-- | semigroupoid with inverses. This technically should be a category with inverses, except we need to use Ob to define the valid objects for the category+class Semigroupoid k => Groupoid k where+  inv :: k a b -> k b a
+ Data/Groupoid/Isomorphism.hs view
@@ -0,0 +1,21 @@+module Data.Groupoid.Isomorphism+  ( Iso(..)+  ) where++import Data.Semigroupoid+import Data.Groupoid+import Control.Category+import Prelude ()++data Iso k a b = Iso { embed :: k a b, project :: k b a } ++instance Semigroupoid k => Semigroupoid (Iso k) where+  Iso f g `o` Iso h i = Iso (f `o` h) (i `o` g) ++instance Semigroupoid k => Groupoid (Iso k) where+  inv (Iso f g) = Iso g f ++instance Category k => Category (Iso k) where+  Iso f g . Iso h i = Iso (f . h) (i . g) +  id = Iso id id +
+ LICENSE view
@@ -0,0 +1,30 @@+Copyright 2011 Edward Kmett++All rights reserved.++Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions+are met:++1. Redistributions of source code must retain the above copyright+   notice, this list of conditions and the following disclaimer.++2. Redistributions in binary form must reproduce the above copyright+   notice, this list of conditions and the following disclaimer in the+   documentation and/or other materials provided with the distribution.++3. Neither the name of the author nor the names of his contributors+   may be used to endorse or promote products derived from this software+   without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE+DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN+ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE+POSSIBILITY OF SUCH DAMAGE.
+ Setup.lhs view
@@ -0,0 +1,7 @@+#!/usr/bin/runhaskell+> module Main (main) where++> import Distribution.Simple++> main :: IO ()+> main = defaultMain
+ groupoids.cabal view
@@ -0,0 +1,32 @@+name:          groupoids+category:      Control, Categories+version:       0.1+license:       BSD3+cabal-version: >= 1.6+license-file:  LICENSE+author:        Edward A. Kmett+maintainer:    Edward A. Kmett <ekmett@gmail.com>+stability:     experimental+homepage:      http://github.com/ekmett/groupoids/+copyright:     Copyright (C) 2011 Edward A. Kmett+synopsis:      Haskell 98 Groupoids+description:   Haskell 98 Groupoids+build-type:    Simple++source-repository head+  type: git+  location: git://github.com/ekmett/groupoids.git++library+  build-depends: +    base >= 4 && < 5,+    semigroupoids >= 1.2.2 && <= 1.3++  exposed-modules:+    Data.Groupoid+    Data.Groupoid.Isomorphism++  ghc-options:      -Wall +--  if impl(ghc)+--    cpp-options: -DGHC_TYPEABLE+--  extensions: CPP