elision 0.1.3.1 → 0.1.3.2
raw patch · 2 files changed
+12/−12 lines, 2 files
Files
- elision.cabal +1/−1
- src/Control/Arrow/Elision/Flexible.hs +11/−11
elision.cabal view
@@ -1,5 +1,5 @@ name: elision-version: 0.1.3.1+version: 0.1.3.2 synopsis: Arrows with holes. description: A framework for describing holes in transformations and impure computations purely.
src/Control/Arrow/Elision/Flexible.hs view
@@ -29,7 +29,7 @@ | R Direction -- * In @Nav f (g // h)@, @h@ has a common sub expression. | X Direction Direction -- * Subexpressions exist for both @f0@ and @f1@ in @g // h@ in @Nav (f0 // f1) (g // h)@ | Equiv -- * In @Nav f g@, @f ~ g@.- | Divergant -- * There are no common subtypes.+ | Divergent -- * There are no common subtypes. -------------------------------------------------------------------------------- -- | "Navigate" down a tree of types to find common types which are equivalent.@@ -38,26 +38,26 @@ Nav f f = 'Equiv Nav (f // g) (h // i) = 'X (Nav f (h // i)) (Nav g (h // i)) Nav f (h // i) = Choose (Converges (Nav f h)) (Nav f h) (Converges (Nav f i)) (Nav f i)- Nav f g = 'Divergant+ Nav f g = 'Divergent -------------------------------------------------------------------------------- -- | A constraint that can only be satisfied if a direction terminates in -- 'Equiv'.-class 'True ~ Converges a => Convergant (a :: Direction)-instance Convergant 'Equiv-instance Convergant a => Convergant ('L a)-instance Convergant a => Convergant ('R a)-instance (Convergant a, Convergant b) => Convergant ('X a b)+class 'True ~ Converges a => Convergent (a :: Direction)+instance Convergent 'Equiv+instance Convergent a => Convergent ('L a)+instance Convergent a => Convergent ('R a)+instance (Convergent a, Convergent b) => Convergent ('X a b) -------------------------------------------------------------------------------- -- A type level function which determines if @a@ terminates in 'Equiv'. -- -- Because 'True ~ Converges a' can be cumbersome to type, this module also--- provides an equivalent typeclass, 'Convergant', which can be used as a+-- provides an equivalent typeclass, 'Convergent', which can be used as a -- constraint on a function. type family Converges a where Converges 'Equiv = 'True- Converges 'Divergant = 'False+ Converges 'Divergent = 'False Converges ('L k) = Converges k Converges ('R k) = Converges k Converges ('X k1 k2) = And (Converges k1) (Converges k2)@@ -72,12 +72,12 @@ type family Choose (exA :: Bool) (a :: Direction) (exB :: Bool) (b :: Direction) where Choose 'True a exB b = 'L a Choose 'False a 'True b = 'R b- Choose 'False a 'False b = 'Divergant+ Choose 'False a 'False b = 'Divergent -------------------------------------------------------------------------------- -- | In @Conv k f g@, the interpreter for @f@ is completely covered by the -- interpreter for @g@, so @g@ can be substituted for @f@ with 'conv'.-class (k ~ Nav f g, Convergant k) => Conv k f g where+class (k ~ Nav f g, Convergent k) => Conv k f g where conv :: (g a -> m a) -> f a -> m a instance Conv 'Equiv f f where