easyrender 0.1.0.0 → 0.1.0.1
raw patch · 3 files changed
+39/−3 lines, 3 filesdep ~base
Dependency ranges changed: base
Files
- ChangeLog +5/−0
- Graphics/EasyRender/Internal.hs +31/−0
- easyrender.cabal +3/−3
ChangeLog view
@@ -1,5 +1,10 @@ ChangeLog +v0.1.0.1 2014/10/08+ (2014/10/07) PS1 - added Applicative and Functor instances to+ silence compiler warnings.+ (2014/10/07) PS1 - updated dependencies to permit base 4.7.+ v0.1.0.0 2013/12/14 (2013/12/15) PS1 - converted to Cabal package.
Graphics/EasyRender/Internal.hs view
@@ -44,6 +44,9 @@ import System.IO import Text.Printf +import Control.Applicative (Applicative(..))+import Control.Monad (liftM, ap)+ -- ---------------------------------------------------------------------- -- * Types @@ -249,6 +252,13 @@ (x, y, f') <- draw return (x, y, f' >>= g) +instance Applicative Document where+ pure = return+ (<*>) = ap++instance Functor Document where+ fmap = liftM+ -- ---------------------------------------------------------------------- -- ** A vacuous run function @@ -373,6 +383,13 @@ f' <- draw return (f' >>= g) +instance Applicative Draw where+ pure = return+ (<*>) = ap++instance Functor Draw where+ fmap = liftM+ -- ---------------------------------------------------------------------- -- ** Low-level operations for the Draw monad @@ -813,6 +830,13 @@ Writer_PutChar c f' -> Writer_PutChar c (f' >>= g) Writer_PutStr s f' -> Writer_PutStr s (f' >>= g) +instance Applicative Writer where+ pure = return+ (<*>) = ap++instance Functor Writer where+ fmap = liftM+ instance WriterMonad Writer where wPutChar c = Writer_PutChar c (Writer_Return ()) wPutStr s = Writer_PutStr s (Writer_Return ())@@ -881,6 +905,13 @@ instance Monad m => Monad (Boxed m) where return a = Boxed (return a) f >>= g = Boxed (unbox f >>= (unbox . g))++instance Applicative m => Applicative (Boxed m) where+ pure a = Boxed (pure a)+ f <*> x = Boxed (unbox f <*> unbox x)++instance Functor m => Functor (Boxed m) where+ fmap f x = Boxed (fmap f (unbox x)) instance WriterMonad m => WriterMonad (Boxed m) where wPutChar c = Boxed (wPutChar c)
easyrender.cabal view
@@ -7,7 +7,7 @@ -- PVP summary: +-+------- breaking API changes -- | | +----- non-breaking API additions -- | | | +--- code changes with no API change-version: 0.1.0.0+version: 0.1.0.1 -- A short (one-line) description of the package. synopsis: User-friendly creation of EPS, PostScript, and PDF files@@ -57,7 +57,7 @@ maintainer: selinger@mathstat.dal.ca -- A copyright notice.-copyright: Copyright (c) 2012-2013 Peter Selinger+copyright: Copyright (c) 2012-2014 Peter Selinger -- A classification category for future use by the package catalogue -- Hackage. These categories have not yet been specified, but the@@ -83,5 +83,5 @@ -- other-modules: -- Other library packages from which modules are imported.- build-depends: base ==4.6.*, zlib ==0.5.*, mtl ==2.1.*, bytestring ==0.10.*, containers ==0.5.*, superdoc ==0.1.*+ build-depends: base >= 4.6 && < 4.8, zlib ==0.5.*, mtl ==2.1.*, bytestring ==0.10.*, containers ==0.5.*, superdoc ==0.1.*