Network.URI bug? (2.2.0.0)

Hi all,

I'm having a bit of difficulty with Network.URI -- unless I
misunderstand the documentation, the attached demo program is supposed
to produce:

   http://localhost:9000
   http://localhost:9000/d1
   http://localhost:9000/d1/d2

but it produces

   http://localhost:9000
   http://localhost:9000/d1
   http://localhost:9000/d2

Is this some sort of bug or am I not understanding the documentation
correctly?

Cheers,

--

-- 
Bardur Arantsson
<bardurREMOVE <at> THISscientician.net>

The thing that's depressing about tennis is that no matter how
good I get, I'll never be as good as a wall.
                                                    Mitch Hedberg
Attachment (Test.hs): text/x-haskell, 340 bytes
(Continue reading)

Re: Network.URI bug? (2.2.0.0)

Bárður Árantsson wrote:
> Hi all,
> 
[--snip--]

*Smacks forehead*

Apparently you absolutely need a trailing slash on the relative URIs.
So

  base = fromJust $ parseURI "http://localhost:9000"
  d1 = fromJust $ parseRelativeReference "d1/"
  d2 = fromJust $ parseRelativeReference "d2/"

  ...
  let u = base
  let u1 = fromJust $ d1 `relativeTo` base
  let u2 = fromJust $ d2 `relativeTo` u1

works as expected.

Apologies for the noise.

Cheers,

--

-- 
Bardur Arantsson
<bardurREMOVE <at> THISscientician.net>

- You can't expect to wield supreme executive power just because
(Continue reading)


Gmane