packages feed

fusion-plugin-types (empty) → 0.1.0

raw patch · 7 files changed

+144/−0 lines, 7 filesdep +basesetup-changed

Dependencies added: base

Files

+ CHANGELOG.md view
@@ -0,0 +1,3 @@+## 0.1.0++* Initial release
+ LICENSE view
@@ -0,0 +1,30 @@+Copyright (c) 2020, Composewell Technologies++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 Composewell Technologies nor the names of other+      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+OWNER 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.
+ README.md view
@@ -0,0 +1,30 @@+# fusion-plugin-types++[![Hackage](https://img.shields.io/hackage/v/fusion-plugin-types.svg?style=flat)](https://hackage.haskell.org/package/fusion-plugin-types)+![](https://github.com/composewell/fusion-plugin-types/workflows/Haskell%20CI/badge.svg)++## Motivation++This package provides types needed to run the fusion-plugin+plugin. This package is separated from the+[fusion-plugin](https://github.com/composewell/fusion-plugin) package+so that library authors can annotate the types that `fusion-plugin`+should try to fuse but avoid the `ghc` dependency in the library+itself.++## Using the package++To enable support for using the `fusion-plugin` plugin, add this+package to your `build-depends` and annotate your types with `Fuse`+type from `Fusion.Plugin.Types` module.++```haskell+import Fusion.Plugin.Types (Fuse (..))++{-# ANN type Step Fuse #-}+data Step s a = Yield a s | Skip s | Stop+```++## See Also++* [fusion-plugin](https://github.com/composewell/fusion-plugin)
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ fusion-plugin-types.cabal view
@@ -0,0 +1,38 @@+cabal-version:       2.2++name:                fusion-plugin-types+version:             0.1.0+synopsis:            Types for the fusion-plugin package.+description:         GHC package that provides types that when used in a package can be identified by the <https://hackage.haskell.org/package/fusion-plugin fusion-plugin> package to perform any extra optimizations.+homepage:            https://github.com/composewell/fusion-plugin-types+bug-reports:         https://github.com/composewell/fusion-plugin-types/issues+license:             BSD-3-Clause+license-file:        LICENSE+tested-with:         GHC==8.6.5+                   , GHC==8.8.1+author:              Pranay Sashank+maintainer:          pranaysashank@composewell.com+copyright:           (c) 2020 Composewell Technologies+category:            Development+build-type:          Simple+extra-source-files:  CHANGELOG.md+                     README.md+                     stack.yaml++source-repository head+    type: git+    location: https://github.com/composewell/fusion-plugin-types++library+  exposed-modules:   Fusion.Plugin.Types+  build-depends:     base >= 4.0 && < 5.0+  hs-source-dirs:    src+  ghc-options:       -Wall+  if impl(ghc >= 8.0)+    ghc-options:     -Wcompat+                     -Wunrecognised-warning-flags+                     -Widentities+                     -Wincomplete-uni-patterns+                     -Wredundant-constraints+                     -Wnoncanonical-monad-instances+  default-language:  Haskell2010
+ src/Fusion/Plugin/Types.hs view
@@ -0,0 +1,38 @@+-- |+-- Module      : Fusion.Plugin.Types+-- Copyright   : (c) 2020 Composewell Technologies+--+-- License     : BSD-3-Clause+-- Maintainer  : pranaysashank@composewell.com+-- Stability   : experimental+-- Portability : GHC++{-# LANGUAGE DeriveDataTypeable #-}++module Fusion.Plugin.Types+  ( Fuse(..)+  )+where++import Data.Data (Data)++-- | A GHC annotation to inform the plugin to aggressively inline join points+-- that perform a case match on the constructors of the annotated type.+-- Inlining enables case-of-case transformations that would potentially+-- eliminate the constructors.+--+-- This annotation is to be used on types whose constructors are known to be+-- involved in case-of-case transformations enabling stream fusion via+-- elimination of those constructors.+--+-- It is advised to use unique types for intermediate stream state that is to+-- be annotated with 'Fuse'. If the annotated type is also used for some+-- other purpose this annotation may inline code that is not involved in stream+-- fusion and should otherwise not be inlined.+--+-- @+-- {-\# ANN type Step Fuse #-}+-- data Step s a = Yield a s | Skip s | Stop+-- @+data Fuse = Fuse+    deriving (Eq, Data)
+ stack.yaml view
@@ -0,0 +1,3 @@+resolver: lts-14.25+packages:+- '.'