semigroupoid-extras (empty) → 0.1
raw patch · 5 files changed
+93/−0 lines, 5 filesdep +basedep +semigroupoidssetup-changed
Dependencies added: base, semigroupoids
Files
- Data/Semigroupoid/Coproduct.hs +17/−0
- Data/Semigroupoid/Product.hs +10/−0
- LICENSE +30/−0
- Setup.lhs +7/−0
- semigroupoid-extras.cabal +29/−0
+ Data/Semigroupoid/Coproduct.hs view
@@ -0,0 +1,17 @@+{-# LANGUAGE GADTs, EmptyDataDecls #-}+module Data.Semigroupoid.Coproduct + ( L, R, Coproduct(..) ) where++import Data.Semigroupoid++data L a+data R a++data Coproduct j k a b where+ L :: j a b -> Coproduct j k (L a) (L b)+ R :: k a b -> Coproduct j k (R a) (R b)++instance (Semigroupoid j, Semigroupoid k) => Semigroupoid (Coproduct j k) where+ L f `o` L g = L (f `o` g)+ R f `o` R g = R (f `o` g)+ _ `o` _ = error "GADT fail"
+ Data/Semigroupoid/Product.hs view
@@ -0,0 +1,10 @@+{-# LANGUAGE GADTs #-}+module Data.Semigroupoid.Product where++import Data.Semigroupoid++data Product j k a b where+ Pair :: j a b -> k a' b' -> Product j k (a,a') (b,b')++instance (Semigroupoid j, Semigroupoid k) => Semigroupoid (Product j k) where+ Pair w x `o` Pair y z = Pair (w `o` y) (x `o` z)
+ 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
+ semigroupoid-extras.cabal view
@@ -0,0 +1,29 @@+name: semigroupoid-extras+category: Control+version: 0.1+license: BSD3+cabal-version: >= 1.6+license-file: LICENSE+author: Edward A. Kmett+maintainer: Edward A. Kmett <ekmett@gmail.com>+stability: provisional+homepage: http://github.com/ekmett/semigroupoid-extras+copyright: Copyright (C) 2011 Edward A. Kmett+build-type: Simple+synopsis: semigroupoid products and coproducts+description: semigroupoid products and coproducts++source-repository head+ type: git+ location: git://github.com/ekmett/semigroupoid-extras.git++library+ build-depends: + base >= 4 && < 4.4,+ semigroupoids >= 1.1 && < 1.2++ exposed-modules:+ Data.Semigroupoid.Product+ Data.Semigroupoid.Coproduct++ ghc-options: -Wall