refresh patches to current hackage versions

This commit is contained in:
Joey Hess 2013-10-18 22:44:06 -04:00
parent 41f80fef9f
commit acd28220c7
8 changed files with 148 additions and 219 deletions

View file

@ -1,6 +1,6 @@
From 2cb43c46d345341d1aa77c4b2a88514c056d3122 Mon Sep 17 00:00:00 2001
From: foo <foo@bar>
Date: Sat, 21 Sep 2013 22:25:18 +0000
From 589c6a87ec62e35942c9a86ea8d91b443c80da99 Mon Sep 17 00:00:00 2001
From: dummy <dummy@example.com>
Date: Fri, 18 Oct 2013 23:07:02 +0000
Subject: [PATCH] cross build
---
@ -8,18 +8,18 @@ Subject: [PATCH] cross build
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/comonad.cabal b/comonad.cabal
index e01f1a7..e807e05 100644
index 5d34b13..756ed92 100644
--- a/comonad.cabal
+++ b/comonad.cabal
@@ -13,7 +13,7 @@ copyright: Copyright (C) 2008-2013 Edward A. Kmett,
Copyright (C) 2004-2008 Dave Menendez
synopsis: Haskell 98 compatible comonads
description: Haskell 98 compatible comonads
synopsis: Comonads
description: Comonads
-build-type: Custom
+build-type: Simple
extra-source-files:
.ghci
.gitignore
.travis.yml
--
1.7.10.4

View file

