git.iko.soy/typeable/xml-isogen
on master help sign in
Add orphan ToXML instance for Scientific (#23)

commit916e2fc6af037ecc3c8fdbd403c72e9f84778f68 authorYuras <shumovichy@gmail.com> dateTue 11 Feb 2020, 15:14 (7 years ago) parentaa1329c
3 files changed+12
src/Data/THGen/Orphans.hs+9 src/Data/THGen/XML.hs+1 xml-isogen.cabal+2
src/Data/THGen/Orphans.hsnew file+9
@@ -0,0 +1,9 @@
1+module Data.THGen.Orphans
2+where
3+
4+import qualified Data.Text as Text
5+import Data.Scientific
6+import Text.XML.Writer
7+
8+instance ToXML Scientific where
9+ toXML = content . Text.pack . formatScientific Fixed Nothing
src/Data/THGen/XML.hs+1
@@ -127,6 +127,7 @@ module Data.THGen.XML
127127 ) where
128128
129129import Data.THGen.Enum
130+import Data.THGen.Orphans ()
130131import Data.THGen.XML.Internal
131132import Data.Text
132133import qualified Prelude as P
xml-isogen.cabal+2
@@ -33,6 +33,7 @@ library
3333 , Data.THGen.XML.Internal
3434 , Text.XML.ParentAttributes
3535 other-modules: Data.THGen.Compat
36+ , Data.THGen.Orphans
3637 , Text.XML.DOM.Parser.Internal.Content
3738 build-depends: QuickCheck >= 2.8
3839 , base >=4.8 && <5
@@ -45,6 +46,7 @@ library
4546 , text >= 1.2
4647 , xml-conduit >= 1.0
4748 , xml-conduit-writer >= 0.1
49+ , scientific
4850
4951 hs-source-dirs: src
5052