joint (empty) → 0.1.0
raw patch · 8 files changed
+120/−0 lines, 8 filesdep +base
Dependencies added: base
Files
- Control/Joint/Composition.hs +6/−0
- Control/Joint/Core.hs +14/−0
- Control/Joint/Schemes.hs +4/−0
- Control/Joint/Schemes/TU.hs +10/−0
- Control/Joint/Schemes/UTU.hs +10/−0
- Control/Joint/Transformer.hs +13/−0
- LICENSE +29/−0
- joint.cabal +34/−0
+ Control/Joint/Composition.hs view
@@ -0,0 +1,6 @@+module Control.Joint.Composition (Composition (..)) where++class Composition t where+ {-# MINIMAL unwrap #-}+ type Primary t a :: *+ unwrap :: t a -> Primary t a
+ Control/Joint/Core.hs view
@@ -0,0 +1,14 @@+module Control.Joint.Core where++infixr 1 :.+infixr 0 :=+infixr 0 ~>++-- | Functor composition+type (:.) t u a = t (u a)++-- | Functor's object+type (:=) t a = t a++-- | Natural transformation+type (~>) t u = forall a . t a -> u a
+ Control/Joint/Schemes.hs view
@@ -0,0 +1,4 @@+module Control.Joint.Schemes (module Exports) where++import Control.Joint.Schemes.UTU as Exports+import Control.Joint.Schemes.TU as Exports
+ Control/Joint/Schemes/TU.hs view
@@ -0,0 +1,10 @@+module Control.Joint.Schemes.TU (TU (..)) where++import Control.Joint.Core (type (:.), type (:=))+import Control.Joint.Composition (Composition (Primary, unwrap))++newtype TU t u a = TU (t :. u := a)++instance Composition (TU t u) where+ type Primary (TU t u) a = t :. u := a+ unwrap (TU x) = x
+ Control/Joint/Schemes/UTU.hs view
@@ -0,0 +1,10 @@+module Control.Joint.Schemes.UTU (UTU (..)) where++import Control.Joint.Core (type (:.), type (:=))+import Control.Joint.Composition (Composition (Primary, unwrap))++newtype UTU t u a = UTU (u :. t u := a)++instance Composition (UTU t u) where+ type Primary (UTU t u) a = u :. t u := a+ unwrap (UTU x) = x
+ Control/Joint/Transformer.hs view
@@ -0,0 +1,13 @@+module Control.Joint.Transformer (Transformer (..)) where++import Control.Joint.Core (type (~>))+import Control.Joint.Composition (Composition)++class Composition t => Transformer t where+ {-# MINIMAL lay, wrap #-}+ type Schema (t :: * -> *) (u :: * -> *) = (r :: * -> *) | r -> t u+ lay :: Functor u => u ~> Schema t u+ wrap :: Applicative u => t ~> Schema t u++infixr 1 :>+type (:>) t u a = Transformer t => Schema t u a
+ LICENSE view
@@ -0,0 +1,29 @@+BSD 3-Clause License++Copyright (c) 2018, Murat Kasimov+All rights reserved.++Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions are met:++* Redistributions of source code must retain the above copyright notice, this+ list of conditions and the following disclaimer.++* 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.++* Neither the name of the copyright holder nor the names of its+ contributors may be used to endorse or promote products derived from+ this software without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 COPYRIGHT HOLDER 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.
+ joint.cabal view
@@ -0,0 +1,34 @@+name: joint+version: 0.1.0+synopsis: Trying to compose non-composable+homepage: https://github.com/iokasimov/joint+license: BSD3+license-file: LICENSE+author: Murat Kasimov+maintainer: Murat Kasimov <iokasimov.m@gmail.com>+copyright: Copyright (c) 2018 Murat Kasimov+category: Data, Control+build-type: Simple+cabal-version: >= 1.10++source-repository head+ type: git+ location: https://github.com/iokasimov/joint.git++library+ exposed-modules:+ Control.Joint.Core+ Control.Joint.Composition+ Control.Joint.Transformer+ Control.Joint.Schemes+ Control.Joint.Schemes.TU+ Control.Joint.Schemes.UTU+ build-depends: base == 4.*+ default-language: Haskell2010+ ghc-options: -fno-warn-tabs+ default-extensions:+ LiberalTypeSynonyms+ RankNTypes+ TypeFamilies+ TypeFamilyDependencies+ TypeOperators