@ -1,19 +1,18 @@
From ddf49377d37c82575c1b0b712a476fa93fc00d6b Mon Sep 17 00:00:00 2001
From: Joey Hess <joey@kitenet.net>
Date: Thu, 18 Apr 2013 17:39:28 -0400
Subject: [PATCH] fixes for cross build
From 6cd7b7d3a8e38ada9b1e3989770525c63f9f1d7d Mon Sep 17 00:00:00 2001
From: androidbuilder <androidbuilder@example.com>
Date: Fri, 18 Oct 2013 23:10:16 +0000
Subject: [PATCH] cross build
---
distributive.cabal | 2 +-
src/Data/Distributive.hs | 2 --
2 files changed, 1 insertion(+), 3 deletions(-)
distributive.cabal | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/distributive.cabal b/distributive.cabal
index 66ac73c..5204755 100644
index 5d4ac69..82d7593 100644
--- a/distributive.cabal
+++ b/distributive.cabal
@@ -12,7 +12,7 @@ bug-reports: http://github.com/ekmett/distributive/issues
copyright: Copyright (C) 2011 Edward A. Kmett
copyright: Copyright (C) 2011-2013 Edward A. Kmett
synopsis: Haskell 98 Distributive functors -- Dual to Traversable
description: Haskell 98 Distributive functors -- Dual to Traversable
-build-type: Custom
@ -21,19 +20,6 @@ index 66ac73c..5204755 100644
extra-source-files:
.ghci
.travis.yml
diff --git a/src/Data/Distributive.hs b/src/Data/Distributive.hs
index 6f5613d..66eaed2 100644
--- a/src/Data/Distributive.hs
+++ b/src/Data/Distributive.hs
@@ -26,8 +26,6 @@ import Data.Functor.Identity
import Data.Functor.Product
import Data.Functor.Reverse
-{-# ANN module "ignore Use section" #-}
-
-- | This is the categorical dual of 'Traversable'. However, there appears
-- to be little benefit to allow the distribution via an arbitrary comonad
-- so we restrict ourselves to 'Functor'.
--
1.8.2.rc3
1.7.10.4

View file

@ -1,6 +1,6 @@
From 35c6718205e9d7f5e5fc44578ea6a9971beac151 Mon Sep 17 00:00:00 2001
From: foo <foo@bar>
Date: Sat, 21 Sep 2013 23:32:18 +0000
From 10da50b5eea1e615af1d3b242f422ad278c9f268 Mon Sep 17 00:00:00 2001
From: dummy <dummy@example.com>
Date: Fri, 18 Oct 2013 23:16:41 +0000
Subject: [PATCH] cross build
---
@ -8,18 +8,18 @@ Subject: [PATCH] cross build
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/entropy.cabal b/entropy.cabal
index 45e4705..17553d8 100644
index e69dec4..4fa3774 100644
--- a/entropy.cabal
+++ b/entropy.cabal
@@ -14,7 +14,7 @@ category: Data, Cryptography
homepage: https://github.com/TomMD/entropy
bug-reports: https://github.com/TomMD/entropy/issues
stability: stable
-build-type: Custom
+build-type: Simple
cabal-version: >= 1.6
tested-with: GHC == 6.12.1
data-files:
-build-type: Custom
+build-type: Simple
cabal-version: >=1.10
tested-with: GHC == 7.6.3
-- data-files:
--
1.7.10.4

View file

@ -1,7 +1,7 @@
From 3141355f14d6acb9382bebcf8723c411be5aa62f Mon Sep 17 00:00:00 2001
From: foo <foo@bar>
Date: Sun, 22 Sep 2013 00:31:39 +0000
Subject: [PATCH] various hacking to cross build
From 41706061810410cc38f602ccc9a4c9560502251f Mon Sep 17 00:00:00 2001
From: dummy <dummy@example.com>
Date: Sat, 19 Oct 2013 01:44:52 +0000
Subject: [PATCH] hackity
---
lens.cabal | 12 +-----------
@ -24,7 +24,7 @@ Subject: [PATCH] various hacking to cross build
17 files changed, 20 insertions(+), 74 deletions(-)
diff --git a/lens.cabal b/lens.cabal
index 2a94e1e..1f9a4b7 100644
index b25adf4..3e5c30c 100644
--- a/lens.cabal
+++ b/lens.cabal
@@ -10,7 +10,7 @@ stability: provisional
@ -33,10 +33,10 @@ index 2a94e1e..1f9a4b7 100644
copyright: Copyright (C) 2012-2013 Edward A. Kmett
-build-type: Custom
+build-type: Simple
tested-with: GHC == 7.0.4, GHC == 7.4.1, GHC == 7.4.2, GHC == 7.6.1, GHC == 7.7.20121213, GHC == 7.7.20130117
tested-with: GHC == 7.6.3
synopsis: Lenses, Folds and Traversals
description:
@@ -238,14 +238,12 @@ library
@@ -235,14 +235,12 @@ library
Control.Lens.Review
Control.Lens.Setter
Control.Lens.Simple
@ -51,7 +51,7 @@ index 2a94e1e..1f9a4b7 100644
Control.Parallel.Strategies.Lens
Control.Seq.Lens
Data.Array.Lens
@@ -269,12 +267,8 @@ library
@@ -266,12 +264,8 @@ library
Data.Typeable.Lens
Data.Vector.Lens
Data.Vector.Generic.Lens
@ -64,7 +64,7 @@ index 2a94e1e..1f9a4b7 100644
Numeric.Lens
if flag(safe)
@@ -373,7 +367,6 @@ test-suite doctests
@@ -370,7 +364,6 @@ test-suite doctests
deepseq,
doctest >= 0.9.1,
filepath,
@ -72,7 +72,7 @@ index 2a94e1e..1f9a4b7 100644
mtl,
nats,
parallel,
@@ -399,7 +392,6 @@ benchmark plated
@@ -396,7 +389,6 @@ benchmark plated
comonad,
criterion,
deepseq,
@ -80,7 +80,7 @@ index 2a94e1e..1f9a4b7 100644
lens,
transformers
@@ -434,7 +426,6 @@ benchmark unsafe
@@ -431,7 +423,6 @@ benchmark unsafe
comonads-fd,
criterion,
deepseq,
@ -88,7 +88,7 @@ index 2a94e1e..1f9a4b7 100644
lens,
transformers
@@ -451,6 +442,5 @@ benchmark zipper
@@ -448,6 +439,5 @@ benchmark zipper
comonads-fd,
criterion,
deepseq,
@ -96,7 +96,7 @@ index 2a94e1e..1f9a4b7 100644
lens,
transformers
diff --git a/src/Control/Exception/Lens.hs b/src/Control/Exception/Lens.hs
index 4bc3926..28f55be 100644
index 0619335..c97ad9b 100644
--- a/src/Control/Exception/Lens.hs
+++ b/src/Control/Exception/Lens.hs
@@ -112,7 +112,7 @@ import Prelude

View file

@ -0,0 +1,25 @@
From c1b166ad1dbed80f7eed7b9c1b2dc5c668eeb8fc Mon Sep 17 00:00:00 2001
From: androidbuilder <androidbuilder@example.com>
Date: Fri, 18 Oct 2013 23:28:56 +0000
Subject: [PATCH] cross build
---
stm-chans.cabal | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/stm-chans.cabal b/stm-chans.cabal
index 89d4780..2119a74 100644
--- a/stm-chans.cabal
+++ b/stm-chans.cabal
@@ -6,7 +6,7 @@
-- and source-repository:.
Cabal-Version: >= 1.6
-- We need a custom build in order to define __HADDOCK__
-Build-Type: Custom
+Build-Type: Simple
Name: stm-chans
Version: 3.0.0
--
1.7.10.4

View file

@ -1,29 +1,12 @@
From af259b521574b734a7a0b1b3e9e6868df33ebdb9 Mon Sep 17 00:00:00 2001
From: foo <foo@bar>
Date: Sat, 21 Sep 2013 23:47:47 +0000
Subject: [PATCH] hack to build with new ghc
From b0a79f4f98188ba5d43b7e3912b36d34d099ab65 Mon Sep 17 00:00:00 2001
From: dummy <dummy@example.com>
Date: Fri, 18 Oct 2013 23:20:35 +0000
Subject: [PATCH] cross build
---
Data/Vector.hs | 1 -
Data/Vector/Fusion/Stream/Monadic.hs | 1 -
Data/Vector/Generic.hs | 10 ++--------
Data/Vector/Primitive.hs | 1 -
Data/Vector/Storable.hs | 1 -
Data/Vector/Unboxed/Base.hs | 15 +--------------
6 files changed, 3 insertions(+), 26 deletions(-)
1 file changed, 1 deletion(-)
diff --git a/Data/Vector.hs b/Data/Vector.hs
index 138b2db..92c4387 100644
--- a/Data/Vector.hs
+++ b/Data/Vector.hs
@@ -215,7 +215,6 @@ instance Data a => Data (Vector a) where
toConstr _ = error "toConstr"
gunfold _ _ = error "gunfold"
dataTypeOf _ = G.mkType "Data.Vector.Vector"
- dataCast1 = G.dataCast
type instance G.Mutable Vector = MVector
diff --git a/Data/Vector/Fusion/Stream/Monadic.hs b/Data/Vector/Fusion/Stream/Monadic.hs
index 51fec75..b089b3d 100644
--- a/Data/Vector/Fusion/Stream/Monadic.hs
@ -36,95 +19,6 @@ index 51fec75..b089b3d 100644
#endif
emptyStream :: String
diff --git a/Data/Vector/Generic.hs b/Data/Vector/Generic.hs
index 78f7260..f4ea80a 100644
--- a/Data/Vector/Generic.hs
+++ b/Data/Vector/Generic.hs
@@ -157,7 +157,7 @@ module Data.Vector.Generic (
showsPrec, readPrec,
-- ** @Data@ and @Typeable@
- gfoldl, dataCast, mkType
+ gfoldl, mkType
) where
import Data.Vector.Generic.Base
@@ -194,7 +194,7 @@ import Prelude hiding ( length, null,
showsPrec )
import qualified Text.Read as Read
-import Data.Typeable ( Typeable1, gcast1 )
+import Data.Typeable ( gcast1 )
#include "vector.h"
@@ -2019,9 +2019,3 @@ gfoldl f z v = z fromList `f` toList v
mkType :: String -> DataType
{-# INLINE mkType #-}
mkType = mkNoRepType
-
-dataCast :: (Vector v a, Data a, Typeable1 v, Typeable1 t)
- => (forall d. Data d => c (t d)) -> Maybe (c (v a))
-{-# INLINE dataCast #-}
-dataCast f = gcast1 f
-
diff --git a/Data/Vector/Primitive.hs b/Data/Vector/Primitive.hs
index 5f59bae..06e84c3 100644
--- a/Data/Vector/Primitive.hs
+++ b/Data/Vector/Primitive.hs
@@ -188,7 +188,6 @@ instance (Data a, Prim a) => Data (Vector a) where
toConstr _ = error "toConstr"
gunfold _ _ = error "gunfold"
dataTypeOf _ = G.mkType "Data.Vector.Primitive.Vector"
- dataCast1 = G.dataCast
type instance G.Mutable Vector = MVector
diff --git a/Data/Vector/Storable.hs b/Data/Vector/Storable.hs
index f9928e4..a17e3d6 100644
--- a/Data/Vector/Storable.hs
+++ b/Data/Vector/Storable.hs
@@ -194,7 +194,6 @@ instance (Data a, Storable a) => Data (Vector a) where
toConstr _ = error "toConstr"
gunfold _ _ = error "gunfold"
dataTypeOf _ = G.mkType "Data.Vector.Storable.Vector"
- dataCast1 = G.dataCast
type instance G.Mutable Vector = MVector
diff --git a/Data/Vector/Unboxed/Base.hs b/Data/Vector/Unboxed/Base.hs
index 00350cb..c13ea20 100644
--- a/Data/Vector/Unboxed/Base.hs
+++ b/Data/Vector/Unboxed/Base.hs
@@ -31,7 +31,7 @@ import Data.Word ( Word, Word8, Word16, Word32, Word64 )
import Data.Int ( Int8, Int16, Int32, Int64 )
import Data.Complex
-import Data.Typeable ( Typeable1(..), Typeable2(..), mkTyConApp,
+import Data.Typeable ( mkTyConApp,
#if MIN_VERSION_base(4,4,0)
mkTyCon3
#else
@@ -65,19 +65,6 @@ vectorTyCon = mkTyCon3 "vector"
vectorTyCon m s = mkTyCon $ m ++ "." ++ s
#endif
-instance Typeable1 Vector where
- typeOf1 _ = mkTyConApp (vectorTyCon "Data.Vector.Unboxed" "Vector") []
-
-instance Typeable2 MVector where
- typeOf2 _ = mkTyConApp (vectorTyCon "Data.Vector.Unboxed.Mutable" "MVector") []
-
-instance (Data a, Unbox a) => Data (Vector a) where
- gfoldl = G.gfoldl
- toConstr _ = error "toConstr"
- gunfold _ _ = error "gunfold"
- dataTypeOf _ = G.mkType "Data.Vector.Unboxed.Vector"
- dataCast1 = G.dataCast
-
-- ----
-- Unit
-- ----
--
1.7.10.4

View file

@ -1,18 +1,15 @@
From 9e15d4af1f53c76a402ec1782e0306a4bee7eec7 Mon Sep 17 00:00:00 2001
From: foo <foo@bar>
Date: Sun, 22 Sep 2013 04:03:56 +0000
Subject: [PATCH] expad TH
From 7583457fb410d07f480a2aa7d6c2f174324b3592 Mon Sep 17 00:00:00 2001
From: dummy <dummy@example.com>
Date: Sat, 19 Oct 2013 02:03:18 +0000
Subject: [PATCH] hackity
used EvilSplicer
Has to remove some logger TH splices which didn't come out.
---
Yesod/Core.hs | 2 -
Yesod/Core/Class/Yesod.hs | 247 ++++++++++++++++++++++++++++++--------------
Yesod/Core/Dispatch.hs | 7 --
Yesod/Core/Handler.hs | 24 ++---
Yesod/Core/Internal/Run.hs | 2 -
Yesod/Core/Widget.hs | 2 +
6 files changed, 181 insertions(+), 103 deletions(-)
5 files changed, 179 insertions(+), 103 deletions(-)
diff --git a/Yesod/Core.hs b/Yesod/Core.hs
index 12e59d5..f1ff21c 100644
@ -409,19 +406,6 @@ index 35f1d3f..8b92e99 100644
return $ YRPlain
H.status500
[]
diff --git a/Yesod/Core/Widget.hs b/Yesod/Core/Widget.hs
index be97764..874f018 100644
--- a/Yesod/Core/Widget.hs
+++ b/Yesod/Core/Widget.hs
@@ -47,6 +47,8 @@ module Yesod.Core.Widget
, handlerToWidget
-- * Internal
, whamletFileWithSettings
+ -- used by TH
+ , asWidgetT
) where
import Data.Monoid
--
1.7.10.4

View file

@ -1,23 +1,37 @@
From 3a17bd1223fcd7a750bc0e5e94ec5b97ad2e573b Mon Sep 17 00:00:00 2001
From: foo <foo@bar>
Date: Sun, 22 Sep 2013 05:14:21 +0000
From c5b0db193fd6e9fd6be22891ae988babbfac3ff0 Mon Sep 17 00:00:00 2001
From: dummy <dummy@example.com>
Date: Sat, 19 Oct 2013 02:14:38 +0000
Subject: [PATCH] spliced TH
Used EvilSplicer. Needed a few syntax fixes, and a lot of added imports.
Removed some things I don't need, rather than re-splicing to handle a new version.
---
Yesod/Form/Fields.hs | 747 ++++++++++++++++++++++++++++++++++++-----------
Yesod/Form/Fields.hs | 771 +++++++++++++++++++++++++++++++++++------------
Yesod/Form/Functions.hs | 237 ++++++++++++---
Yesod/Form/Jquery.hs | 125 ++++++--
Yesod/Form/MassInput.hs | 233 ++++++++++++---
Yesod/Form/MassInput.hs | 233 +++++++++++---
Yesod/Form/Nic.hs | 61 +++-
yesod-form.cabal | 1 +
6 files changed, 1123 insertions(+), 281 deletions(-)
6 files changed, 1123 insertions(+), 305 deletions(-)
diff --git a/Yesod/Form/Fields.hs b/Yesod/Form/Fields.hs
index 5c16d7e..edd9715 100644
index b8109df..9bde340 100644
--- a/Yesod/Form/Fields.hs
+++ b/Yesod/Form/Fields.hs
@@ -41,8 +41,6 @@ module Yesod.Form.Fields
@@ -1,4 +1,3 @@
-{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
@@ -36,15 +35,11 @@ module Yesod.Form.Fields
, selectFieldList
, radioField
, radioFieldList
- , checkboxesFieldList
- , checkboxesField
, multiSelectField
, multiSelectFieldList
, Option (..)
, OptionList (..)
, mkOptionList
@ -26,7 +40,7 @@ index 5c16d7e..edd9715 100644
, optionsPairs
, optionsEnum
) where
@@ -68,6 +66,15 @@ import Text.HTML.SanitizeXSS (sanitizeBalance)
@@ -70,6 +65,15 @@ import Text.HTML.SanitizeXSS (sanitizeBalance)
import Control.Monad (when, unless)
import Data.Maybe (listToMaybe, fromMaybe)
@ -42,7 +56,7 @@ index 5c16d7e..edd9715 100644
import qualified Blaze.ByteString.Builder.Html.Utf8 as B
import Blaze.ByteString.Builder (writeByteString, toLazyByteString)
import Blaze.ByteString.Builder.Internal.Write (fromWriteList)
@@ -80,14 +87,12 @@ import Data.Text (Text, unpack, pack)
@@ -82,14 +86,12 @@ import Data.Text (Text, unpack, pack)
import qualified Data.Text.Read
import qualified Data.Map as Map
@ -57,7 +71,7 @@ index 5c16d7e..edd9715 100644
defaultFormMessage :: FormMessage -> Text
defaultFormMessage = englishFormMessage
@@ -100,10 +105,24 @@ intField = Field
@@ -102,10 +104,24 @@ intField = Field
Right (a, "") -> Right a
_ -> Left $ MsgInvalidInteger s
@ -86,7 +100,7 @@ index 5c16d7e..edd9715 100644
, fieldEnctype = UrlEncoded
}
where
@@ -117,10 +136,24 @@ doubleField = Field
@@ -119,10 +135,24 @@ doubleField = Field
Right (a, "") -> Right a
_ -> Left $ MsgInvalidNumber s
@ -115,7 +129,7 @@ index 5c16d7e..edd9715 100644
, fieldEnctype = UrlEncoded
}
where showVal = either id (pack . show)
@@ -128,10 +161,24 @@ $newline never
@@ -130,10 +160,24 @@ $newline never
dayField :: Monad m => RenderMessage (HandlerSite m) FormMessage => Field m Day
dayField = Field
{ fieldParse = parseHelper $ parseDate . unpack
@ -144,7 +158,7 @@ index 5c16d7e..edd9715 100644
, fieldEnctype = UrlEncoded
}
where showVal = either id (pack . show)
@@ -139,10 +186,23 @@ $newline never
@@ -141,10 +185,23 @@ $newline never
timeField :: Monad m => RenderMessage (HandlerSite m) FormMessage => Field m TimeOfDay
timeField = Field
{ fieldParse = parseHelper parseTime
@ -172,7 +186,7 @@ index 5c16d7e..edd9715 100644
, fieldEnctype = UrlEncoded
}
where
@@ -155,10 +215,18 @@ $newline never
@@ -157,10 +214,18 @@ $newline never
htmlField :: Monad m => RenderMessage (HandlerSite m) FormMessage => Field m Html
htmlField = Field
{ fieldParse = parseHelper $ Right . preEscapedText . sanitizeBalance
@ -195,7 +209,7 @@ index 5c16d7e..edd9715 100644
, fieldEnctype = UrlEncoded
}
where showVal = either id (pack . renderHtml)
@@ -166,7 +234,7 @@ $newline never
@@ -168,7 +233,7 @@ $newline never
-- | A newtype wrapper around a 'Text' that converts newlines to HTML
-- br-tags.
newtype Textarea = Textarea { unTextarea :: Text }
@ -204,7 +218,7 @@ index 5c16d7e..edd9715 100644
instance ToHtml Textarea where
toHtml =
unsafeByteString
@@ -184,10 +252,18 @@ instance ToHtml Textarea where
@@ -186,10 +251,18 @@ instance ToHtml Textarea where
textareaField :: Monad m => RenderMessage (HandlerSite m) FormMessage => Field m Textarea
textareaField = Field
{ fieldParse = parseHelper $ Right . Textarea
@ -227,7 +241,7 @@ index 5c16d7e..edd9715 100644
, fieldEnctype = UrlEncoded
}
@@ -195,10 +271,19 @@ hiddenField :: (Monad m, PathPiece p, RenderMessage (HandlerSite m) FormMessage)
@@ -197,10 +270,19 @@ hiddenField :: (Monad m, PathPiece p, RenderMessage (HandlerSite m) FormMessage)
=> Field m p
hiddenField = Field
{ fieldParse = parseHelper $ maybe (Left MsgValueRequired) Right . fromPathPiece
@ -251,7 +265,7 @@ index 5c16d7e..edd9715 100644
, fieldEnctype = UrlEncoded
}
@@ -206,20 +291,55 @@ textField :: Monad m => RenderMessage (HandlerSite m) FormMessage => Field m Tex
@@ -208,20 +290,55 @@ textField :: Monad m => RenderMessage (HandlerSite m) FormMessage => Field m Tex
textField = Field
{ fieldParse = parseHelper $ Right
, fieldView = \theId name attrs val isReq ->
@ -315,7 +329,7 @@ index 5c16d7e..edd9715 100644
, fieldEnctype = UrlEncoded
}
@@ -291,10 +411,24 @@ emailField = Field
@@ -293,10 +410,24 @@ emailField = Field
case Email.canonicalizeEmail $ encodeUtf8 s of
Just e -> Right $ decodeUtf8With lenientDecode e
Nothing -> Left $ MsgInvalidEmail s
@ -344,7 +358,7 @@ index 5c16d7e..edd9715 100644
, fieldEnctype = UrlEncoded
}
@@ -303,20 +437,78 @@ searchField :: Monad m => RenderMessage (HandlerSite m) FormMessage => AutoFocus
@@ -305,20 +436,78 @@ searchField :: Monad m => RenderMessage (HandlerSite m) FormMessage => AutoFocus
searchField autoFocus = Field
{ fieldParse = parseHelper Right
, fieldView = \theId name attrs val isReq -> do
@ -435,7 +449,7 @@ index 5c16d7e..edd9715 100644
, fieldEnctype = UrlEncoded
}
@@ -327,7 +519,30 @@ urlField = Field
@@ -329,7 +518,30 @@ urlField = Field
Nothing -> Left $ MsgInvalidUrl s
Just _ -> Right s
, fieldView = \theId name attrs val isReq ->
@ -467,7 +481,7 @@ index 5c16d7e..edd9715 100644
, fieldEnctype = UrlEncoded
}
@@ -340,18 +555,56 @@ selectField :: (Eq a, RenderMessage site FormMessage)
@@ -342,18 +554,56 @@ selectField :: (Eq a, RenderMessage site FormMessage)
=> HandlerT site IO (OptionList a)
-> Field (HandlerT site IO) a
selectField = selectFieldHelper
@ -536,7 +550,7 @@ index 5c16d7e..edd9715 100644
multiSelectFieldList :: (Eq a, RenderMessage site FormMessage, RenderMessage site msg)
=> [(msg, a)]
@@ -374,11 +627,48 @@ multiSelectField ioptlist =
@@ -376,11 +626,48 @@ multiSelectField ioptlist =
view theId name attrs val isReq = do
opts <- fmap olOptions $ handlerToWidget ioptlist
let selOpts = map (id &&& (optselected val)) opts
@ -590,7 +604,33 @@ index 5c16d7e..edd9715 100644
where
optselected (Left _) _ = False
optselected (Right vals) opt = (optionInternalValue opt) `elem` vals
@@ -392,41 +682,167 @@ radioField :: (Eq a, RenderMessage site FormMessage)
@@ -390,67 +677,172 @@ radioFieldList :: (Eq a, RenderMessage site FormMessage, RenderMessage site msg)
-> Field (HandlerT site IO) a
radioFieldList = radioField . optionsPairs
-checkboxesFieldList :: (Eq a, RenderMessage site FormMessage, RenderMessage site msg) => [(msg, a)]
- -> Field (HandlerT site IO) [a]
-checkboxesFieldList = checkboxesField . optionsPairs
-
-checkboxesField :: (Eq a, RenderMessage site FormMessage)
- => HandlerT site IO (OptionList a)
- -> Field (HandlerT site IO) [a]
-checkboxesField ioptlist = (multiSelectField ioptlist)
- { fieldView =
- \theId name attrs val isReq -> do
- opts <- fmap olOptions $ handlerToWidget ioptlist
- let optselected (Left _) _ = False
- optselected (Right vals) opt = (optionInternalValue opt) `elem` vals
- [whamlet|
- <span ##{theId}>
- $forall opt <- opts
- <label>
- <input type=checkbox name=#{name} value=#{optionExternalValue opt} *{attrs} :optselected val opt:checked>
- #{optionDisplay opt}
- |]
- }
radioField :: (Eq a, RenderMessage site FormMessage)
=> HandlerT site IO (OptionList a)
-> Field (HandlerT site IO) a
radioField = selectFieldHelper
@ -695,10 +735,6 @@ index 5c16d7e..edd9715 100644
- $if not isReq
- <input id=#{theId}-none *{attrs} type=radio name=#{name} value=none checked>
- <label for=#{theId}-none>_{MsgSelectNone}
-
-
-<input id=#{theId}-yes *{attrs} type=radio name=#{name} value=yes :showVal id val:checked>
-<label for=#{theId}-yes>_{MsgBoolYes}
+ , fieldView = \theId name attrs val isReq -> do { Text.Hamlet.condH
+ [(not isReq,
+ do { (Yesod.Core.Widget.asWidgetT . toWidget)
@ -782,13 +818,17 @@ index 5c16d7e..edd9715 100644
+ (Yesod.Core.Widget.asWidgetT . toWidget)
+ ((Text.Blaze.Internal.preEscapedText . pack) "</label>") }
-
-<input id=#{theId}-yes *{attrs} type=radio name=#{name} value=yes :showVal id val:checked>
-<label for=#{theId}-yes>_{MsgBoolYes}
-
-<input id=#{theId}-no *{attrs} type=radio name=#{name} value=no :showVal not val:checked>
-<label for=#{theId}-no>_{MsgBoolNo}
-|]
, fieldEnctype = UrlEncoded
}
where
@@ -452,10 +868,25 @@ $newline never
@@ -476,10 +868,25 @@ $newline never
checkBoxField :: Monad m => RenderMessage (HandlerSite m) FormMessage => Field m Bool
checkBoxField = Field
{ fieldParse = \e _ -> return $ checkBoxParser e
@ -818,7 +858,7 @@ index 5c16d7e..edd9715 100644
, fieldEnctype = UrlEncoded
}
@@ -499,49 +930,7 @@ optionsPairs opts = do
@@ -523,49 +930,7 @@ optionsPairs opts = do
optionsEnum :: (MonadHandler m, Show a, Enum a, Bounded a) => m (OptionList a)
optionsEnum = optionsPairs $ map (\x -> (pack $ show x, x)) [minBound..maxBound]
@ -869,7 +909,7 @@ index 5c16d7e..edd9715 100644
selectFieldHelper
:: (Eq a, RenderMessage site FormMessage)
@@ -585,9 +974,21 @@ fileField = Field
@@ -609,9 +974,21 @@ fileField = Field
case files of
[] -> Right Nothing
file:_ -> Right $ Just file
@ -894,7 +934,7 @@ index 5c16d7e..edd9715 100644
, fieldEnctype = Multipart
}
@@ -614,10 +1015,20 @@ fileAFormReq fs = AForm $ \(site, langs) menvs ints -> do
@@ -638,10 +1015,20 @@ fileAFormReq fs = AForm $ \(site, langs) menvs ints -> do
{ fvLabel = toHtml $ renderMessage site langs $ fsLabel fs
, fvTooltip = fmap (toHtml . renderMessage site langs) $ fsTooltip fs
, fvId = id'
@ -919,7 +959,7 @@ index 5c16d7e..edd9715 100644
, fvErrors = errs
, fvRequired = True
}
@@ -646,10 +1057,20 @@ fileAFormOpt fs = AForm $ \(master, langs) menvs ints -> do
@@ -670,10 +1057,20 @@ fileAFormOpt fs = AForm $ \(master, langs) menvs ints -> do
{ fvLabel = toHtml $ renderMessage master langs $ fsLabel fs
, fvTooltip = fmap (toHtml . renderMessage master langs) $ fsTooltip fs
, fvId = id'
@ -1730,7 +1770,7 @@ index 2862678..7b49b1a 100644
}
where
diff --git a/yesod-form.cabal b/yesod-form.cabal
index f6ebbe0..46e3dd7 100644
index afd2de5..49fd684 100644
--- a/yesod-form.cabal
+++ b/yesod-form.cabal
@@ -19,6 +19,7 @@ library