Commits

Doug Burke  committed 2ec98b0

Support network 2.4.*

  • Participants
  • Parent commits 7eae027

Comments (0)

Files changed (4)

+0.8.0.3:
+
+  Remove hashtable restriction (rewrite tests)
+
+  Updates to support network version 2.4.0.0: the package now provides
+  an Ord instance for Network.URI so Network.URI.Ord is now a no-op if
+  network >= 2.4.0.0 is installed; fix up code to handle change to
+  the API of relativeTo.
+
 0.8.0.2:
 
   Restrict hashable to < 1.1.2.4 to try and avoid test

File src/Network/URI/Ord.hs

+{-# LANGUAGE CPP #-}
+
 --------------------------------------------------------------------------------
 --  See end of this file for licence information.
 --------------------------------------------------------------------------------
 --
 --  Maintainer  :  Douglas Burke
 --  Stability   :  experimental
---  Portability :  H98
+--  Portability :  CPP
 --
 --  Provide an ordering for URIs (that is, an 'Ord' instance for
 --  'URI').
 --  and no attempt is made to decode percent-encoded values (i.e.
 --  the comparison does /not/ use a canonical or normalized form).
 --
+--  For @network@ version @2.4.0.0@ and higher, this module is a no-op,
+--  since 'Network.URI' now defines these instances.
+--
 --------------------------------------------------------------------------------
 
 module Network.URI.Ord () where
 
+#if MIN_VERSION_network(2,4,0)
+
+#else
+
 import Network.URI (URI(..), URIAuth(..))
 
 -- NOTE: we do not say compare = comparing show for the URI
     URIAuth ui1 rn1 p1 `compare` URIAuth ui2 rn2 p2 =
         (ui1,rn1,p1) `compare` (ui2,rn2,p2)
 
+#endif
+
 --------------------------------------------------------------------------------
 --
 --  Copyright (c) 2012 Douglas Burke

File src/Swish/RDF/Parser/Utils.hs

+{-# LANGUAGE CPP #-}
 {-# LANGUAGE OverloadedStrings #-}
+
 --------------------------------------------------------------------------------
 --  See end of this file for licence information.
 --------------------------------------------------------------------------------
 --
 --  Maintainer  :  Douglas Burke
 --  Stability   :  experimental
---  Portability :  OverloadedStrings
+--  Portability :  CPP, OverloadedStrings
 --
 --  Support for the RDF Parsing modules.
 --
 -- | Append the two URIs. Should probably be moved
 --   out of RDFParser. It is also just a thin wrapper around
 --   `Network.URI.relativeTo`.
+--
+--  Apparently, @relativeTo@ always returns @Just@ (at least
+--  prior to version @2.4.0.0@ of @network), so we do not
+--  expect this to ever fail (return `Left`).
+--
 appendURIs ::
   URI     -- ^ The base URI
   -> URI  -- ^ The URI to append (it can be an absolute URI).
   -> Either String URI
+#if MIN_VERSION_network(2,4,0)
+appendURIs base uri =
+  case uriScheme uri of
+    "" -> Right $ uri `relativeTo` base
+    _  -> Right uri
+	   
+#else
 appendURIs base uri =
   case uriScheme uri of
     "" -> case uri `relativeTo` base of
           Just out -> Right out
           _ -> Left $ "Unable to append <" ++ show uri ++ "> to base=<" ++ show base ++ ">"
     _  -> Right uri
+
+#endif
   
 -- | Type for special name lookup table
 type SpecialMap = M.Map String ScopedName
   .
   * Fix up the tests so that they pass with @hashable-1.1.2.5@.
   .
+  * Update to support @network-2.4.0.0@: @Network.URI.Ord@ is now a no-op
+  since the network package provides the instance; fix to change in API
+  of @relativeTo@.
+  .
   Changes in version @0.8.0.2@:
   .
   * Restrict @hashable@ since tests fail with @1.1.2.5@
       filepath >= 1.1 && < 1.4,
       hashable == 1.1.*,
       mtl >= 2 && < 3,
-      network >= 2.2 && < 2.4,
-      -- network 2.4 has been released
+      network >= 2.2 && < 2.5,
       old-locale == 1.0.*, 
       polyparse >= 1.6 && < 1.9,
       semigroups >= 0.5 && < 0.9,