packages feed

hyper-extra (empty) → 0.1.0.0

raw patch · 4 files changed

+87/−0 lines, 4 filesdep +basedep +diagrams-libdep +diagrams-svgsetup-changed

Dependencies added: base, diagrams-lib, diagrams-svg, hyper, svg-builder, text

Files

+ LICENSE view
@@ -0,0 +1,30 @@+Copyright (c) 2016 Heinrich Apfelmus++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 Heinrich Apfelmus 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.
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ hyper-extra.cabal view
@@ -0,0 +1,32 @@+Name:               hyper-extra+Version:            0.1.0.0+Synopsis:           Display instances for the HyperHaskell graphical Haskell interpreter+Description:+  This package is part of the /HyperHaskell/ project and provides+  visual representations for various data types, in particular+  diagrams from the @diagrams@ package.+  .+Category:           Graphics, Pretty Printer+License:            BSD3+License-file:       LICENSE+Author:             Heinrich Apfelmus+Maintainer:         Heinrich Apfelmus <apfelmus quantentunnel de>+Copyright:          (c) Heinrich Apfelmus 2016++Cabal-version:      >= 1.8+Build-type:         Simple++Source-repository head+    type:               git+    location:           git://github.com/HeinrichApfelmus/hyper-haskell.git+    subdir:             haskell/hyper-extra/++Library+    hs-source-dirs:     src+    build-depends:      base           >= 4.6   && < 4.10+                        , text         >= 0.11  && < 1.3+                        , diagrams-lib >= 1.3   && < 1.4+                        , diagrams-svg >= 1.4   && < 1.5+                        , svg-builder  == 0.1.*+                        , hyper        == 0.1.*+    exposed-modules:    Hyper.Extra
+ src/Hyper/Extra.hs view
@@ -0,0 +1,23 @@+module Hyper.Extra (+    -- * Synopsis+    -- | Visual representation for various data types.+    +    -- * Diagrams+    dia,+    ) where++import Hyper++import qualified Data.Text        as T+import qualified Data.Text.Lazy   as TL++import Diagrams.Prelude+import Diagrams.Backend.SVG+import Graphics.Svg               as SVG++{-----------------------------------------------------------------------------+    Integration of the `diagrams-svg` and `svg-builder` packages+------------------------------------------------------------------------------}+dia :: QDiagram SVG V2 Double Any -> Graphic+dia = html . TL.toStrict . SVG.renderText+    . renderDia SVG (SVGOptions (mkWidth 250) Nothing (T.pack "") [] True)