Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

more doctest.

  • Loading branch information...
commit 2f93dece4a3b62383badc19b0177f8e631091143 1 parent ca30471
@kazu-yamamoto authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 Data/IP/RouteTable/Internal.hs
View
5 Data/IP/RouteTable/Internal.hs
@@ -89,6 +89,9 @@ data IPRTable k a =
{-|
The 'empty' function returns an empty IP routing table.
+
+>>> (empty :: IPRTable IPv4 ()) == fromList []
+True
-}
empty :: Routable k => IPRTable k a
empty = Nil
@@ -147,7 +150,7 @@ isLeft adr = isZero (addr adr)
The 'delete' function deletes a value by a key of 'AddrRange' from 'IPRTable'
and returns a new 'IPRTable'.
->>> delete "127.0.0.1" (insert ("127.0.0.1" :: AddrRange IPv4) () empty) == empty
+>>> delete "127.0.0.1" (insert "127.0.0.1" () empty) == (empty :: IPRTable IPv4 ())
True
-}
delete :: (Routable k) => AddrRange k -> IPRTable k a -> IPRTable k a
Please sign in to comment.
Something went wrong with that request. Please try again.