improvements to examples/
[coq-hetmet.git] / examples / GArrowAssTypes.hs
1 {-# LANGUAGE RankNTypes, FlexibleContexts, NoMonomorphismRestriction, ScopedTypeVariables #-}
2 --
3 -- |
4 -- Module      :  GArrowAssTypes
5 -- Copyright   :  none
6 -- License     :  public domain
7 --
8 -- Maintainer  :  Adam Megacz <megacz@acm.org>
9 -- Stability   :  experimental
10 --
11 -- | This module is a gigantic type inference hack; it redefines all of the
12 --   ga_functions with a slightly more specific type whereby each type g
13 --   which is a GArrow instance also has an *associated type* (GArrowTensor g)
14 --   for its tensor and (GArrowUnit g) for its unit.
15 --
16 --   DO import this module without qualification if you plan on
17 --   writing GArrow-expressions with as few annotations as possible.
18 --
19 --   DO NOT import this module without qualification if you plan on
20 --   creating new instances of GArrow.  Use "import qualified" or
21 --   don't import it at all.
22 --
23
24 module GArrowAssTypes
25        (ga_copy
26        ,ga_drop
27        ,ga_swap
28        , module Control.GArrow
29        )
30     where
31 import System.IO
32 import qualified Control.GArrow as G
33 import Control.GArrow hiding (ga_copy, ga_drop, ga_swap)
34
35 {-
36 ga_copy :: forall x . forall g . GArrowCopy g (GArrowTensor g) (GArrowUnit g) => g x (GArrowTensor g x x)
37 ga_copy = G.ga_copy
38
39 ga_drop :: forall x . forall g . GArrowDrop g (GArrowTensor g) (GArrowUnit g) => g x (GArrowUnit g)
40 ga_drop = G.ga_drop
41
42 ga_swap :: forall x y . forall g . GArrowSwap g (GArrowTensor g) (GArrowUnit g) => g (GArrowTensor g x y) (GArrowTensor g y x)
43 ga_swap = G.ga_swap
44 -}
45
46
47 ga_copy :: forall x . forall g . GArrowCopy g (,) () => g x ((,) x x)
48 ga_copy = G.ga_copy
49
50 ga_drop :: forall x . forall g . GArrowDrop g (,) () => g x ()
51 ga_drop = G.ga_drop
52
53 ga_swap :: forall x y . forall g . GArrowSwap g (,) () => g ((,) x y) ((,) y x)
54 ga_swap = G.ga_swap
55
56
57