From 571f280291250a89975f2d2f1a0d6b92ec1573b8 Mon Sep 17 00:00:00 2001 From: Stuart Popejoy Date: Sat, 20 Jan 2024 11:34:56 -0500 Subject: [PATCH] get building --- fadno-xml.cabal | 4 ++-- src/Fadno/Xml/Codegen.hs | 1 + src/Fadno/Xml/ParseXsd.hs | 10 ++++++---- src/Fadno/Xml/XParse.hs | 1 + src/Fadno/Xml/XParser.hs | 1 + stack.yaml | 10 ---------- 6 files changed, 11 insertions(+), 16 deletions(-) delete mode 100644 stack.yaml diff --git a/fadno-xml.cabal b/fadno-xml.cabal index 6e6a475..c95755d 100644 --- a/fadno-xml.cabal +++ b/fadno-xml.cabal @@ -1,5 +1,5 @@ name: fadno-xml -version: 1.2 +version: 1.2.1 synopsis: XML/XSD combinators/schemas/codegen description: Library for generating code from XML schema files, with @@ -40,7 +40,7 @@ library -- other-modules: -- other-extensions: build-depends: Decimal >= 0.4 - , base >= 4.9 && < 4.15 + , base >= 4.9 && < 4.20 , containers >= 0.5 , lens >= 4.15 , mtl >= 2.2 diff --git a/src/Fadno/Xml/Codegen.hs b/src/Fadno/Xml/Codegen.hs index 565018a..c51e5c3 100644 --- a/src/Fadno/Xml/Codegen.hs +++ b/src/Fadno/Xml/Codegen.hs @@ -21,6 +21,7 @@ module Fadno.Xml.Codegen import Fadno.Xml.EmitTypes import Fadno.Xml.ParseXsd import Control.Lens hiding (Choice,element,elements) +import Control.Monad import Control.Monad.State.Strict import Control.Monad.Reader import qualified Data.Map.Strict as M diff --git a/src/Fadno/Xml/ParseXsd.hs b/src/Fadno/Xml/ParseXsd.hs index 0c95faa..b95bd4c 100644 --- a/src/Fadno/Xml/ParseXsd.hs +++ b/src/Fadno/Xml/ParseXsd.hs @@ -366,10 +366,12 @@ instance Resolvable Element where instance Resolvable (Ref (Either ComplexType SimpleType)) where - resolve sch (Unresolved f) = Resolved f $ either error id - ((Left <$> searchRefTarget "Either-ComplexType" complexTypes f sch) - <|> - (Right <$> searchRefTarget "Either-SimpleType" simpleTypes f sch)) + resolve sch (Unresolved f) = Resolved f $ + case searchRefTarget "Either-ComplexType" complexTypes f sch of + Right r -> Left r + Left {} -> case searchRefTarget "Either-SimpleType" simpleTypes f sch of + Right r -> Right r + Left e -> error e resolve _ r = r diff --git a/src/Fadno/Xml/XParse.hs b/src/Fadno/Xml/XParse.hs index 020a162..207a405 100644 --- a/src/Fadno/Xml/XParse.hs +++ b/src/Fadno/Xml/XParse.hs @@ -18,6 +18,7 @@ import qualified Text.XML.Light as X import qualified Text.XML.Light.Cursor as C import Control.Exception +import Control.Monad import Control.Monad.State.Strict hiding (sequence) import Control.Monad.Except hiding (sequence) import Data.Either diff --git a/src/Fadno/Xml/XParser.hs b/src/Fadno/Xml/XParser.hs index 5944ab0..04f9634 100644 --- a/src/Fadno/Xml/XParser.hs +++ b/src/Fadno/Xml/XParser.hs @@ -22,6 +22,7 @@ module Fadno.Xml.XParser {-# DEPRECATED "in favor of XParse" #-} import qualified Text.XML.Light as X import Control.Exception +import Control.Monad import Control.Monad.State.Strict hiding (sequence) import Control.Monad.Except hiding (sequence) import Data.Either diff --git a/stack.yaml b/stack.yaml deleted file mode 100644 index 30fee67..0000000 --- a/stack.yaml +++ /dev/null @@ -1,10 +0,0 @@ -resolver: lts-14.20 - -packages: -- '.' - -extra-deps: [] - -flags: {} - -extra-package-dbs: []