packages feed

code-builder 0.1.2.1 → 0.1.3

raw patch · 3 files changed

+47/−26 lines, 3 filesnew-uploader

Files

+ CHANGELOG.md view
@@ -0,0 +1,5 @@+# Changelog++### 0.1.3++* `<++>` No longer prints a separating space if at least one of the operands is empty
code-builder.cabal view
@@ -1,26 +1,32 @@-Name:                code-builder-Version:             0.1.2.1-Synopsis:            Simple system for generating code.-Description:         Simple system for generating code.-License:             BSD3-License-file:        LICENSE-Author:              Silk-Maintainer:          code@silk.co-Category:            Data-Build-type:          Simple-Cabal-version:       >=1.6+name:                code-builder+version:             0.1.3+synopsis:            Simple system for generating code.+description:         Simple system for generating code.+license:             BSD3+license-file:        LICENSE+author:              Silk+maintainer:          code@silk.co+category:            Data+build-type:          Simple+cabal-version:       >=1.6 -Library-  Hs-Source-Dirs:    src-  Exposed-Modules:   Code.Build-                     Code.Build.JavaScript-                     Code.Build.Haskell-                     Code.Build.PHP-                     Code.Build.Ruby-  Build-Depends:     base == 4.*-                   , containers >= 0.3 && < 0.6-  Ghc-Options:       -Wall+extra-source-files:+  CHANGELOG.md+  LICENSE -Source-repository head-  Type:              Git-  Location:          https://github.com/silkapp/rest.git+source-repository head+  type:              git+  location:          https://github.com/silkapp/rest.git++library+  ghc-options:       -Wall+  hs-source-dirs:    src+  exposed-modules:+    Code.Build+    Code.Build.Haskell+    Code.Build.JavaScript+    Code.Build.PHP+    Code.Build.Ruby+  build-depends:+      base == 4.*+    , containers >= 0.3 && < 0.6
src/Code/Build.hs view
@@ -1,4 +1,9 @@-{-# LANGUAGE OverlappingInstances, TypeSynonymInstances, FlexibleInstances, UndecidableInstances #-}+{-# LANGUAGE+    FlexibleInstances+  , OverlappingInstances+  , TypeSynonymInstances+  , UndecidableInstances+  #-} module Code.Build where  import Data.List@@ -135,7 +140,12 @@  -- | Same as <++> but with space (<++>) :: (Codeable a, Codeable b) => a -> b -> Code-a <++> b = a <+> " " <+> b+a <++> b+  | empty a = code b+  | empty b = code a+  | otherwise = a <+> " " <+> b+    where+     empty x = all (== "") (unCode (code x))  -- | Place the second block after the last line of the first block. Aligns the second block (<+|) :: (Codeable a, Codeable b) => a -> b -> Code