Movatterモバイル変換
[0]ホーム
{-# LANGUAGE Trustworthy #-}{-# LANGUAGE GADTs #-}{-# LANGUAGE NoImplicitPrelude #-}{-# LANGUAGE PolyKinds #-}{-# OPTIONS_GHC -Wno-inline-rule-shadowing #-}-- The RULES for the methods of class Category may never fire-- e.g. identity/left, identity/right, association; see Trac #10528------------------------------------------------------------------------------- |-- Module : Control.Category-- Copyright : (c) Ashley Yakeley 2007-- License : BSD-style (see the LICENSE file in the distribution)---- Maintainer : ashley@semantic.org-- Stability : experimental-- Portability : portable-- http://ghc.haskell.org/trac/ghc/ticket/1773moduleControl.CategorywhereimportqualifiedGHC.Base(id,(.))importData.Type.CoercionimportData.Type.EqualityimportGHC.Prim(coerce)infixr9.infixr1>>>,<<<-- | A class for categories. Instances should satisfy the laws---- @-- f '.' 'id' = f -- (right identity)-- 'id' '.' f = f -- (left identity)-- f '.' (g '.' h) = (f '.' g) '.' h -- (associativity)-- @classCategorycatwhere-- | the identity morphismid::cataa-- | morphism composition(.)::catbc->catab->catac{-# RULES"identity/left"forallp.id.p=p"identity/right"forallp.p.id=p"association"forallpqr.(p.q).r=p.(q.r)#-}-- | @since 3.0instanceCategory(->)whereid=GHC.Base.id(.)=(GHC.Base..)-- | @since 4.7.0.0instanceCategory(:~:)whereid=ReflRefl.Refl=Refl-- | @since 4.10.0.0instanceCategory(:~~:)whereid=HReflHRefl.HRefl=HRefl-- | @since 4.7.0.0instanceCategoryCoercionwhereid=Coercion(.)Coercion=coerce-- | Right-to-left composition(<<<)::Categorycat=>catbc->catab->catac(<<<)=(.)-- | Left-to-right composition(>>>)::Categorycat=>catab->catbc->catacf>>>g=g.f
[8]ページ先頭