kazu-yamamoto / iproute Goto Github PK
View Code? Open in Web Editor NEWIP Routing Table in Haskell
Home Page: http://www.mew.org/~kazu/proj/iproute/
License: BSD 3-Clause "New" or "Revised" License
IP Routing Table in Haskell
Home Page: http://www.mew.org/~kazu/proj/iproute/
License: BSD 3-Clause "New" or "Revised" License
1st of all thanks for creating and sharing this library!
My concern is about the lack of some "common" instances for some of the types. Examples:
What about support these ones:
FromJSON
and ToJSON
from aeson
Hashable
from hashable
package
Serialize
from cereal
package
Arbitrary
from Quickcheck
(I saw you have them for the test
module)
ex.
instance Arbitrary (AddrRange IPv4) where
arbitrary = arbitraryIP arbitrary 32
ToADTArbitrary
from quickcheck-arbitrary-adt
I'm assuming maybe you decided to not implement them (or export them) in order to keep library number of dependencies low. If is that the reason, do you think some extra lib called iproute-instances
(or any other name) could be created? I mean, it would be really helpful in order to avoid wrappers or proxy for types like IPRange
, IP
, etc.
Either way, if you decide to implement the instances in the library or create this new one, feel free to ping me if you want or need some collaboration.
We have recently encountered a need for something like that. If it was implemented, would you accept the PR?
I had noticed that building v1.7.9 with GHC 9.0.1 resulted in a build failure, so I used my Hackage Trustee powers to create a Hackage revision that disallows this build plan: http://hackage.haskell.org/package/iproute-1.7.9/revisions/
Currently various from...
/to...
functions work with just [Int]
. I'd suggest to:
Word8
for to/fromIPv4
and to/fromIPv6b
, and Word16
for to/fromIPv6
.from/toIPv6
and from/toIPv4
that take/return 4-tuples and 8-tuples instead of lists. This is safer, and it's still possible to efficiently work with such tuples by wrapping them for example with NTup4
/ NTup8
which provide Traversable
, Applicative
etc.I'll be happy to contribute, if we agree on this.
I am trying to solve a problem of comparing IPv4 with IPv4-embedded-in-IPv6 address. I am not sure if the Eq Class should say IPv4 "127.0.0.1" == IPv6 "::ffff:127.0.0.1"
(maybe it should? - in that case it should work similarly with all the operators?)
However I would need a way to at least convert it. This is possible for IP type, but it is impossible for the AddrRange, as the internals of the type are not publicly accessible. Would it be possible to add a function that would be like AddrRange a -> (a, Int)
?
The dig
parser is subject to Int
overflow, which causes some invalid strings to parse successfully.
Example:
λ: import Data.IP (IPv4)
λ: print @IPv4 $ read "127.0.0.18446744073709551617"
127.0.0.1
I do not think that this issue is significant, but I figure that I should at least report it.
Hi
When I wanted to install yesod-bin I had got this error
Resolving dependencies...
Configuring iproute-1.4.0...
Building iproute-1.4.0...
Preprocessing library iproute-1.4.0...
[1 of 7] Compiling Data.IP.Addr ( Data/IP/Addr.hs, dist/build/Data/IP/Addr.o )
[2 of 7] Compiling Data.IP.Mask ( Data/IP/Mask.hs, dist/build/Data/IP/Mask.o )
[3 of 7] Compiling Data.IP.Range ( Data/IP/Range.hs, dist/build/Data/IP/Range.o )
[4 of 7] Compiling Data.IP.Op ( Data/IP/Op.hs, dist/build/Data/IP/Op.o )
[5 of 7] Compiling Data.IP.RouteTable.Internal ( Data/IP/RouteTable/Internal.hs, dist/build/Data/IP/RouteTable/Internal.o )
Data/IP/RouteTable/Internal.hs:261:12:
Not in scope: foldl'
Perhaps you meant one of these:
foldl1' (imported from Data.Foldable),
foldl1' (imported from Prelude),
`foldl' (imported from Data.Foldable)
Failed to install iproute-1.4.0
cabal: Error: some packages failed to install:
iproute-1.4.0 failed during the building phase. The exception was:
ExitFailure 1
I use cabal 1.22.3.0
and
GHC 7.4.1
Given:
21548033
is 1.72.204.1
Test:
λ: fromHostAddress 21548033 :: IPv4
1.204.72.1
λ: toHostAddress (read "1.72.204.1" :: IPv4)
30164993
Could you please explain why octets are reversed?
Or am I using fromHostAddress
and toHostAddress
incorrectly to convert from/to integers?
While building iproute on i686 and armv7 Linux with ghc-7.10.3 I noted some warnings:
Preprocessing library iproute-1.7.0...
[1 of 8] Compiling Data.IP.Addr ( Data/IP/Addr.hs, dist/build/Data/IP/Addr.o )
Data/IP/Addr.hs:128:50: Warning:
Literal 4294967295 is out of the Int range -2147483648..2147483647
Data/IP/Addr.hs:129:50: Warning:
Literal 4294967295 is out of the Int range -2147483648..2147483647
Data/IP/Addr.hs:130:50: Warning:
Literal 4294967295 is out of the Int range -2147483648..2147483647
Data/IP/Addr.hs:131:50: Warning:
Literal 4294967295 is out of the Int range -2147483648..2147483647
Note sure if they are serious but thought better report them. :)
Add parse from ByteString and Text
Fail to compile with GHCJS due network
dependency. Possible workaround is cabal flag that disables parts that are depend on network package.
Log:
building '/nix/store/b588qzd6346b74w0lxzxch4dl65hlhvg-cabal2nix-auth-api.drv'...
installing
these derivations will be built:
/nix/store/dsp7ai92b48clpxqkvr7n52xfy1jzkjk-appar-0.1.8-js-unknown-ghcjs.drv
/nix/store/m35nyh0i3dhn6ns11ra4q6hrad0nc8yv-network-2.8.0.1-js-unknown-ghcjs.drv
/nix/store/wqc5jyn82l9719sx78lc3g1wijk63k7k-byteorder-1.0.4-js-unknown-ghcjs.drv
/nix/store/69r5jxqbz6vmxacpn66fd2gybdg044d0-iproute-1.7.7-js-unknown-ghcjs.drv
/nix/store/4pwg5q8wif2lh6nlyzvlrafzs6mljkxm-hoogle-local-0.1.drv
/nix/store/671mpdfxp5nrxpf0r1v5p1mhwpfjbnkm-ghcjs-8.6.0.1-with-packages.drv
building '/nix/store/dsp7ai92b48clpxqkvr7n52xfy1jzkjk-appar-0.1.8-js-unknown-ghcjs.drv'...
building '/nix/store/wqc5jyn82l9719sx78lc3g1wijk63k7k-byteorder-1.0.4-js-unknown-ghcjs.drv'...
building '/nix/store/m35nyh0i3dhn6ns11ra4q6hrad0nc8yv-network-2.8.0.1-js-unknown-ghcjs.drv'...
setupCompilerEnvironmentPhase
Build with /nix/store/ybwg61a4krmvk127pz7fssk9vdv40lyz-ghcjs-8.6.0.1.
setupCompilerEnvironmentPhase
Build with /nix/store/ybwg61a4krmvk127pz7fssk9vdv40lyz-ghcjs-8.6.0.1.
setupCompilerEnvironmentPhase
Build with /nix/store/ybwg61a4krmvk127pz7fssk9vdv40lyz-ghcjs-8.6.0.1.
unpacking sources
unpacking source archive /nix/store/1f6l44n15c8b25gszanl3pmw43b9q64j-appar-0.1.8.tar.gz
source root is appar-0.1.8
setting SOURCE_DATE_EPOCH to timestamp 1557192460 of file appar-0.1.8/Text/Appar/String.hs
patching sources
unpacking sources
unpacking source archive /nix/store/wws4j0djw9piyh6jrgg5j7si7dwwzijz-byteorder-1.0.4.tar.gz
compileBuildDriverPhase
setupCompileFlags: -package-db=/build/setup-package.conf.d -j4 -threaded
source root is byteorder-1.0.4
setting SOURCE_DATE_EPOCH to timestamp 1366772517 of file byteorder-1.0.4/System/ByteOrder.hs
patching sources
compileBuildDriverPhase
setupCompileFlags: -package-db=/build/setup-package.conf.d -j4 -threaded
unpacking sources
unpacking source archive /nix/store/hp2shcdrxaakw49d5555vhdq9pxfg90r-network-2.8.0.1.tar.gz
source root is network-2.8.0.1
setting SOURCE_DATE_EPOCH to timestamp 1000000000 of file network-2.8.0.1/tests/Spec.hs
patching sources
applying patch /nix/store/yjk6rhygfyzsjdw78x3jhxyy9m5ay3ay-ghcjs-network.patch
patching file Network/Socket.hsc
Hunk #1 succeeded at 486 (offset 7 lines).
compileBuildDriverPhase
setupCompileFlags: -package-db=/build/setup-package.conf.d -j4 -threaded
[1 of 1] Compiling Main ( Setup.hs, /build/Main.o )
[1 of 1] Compiling Main ( Setup.hs, /build/Main.o )
[1 of 1] Compiling Main ( Setup.hs, /build/Main.o )
Linking Setup ...
Linking Setup ...
Linking Setup ...
updateAutotoolsGnuConfigScriptsPhase
updateAutotoolsGnuConfigScriptsPhase
configuring
configureFlags: --verbose --prefix=/nix/store/z5y4q4j1cdnpwqhrfp4hjh0bs3rzjmm5-byteorder-1.0.4-js-unknown-ghcjs --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --docdir=/nix/store/92xyyl3jr2v0q1lwf4bf2y4mczqd3qkx-byteorder-1.0.4-js-unknown-ghcjs-doc/share/doc/byteorder-1.0.4 --package-db=/build/package.conf.d --ghc-option=-j4 --disable-split-objs --disable-library-profiling --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --disable-tests --disable-benchmarks --enable-library-vanilla --disable-library-for-ghci --ghc-option=-split-sections --disable-library-stripping --disable-executable-stripping --ghcjs --configure-option=--host=js-unknown-ghcjs --with-ghc=ghcjs --with-ghc-pkg=ghc-pkg --with-gcc=cc --hsc2hs-option=--cross-compile --ghcjs-options=-fexpose-all-unfoldings
configuring
configureFlags: --verbose --prefix=/nix/store/q2fqmjdhcf34kp4jmxsab2rxj69d328r-appar-0.1.8-js-unknown-ghcjs --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --docdir=/nix/store/cqq3c1j107pm5p4j12749kj0q2413b1w-appar-0.1.8-js-unknown-ghcjs-doc/share/doc/appar-0.1.8 --package-db=/build/package.conf.d --ghc-option=-j4 --disable-split-objs --disable-library-profiling --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --disable-tests --disable-benchmarks --enable-library-vanilla --disable-library-for-ghci --ghc-option=-split-sections --disable-library-stripping --disable-executable-stripping --ghcjs --configure-option=--host=js-unknown-ghcjs --with-ghc=ghcjs --with-ghc-pkg=ghc-pkg --with-gcc=cc --hsc2hs-option=--cross-compile --ghcjs-options=-fexpose-all-unfoldings
updateAutotoolsGnuConfigScriptsPhase
Updating Autotools / GNU config script to a newer upstream version: ./config.sub
Updating Autotools / GNU config script to a newer upstream version: ./config.guess
configuring
configureFlags: --verbose --prefix=/nix/store/iimfglajl8jyp5hv0csk3v0nf725lz2k-network-2.8.0.1-js-unknown-ghcjs --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --docdir=/nix/store/6n6n8m7hkfixqfkd99gg0nbl8bhm16l2-network-2.8.0.1-js-unknown-ghcjs-doc/share/doc/network-2.8.0.1 --package-db=/build/package.conf.d --ghc-option=-j4 --disable-split-objs --disable-library-profiling --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --disable-tests --disable-benchmarks --enable-library-vanilla --disable-library-for-ghci --ghc-option=-split-sections --disable-library-stripping --disable-executable-stripping --ghcjs --configure-option=--host=js-unknown-ghcjs --with-ghc=ghcjs --with-ghc-pkg=ghc-pkg --with-gcc=cc --hsc2hs-option=--cross-compile --ghcjs-options=-fexpose-all-unfoldings
Using Parsec parser
Configuring network-2.8.0.1...
Dependency base >=4.7 && <5: using base-4.12.0.0
Dependency bytestring ==0.10.*: using bytestring-0.10.8.2
Dependency unix >=2: using unix-2.7.2.2
Source component graph: component lib
Configured component graph:
component network-2.8.0.1-BO785m7qU6E9pydvHvhLxt
include base-4.12.0.0-BGkpKxWDclNH5NZN2wRc8Q
include bytestring-0.10.8.2-FBklFuapa1a7kq4yflY7Bt
include unix-2.7.2.2-JxmyTgtpFqj7lvsQuv62w2
Linked component graph:
unit network-2.8.0.1-BO785m7qU6E9pydvHvhLxt
include base-4.12.0.0-BGkpKxWDclNH5NZN2wRc8Q
include bytestring-0.10.8.2-FBklFuapa1a7kq4yflY7Bt
include unix-2.7.2.2-JxmyTgtpFqj7lvsQuv62w2
Network=network-2.8.0.1-BO785m7qU6E9pydvHvhLxt:Network,Network.BSD=network-2.8.0.1-BO785m7qU6E9pydvHvhLxt:Network.BSD,Network.Socket=network-2.8.0.1-BO785m7qU6E9pydvHvhLxt:Network.Socket,Network.Socket.ByteString=network-2.8.0.1-BO785m7qU6E9pydvHvhLxt:Network.Socket.ByteString,Network.Socket.ByteString.Lazy=network-2.8.0.1-BO785m7qU6E9pydvHvhLxt:Network.Socket.ByteString.Lazy,Network.Socket.Internal=network-2.8.0.1-BO785m7qU6E9pydvHvhLxt:Network.Socket.Internal
Ready component graph:
definite network-2.8.0.1-BO785m7qU6E9pydvHvhLxt
depends base-4.12.0.0-BGkpKxWDclNH5NZN2wRc8Q
depends bytestring-0.10.8.2-FBklFuapa1a7kq4yflY7Bt
depends unix-2.7.2.2-JxmyTgtpFqj7lvsQuv62w2
Using Cabal-2.4.0.1 compiled by ghc-8.6
Using compiler: ghcjs-8.6.0.1
Using install prefix:
/nix/store/iimfglajl8jyp5hv0csk3v0nf725lz2k-network-2.8.0.1-js-unknown-ghcjs
Executables installed in:
/nix/store/iimfglajl8jyp5hv0csk3v0nf725lz2k-network-2.8.0.1-js-unknown-ghcjs/bin
Libraries installed in:
/nix/store/iimfglajl8jyp5hv0csk3v0nf725lz2k-network-2.8.0.1-js-unknown-ghcjs/lib/ghcjs-8.6.0.1/x86_64-linux-ghcjs-8.6.0.1-ghc8_6_5/network-2.8.0.1-BO785m7qU6E9pydvHvhLxt
Dynamic Libraries installed in:
/nix/store/iimfglajl8jyp5hv0csk3v0nf725lz2k-network-2.8.0.1-js-unknown-ghcjs/lib/ghcjs-8.6.0.1/x86_64-linux-ghcjs-8.6.0.1-ghc8_6_5
Private executables installed in:
/nix/store/iimfglajl8jyp5hv0csk3v0nf725lz2k-network-2.8.0.1-js-unknown-ghcjs/libexec/x86_64-linux-ghcjs-8.6.0.1-ghc8_6_5/network-2.8.0.1
Data files installed in:
/nix/store/iimfglajl8jyp5hv0csk3v0nf725lz2k-network-2.8.0.1-js-unknown-ghcjs/share/x86_64-linux-ghcjs-8.6.0.1-ghc8_6_5/network-2.8.0.1
Documentation installed in:
/nix/store/6n6n8m7hkfixqfkd99gg0nbl8bhm16l2-network-2.8.0.1-js-unknown-ghcjs-doc/share/doc/network-2.8.0.1
Configuration files installed in:
/nix/store/iimfglajl8jyp5hv0csk3v0nf725lz2k-network-2.8.0.1-js-unknown-ghcjs/etc
No alex found
Using ar found on system at:
/nix/store/q354712mnkw3ky8b5crj7ir7dyv29ylj-binutils-2.31.1/bin/ar
No c2hs found
No cpphs found
No doctest found
Using gcc version 8.3.0 given by user at:
/nix/store/5w1sbkk3kwahwm25dhgnyd4w6kg4znmf-gcc-wrapper-8.3.0/bin/cc
Using ghc version 8.6.0.1 given by user at:
/nix/store/ybwg61a4krmvk127pz7fssk9vdv40lyz-ghcjs-8.6.0.1/bin/ghcjs
Using ghc-pkg version 8.6.4 given by user at:
/nix/store/3zwsp9vc43d0g3bkn7l9w2rpwrm4ly8w-ghc-8.6.4/bin/ghc-pkg
Using ghcjs version 8.6.0.1 found on system at:
/nix/store/ybwg61a4krmvk127pz7fssk9vdv40lyz-ghcjs-8.6.0.1/bin/ghcjs
Using ghcjs-pkg version 8.6.5 found on system at:
/nix/store/ybwg61a4krmvk127pz7fssk9vdv40lyz-ghcjs-8.6.0.1/bin/ghcjs-pkg
No greencard found
Using haddock version 2.20.0 found on system at:
/nix/store/ybwg61a4krmvk127pz7fssk9vdv40lyz-ghcjs-8.6.0.1/bin/haddock-ghcjs
No happy found
Using haskell-suite found on system at: haskell-suite-dummy-location
Using haskell-suite-pkg found on system at: haskell-suite-pkg-dummy-location
No hmake found
Using hpc version 0.67 found on system at:
/nix/store/3zwsp9vc43d0g3bkn7l9w2rpwrm4ly8w-ghc-8.6.4/bin/hpc
Using hsc2hs version 0.68.5 found on system at:
/nix/store/ybwg61a4krmvk127pz7fssk9vdv40lyz-ghcjs-8.6.0.1/bin/hsc2hs-ghcjs
Using hscolour version 1.24 found on system at:
/nix/store/20alg7mn6w9qfh7aiighvkkn2rld6d4s-hscolour-1.24.4/bin/HsColour
No jhc found
Using ld found on system at:
/nix/store/5w1sbkk3kwahwm25dhgnyd4w6kg4znmf-gcc-wrapper-8.3.0/bin/ld
No pkg-config found
Using runghc version 8.6.4 found on system at:
/nix/store/3zwsp9vc43d0g3bkn7l9w2rpwrm4ly8w-ghc-8.6.4/bin/runghc
Using strip version 2.31 found on system at:
/nix/store/q354712mnkw3ky8b5crj7ir7dyv29ylj-binutils-2.31.1/bin/strip
Using tar found on system at:
/nix/store/b6aigimi4gv2a3jxbqpkwwc241n911mr-gnutar-1.32/bin/tar
No uhc found
/nix/store/506nnycf7nk22x7n07mjjjl2g8nifpda-bash-4.4-p23/bin/sh //build/network-2.8.0.1/configure '--with-compiler=ghcjs' '--prefix=/nix/store/iimfglajl8jyp5hv0csk3v0nf725lz2k-network-2.8.0.1-js-unknown-ghcjs' '--libdir=$prefix/lib/$compiler' '--host=js-unknown-ghcjs' 'CC=/nix/store/5w1sbkk3kwahwm25dhgnyd4w6kg4znmf-gcc-wrapper-8.3.0/bin/cc'
Using Parsec parser
Configuring byteorder-1.0.4...
Dependency base ==4.*: using base-4.12.0.0
Source component graph: component lib
Configured component graph:
component byteorder-1.0.4-LrMTqXCLBSaDMraFCRO3rZ
include base-4.12.0.0-BGkpKxWDclNH5NZN2wRc8Q
Linked component graph:
unit byteorder-1.0.4-LrMTqXCLBSaDMraFCRO3rZ
include base-4.12.0.0-BGkpKxWDclNH5NZN2wRc8Q
System.ByteOrder=byteorder-1.0.4-LrMTqXCLBSaDMraFCRO3rZ:System.ByteOrder
Ready component graph:
definite byteorder-1.0.4-LrMTqXCLBSaDMraFCRO3rZ
depends base-4.12.0.0-BGkpKxWDclNH5NZN2wRc8Q
Using Cabal-2.4.0.1 compiled by ghc-8.6
Using compiler: ghcjs-8.6.0.1
Using install prefix:
/nix/store/z5y4q4j1cdnpwqhrfp4hjh0bs3rzjmm5-byteorder-1.0.4-js-unknown-ghcjs
Executables installed in:
/nix/store/z5y4q4j1cdnpwqhrfp4hjh0bs3rzjmm5-byteorder-1.0.4-js-unknown-ghcjs/bin
Libraries installed in:
/nix/store/z5y4q4j1cdnpwqhrfp4hjh0bs3rzjmm5-byteorder-1.0.4-js-unknown-ghcjs/lib/ghcjs-8.6.0.1/x86_64-linux-ghcjs-8.6.0.1-ghc8_6_5/byteorder-1.0.4-LrMTqXCLBSaDMraFCRO3rZ
Dynamic Libraries installed in:
/nix/store/z5y4q4j1cdnpwqhrfp4hjh0bs3rzjmm5-byteorder-1.0.4-js-unknown-ghcjs/lib/ghcjs-8.6.0.1/x86_64-linux-ghcjs-8.6.0.1-ghc8_6_5
Private executables installed in:
/nix/store/z5y4q4j1cdnpwqhrfp4hjh0bs3rzjmm5-byteorder-1.0.4-js-unknown-ghcjs/libexec/x86_64-linux-ghcjs-8.6.0.1-ghc8_6_5/byteorder-1.0.4
Data files installed in:
/nix/store/z5y4q4j1cdnpwqhrfp4hjh0bs3rzjmm5-byteorder-1.0.4-js-unknown-ghcjs/share/x86_64-linux-ghcjs-8.6.0.1-ghc8_6_5/byteorder-1.0.4
Documentation installed in:
/nix/store/92xyyl3jr2v0q1lwf4bf2y4mczqd3qkx-byteorder-1.0.4-js-unknown-ghcjs-doc/share/doc/byteorder-1.0.4
Configuration files installed in:
/nix/store/z5y4q4j1cdnpwqhrfp4hjh0bs3rzjmm5-byteorder-1.0.4-js-unknown-ghcjs/etc
No alex found
Using ar found on system at:
/nix/store/q354712mnkw3ky8b5crj7ir7dyv29ylj-binutils-2.31.1/bin/ar
No c2hs found
No cpphs found
No doctest found
Using gcc version 8.3.0 given by user at:
/nix/store/5w1sbkk3kwahwm25dhgnyd4w6kg4znmf-gcc-wrapper-8.3.0/bin/cc
Using ghc version 8.6.0.1 given by user at:
/nix/store/ybwg61a4krmvk127pz7fssk9vdv40lyz-ghcjs-8.6.0.1/bin/ghcjs
Using ghc-pkg version 8.6.4 given by user at:
/nix/store/3zwsp9vc43d0g3bkn7l9w2rpwrm4ly8w-ghc-8.6.4/bin/ghc-pkg
Using ghcjs version 8.6.0.1 found on system at:
/nix/store/ybwg61a4krmvk127pz7fssk9vdv40lyz-ghcjs-8.6.0.1/bin/ghcjs
Using ghcjs-pkg version 8.6.5 found on system at:
/nix/store/ybwg61a4krmvk127pz7fssk9vdv40lyz-ghcjs-8.6.0.1/bin/ghcjs-pkg
No greencard found
Using haddock version 2.20.0 found on system at:
/nix/store/ybwg61a4krmvk127pz7fssk9vdv40lyz-ghcjs-8.6.0.1/bin/haddock-ghcjs
No happy found
Using haskell-suite found on system at: haskell-suite-dummy-location
Using haskell-suite-pkg found on system at: haskell-suite-pkg-dummy-location
No hmake found
Using hpc version 0.67 found on system at:
/nix/store/3zwsp9vc43d0g3bkn7l9w2rpwrm4ly8w-ghc-8.6.4/bin/hpc
Using hsc2hs version 0.68.5 found on system at:
/nix/store/ybwg61a4krmvk127pz7fssk9vdv40lyz-ghcjs-8.6.0.1/bin/hsc2hs-ghcjs
Using hscolour version 1.24 found on system at:
/nix/store/20alg7mn6w9qfh7aiighvkkn2rld6d4s-hscolour-1.24.4/bin/HsColour
No jhc found
Using ld found on system at:
/nix/store/5w1sbkk3kwahwm25dhgnyd4w6kg4znmf-gcc-wrapper-8.3.0/bin/ld
No pkg-config found
Using runghc version 8.6.4 found on system at:
/nix/store/3zwsp9vc43d0g3bkn7l9w2rpwrm4ly8w-ghc-8.6.4/bin/runghc
Using strip version 2.31 found on system at:
/nix/store/q354712mnkw3ky8b5crj7ir7dyv29ylj-binutils-2.31.1/bin/strip
Using tar found on system at:
/nix/store/b6aigimi4gv2a3jxbqpkwwc241n911mr-gnutar-1.32/bin/tar
No uhc found
building
Using Parsec parser
Configuring appar-0.1.8...
Dependency base ==4.*: using base-4.12.0.0
Dependency bytestring -any: using bytestring-0.10.8.2
Source component graph: component lib
Configured component graph:
component appar-0.1.8-9XkwWwiIRQE8H0THpEDlKs
include base-4.12.0.0-BGkpKxWDclNH5NZN2wRc8Q
include bytestring-0.10.8.2-FBklFuapa1a7kq4yflY7Bt
Linked component graph:
unit appar-0.1.8-9XkwWwiIRQE8H0THpEDlKs
include base-4.12.0.0-BGkpKxWDclNH5NZN2wRc8Q
include bytestring-0.10.8.2-FBklFuapa1a7kq4yflY7Bt
Text.Appar.ByteString=appar-0.1.8-9XkwWwiIRQE8H0THpEDlKs:Text.Appar.ByteString,Text.Appar.LazyByteString=appar-0.1.8-9XkwWwiIRQE8H0THpEDlKs:Text.Appar.LazyByteString,Text.Appar.String=appar-0.1.8-9XkwWwiIRQE8H0THpEDlKs:Text.Appar.String
Ready component graph:
definite appar-0.1.8-9XkwWwiIRQE8H0THpEDlKs
depends base-4.12.0.0-BGkpKxWDclNH5NZN2wRc8Q
depends bytestring-0.10.8.2-FBklFuapa1a7kq4yflY7Bt
Using Cabal-2.4.0.1 compiled by ghc-8.6
Using compiler: ghcjs-8.6.0.1
Using install prefix:
/nix/store/q2fqmjdhcf34kp4jmxsab2rxj69d328r-appar-0.1.8-js-unknown-ghcjs
Executables installed in:
/nix/store/q2fqmjdhcf34kp4jmxsab2rxj69d328r-appar-0.1.8-js-unknown-ghcjs/bin
Libraries installed in:
/nix/store/q2fqmjdhcf34kp4jmxsab2rxj69d328r-appar-0.1.8-js-unknown-ghcjs/lib/ghcjs-8.6.0.1/x86_64-linux-ghcjs-8.6.0.1-ghc8_6_5/appar-0.1.8-9XkwWwiIRQE8H0THpEDlKs
Dynamic Libraries installed in:
/nix/store/q2fqmjdhcf34kp4jmxsab2rxj69d328r-appar-0.1.8-js-unknown-ghcjs/lib/ghcjs-8.6.0.1/x86_64-linux-ghcjs-8.6.0.1-ghc8_6_5
Private executables installed in:
/nix/store/q2fqmjdhcf34kp4jmxsab2rxj69d328r-appar-0.1.8-js-unknown-ghcjs/libexec/x86_64-linux-ghcjs-8.6.0.1-ghc8_6_5/appar-0.1.8
Data files installed in:
/nix/store/q2fqmjdhcf34kp4jmxsab2rxj69d328r-appar-0.1.8-js-unknown-ghcjs/share/x86_64-linux-ghcjs-8.6.0.1-ghc8_6_5/appar-0.1.8
Documentation installed in:
/nix/store/cqq3c1j107pm5p4j12749kj0q2413b1w-appar-0.1.8-js-unknown-ghcjs-doc/share/doc/appar-0.1.8
Configuration files installed in:
/nix/store/q2fqmjdhcf34kp4jmxsab2rxj69d328r-appar-0.1.8-js-unknown-ghcjs/etc
No alex found
Using ar found on system at:
/nix/store/q354712mnkw3ky8b5crj7ir7dyv29ylj-binutils-2.31.1/bin/ar
No c2hs found
No cpphs found
No doctest found
Using gcc version 8.3.0 given by user at:
/nix/store/5w1sbkk3kwahwm25dhgnyd4w6kg4znmf-gcc-wrapper-8.3.0/bin/cc
Using ghc version 8.6.0.1 given by user at:
/nix/store/ybwg61a4krmvk127pz7fssk9vdv40lyz-ghcjs-8.6.0.1/bin/ghcjs
Using ghc-pkg version 8.6.4 given by user at:
/nix/store/3zwsp9vc43d0g3bkn7l9w2rpwrm4ly8w-ghc-8.6.4/bin/ghc-pkg
Using ghcjs version 8.6.0.1 found on system at:
/nix/store/ybwg61a4krmvk127pz7fssk9vdv40lyz-ghcjs-8.6.0.1/bin/ghcjs
Using ghcjs-pkg version 8.6.5 found on system at:
/nix/store/ybwg61a4krmvk127pz7fssk9vdv40lyz-ghcjs-8.6.0.1/bin/ghcjs-pkg
No greencard found
Using haddock version 2.20.0 found on system at:
/nix/store/ybwg61a4krmvk127pz7fssk9vdv40lyz-ghcjs-8.6.0.1/bin/haddock-ghcjs
No happy found
Using haskell-suite found on system at: haskell-suite-dummy-location
Using haskell-suite-pkg found on system at: haskell-suite-pkg-dummy-location
No hmake found
Using hpc version 0.67 found on system at:
/nix/store/3zwsp9vc43d0g3bkn7l9w2rpwrm4ly8w-ghc-8.6.4/bin/hpc
Using hsc2hs version 0.68.5 found on system at:
/nix/store/ybwg61a4krmvk127pz7fssk9vdv40lyz-ghcjs-8.6.0.1/bin/hsc2hs-ghcjs
Using hscolour version 1.24 found on system at:
/nix/store/20alg7mn6w9qfh7aiighvkkn2rld6d4s-hscolour-1.24.4/bin/HsColour
No jhc found
Using ld found on system at:
/nix/store/5w1sbkk3kwahwm25dhgnyd4w6kg4znmf-gcc-wrapper-8.3.0/bin/ld
No pkg-config found
Using runghc version 8.6.4 found on system at:
/nix/store/3zwsp9vc43d0g3bkn7l9w2rpwrm4ly8w-ghc-8.6.4/bin/runghc
Using strip version 2.31 found on system at:
/nix/store/q354712mnkw3ky8b5crj7ir7dyv29ylj-binutils-2.31.1/bin/strip
Using tar found on system at:
/nix/store/b6aigimi4gv2a3jxbqpkwwc241n911mr-gnutar-1.32/bin/tar
No uhc found
building
configure: WARNING: unrecognized options: --with-compiler
Preprocessing library for byteorder-1.0.4..
Building library for byteorder-1.0.4..
Preprocessing library for appar-0.1.8..
Building library for appar-0.1.8..
checking build system type... x86_64-pc-linux-gnu
checking host system type... Invalid configuration `js-unknown-ghcjs': machine `js-unknown' not recognized
configure: error: /nix/store/506nnycf7nk22x7n07mjjjl2g8nifpda-bash-4.4-p23/bin/bash //build/network-2.8.0.1/config.sub js-unknown-ghcjs failed
[1 of 1] Compiling System.ByteOrder ( System/ByteOrder.hs, dist/build/System/ByteOrder.js_o )
builder for '/nix/store/m35nyh0i3dhn6ns11ra4q6hrad0nc8yv-network-2.8.0.1-js-unknown-ghcjs.drv' failed with exit code 1
cannot build derivation '/nix/store/671mpdfxp5nrxpf0r1v5p1mhwpfjbnkm-ghcjs-8.6.0.1-with-packages.drv': 1 dependencies couldn't be built
error: build of '/nix/store/671mpdfxp5nrxpf0r1v5p1mhwpfjbnkm-ghcjs-8.6.0.1-with-packages.drv' failed
Citing from https://hydra.nixos.org/build/85819909:
Running 2 test suites...
Test suite doctest: RUNNING...
./Data/IP/Op.hs:61: failure in expression `makeAddrRange ("2001:DB8::1" :: IPv6) 16 >:> makeAddrRange "2001:DB8::1" 32'
expected: True
but got: *** Exception: IPv4 adddress
./Data/IP/Op.hs:77: failure in expression `("2001:DB8::1" :: IPv6) `isMatchedTo` makeAddrRange "2001:DB8::1" 32'
expected: True
but got: *** Exception: IPv4 adddress
./Data/IP/Op.hs:118: failure in expression `addrRangePair ("2000::/8" :: AddrRange IPv6)'
expected: (2000::,8)
but got: *** Exception: IPv6 address4
./Data/IP/Range.hs:25: failure in expression `(read "2001:db8:00:00:00:00:00:01/48" :: IPRange) == IPv6Range (read "2001:db8:00:00:00:00:00:01/48" :: AddrRange IPv6)'
expected: True
but got: *** Exception: IPv4 adddress
./Data/IP/Range.hs:49: failure in expression `read "2001:db8:00:00:00:00:00:01/48" :: AddrRange IPv6'
expected: 2001:db8::/48
but got: *** Exception: IPv4 adddress
./Data/IP/Addr.hs:29: failure in expression `(read "2001:db8:00:00:00:00:00:01" :: IP) == IPv6 (read "2001:db8:00:00:00:00:00:01" :: IPv6)'
expected: True
but got: *** Exception: IPv4 adddress
./Data/IP/Addr.hs:40: failure in expression `(read "2001:db8:00:00:00:00:00:01" :: IP) == (read "2001:db8:00:00:00:00:00:01" :: IP)'
expected: True
but got: *** Exception: IPv4 adddress
./Data/IP/Addr.hs:94: failure in expression `read "2001:db8:00:00:00:00:00:01" :: IPv6'
expected: 2001:db8::1
but got: *** Exception: IPv4 adddress
Examples: 69 Tried: 54 Errors: 0 Failures: 8
Test suite doctest: FAIL
Test suite logged to: dist/test/iproute-1.7.6-doctest.log
Test suite spec: RUNNING...
IP
read
IPv4
+++ OK, passed 100 tests.
IPv6 FAILED [1]
IPv4 failure FAILED [2]
IPv6 failure FAILED [3]
can read even if unnecessary spaces exist
can read even if unnecessary spaces exist
RouteTable
fromList
creates the same tree for random input and ordered input
+++ OK, passed 100 tests.
creates the same tree for random input and ordered input
+++ OK, passed 100 tests.
stores input in the incremental order
+++ OK, passed 100 tests.
stores input in the incremental order
+++ OK, passed 100 tests.
toList
expands as sorted
+++ OK, passed 100 tests.
expands as sorted
+++ OK, passed 100 tests.
folds
foldl
+++ OK, passed 100 tests.
foldr
+++ OK, passed 100 tests.
monoid
monoid instance
+++ OK, passed 100 tests.
Failures:
test/IPSpec.hs:54:9:
1) IP.read IPv6
uncaught exception: ErrorCall
IPv6 address4
(after 2 tests)
8d2:97a7:80bb:a60d:e1b0::/76
To rerun use: --match "/IP/read/IPv6/"
test/IPSpec.hs:55:9:
2) IP.read IPv4 failure
uncaught exception: ErrorCall
IPv4 mask length
(after 1 test)
Iv4 "80.123.62.105/4898895715847704126"
To rerun use: --match "/IP/read/IPv4 failure/"
test/IPSpec.hs:56:9:
3) IP.read IPv6 failure
uncaught exception: ErrorCall
IPv6 mask length: 4898895797153211166
(after 1 test)
Iv6 "d250:df7b:b63e:1f69:99e6:f2c2:f0de:d466/4898895797153211166"
To rerun use: --match "/IP/read/IPv6 failure/"
Randomized with seed 97975516
Finished in 0.1460 seconds
15 examples, 3 failures
Test suite spec: FAIL
Hello! I would like to request to make the Data.IP.Addr
module public. I would like to use the parsing functions to create custom read
method that would fallback to name reading, like "haskell.org"
if not matched with IPv{4,6}
address.
GHC 8.0.1 prints these:
/home/user/iproute/Data/IP/Op.hs:121:1: warning: [-Wredundant-constraints]
* Redundant constraint: Addr a
* In the type signature for:
addrRangePair :: Addr a => AddrRange a -> (a, Int)
[5 of 8] Compiling Data.IP.Internal ( Data/IP/Internal.hs, .stack-work/dist/i386-linux/Cabal-1.24.0.0/build/Data/IP/Internal.o )
[6 of 8] Compiling Data.IP.RouteTable.Internal ( Data/IP/RouteTable/Internal.hs, .stack-work/dist/i386-linux/Cabal-1.24.0.0/build/Data/IP/RouteTable/Internal.o )
/home/user/iproute/Data/IP/RouteTable/Internal.hs:103:1: warning: [-Wredundant-constraints]
* Redundant constraint: Routable k
* In the type signature for:
empty :: Routable k => IPRTable k a
/home/user/iproute/Data/IP/RouteTable/Internal.hs:187:1: warning: [-Wredundant-constraints]
* Redundant constraint: Routable k
* In the type signature for:
node :: Routable k =>
AddrRange k
-> k -> Maybe a -> IPRTable k a -> IPRTable k a -> IPRTable k a
/home/user/iproute/Data/IP/RouteTable/Internal.hs:271:1: warning: [-Wredundant-constraints]
* Redundant constraint: Routable k
* In the type signature for:
Data.IP.RouteTable.Internal.toList :: Routable k =>
IPRTable k a -> [(AddrRange k, a)]
IMO the best way would be just to add -Wno-redundant-constraints to builds flags.
When dealing with IPv6 interface addresses it is commonplace (at least in Linux) to specify them in the IP/prefix format to define IP and netmask in one go. I was going to simply use the Read instance of IPRange to parse these interface addresses but since IPRange masks the IP down to a netid I can't use it to store this configuration data and had to use a custom parser instead.
Fail to compile with GHCJS due network
dependency. Possible workaround is cabal flag that disables parts that are depend on network package.
Log:
building '/nix/store/b588qzd6346b74w0lxzxch4dl65hlhvg-cabal2nix-auth-api.drv'...
installing
these derivations will be built:
/nix/store/dsp7ai92b48clpxqkvr7n52xfy1jzkjk-appar-0.1.8-js-unknown-ghcjs.drv
/nix/store/m35nyh0i3dhn6ns11ra4q6hrad0nc8yv-network-2.8.0.1-js-unknown-ghcjs.drv
/nix/store/wqc5jyn82l9719sx78lc3g1wijk63k7k-byteorder-1.0.4-js-unknown-ghcjs.drv
/nix/store/69r5jxqbz6vmxacpn66fd2gybdg044d0-iproute-1.7.7-js-unknown-ghcjs.drv
/nix/store/4pwg5q8wif2lh6nlyzvlrafzs6mljkxm-hoogle-local-0.1.drv
/nix/store/671mpdfxp5nrxpf0r1v5p1mhwpfjbnkm-ghcjs-8.6.0.1-with-packages.drv
building '/nix/store/dsp7ai92b48clpxqkvr7n52xfy1jzkjk-appar-0.1.8-js-unknown-ghcjs.drv'...
building '/nix/store/wqc5jyn82l9719sx78lc3g1wijk63k7k-byteorder-1.0.4-js-unknown-ghcjs.drv'...
building '/nix/store/m35nyh0i3dhn6ns11ra4q6hrad0nc8yv-network-2.8.0.1-js-unknown-ghcjs.drv'...
setupCompilerEnvironmentPhase
Build with /nix/store/ybwg61a4krmvk127pz7fssk9vdv40lyz-ghcjs-8.6.0.1.
setupCompilerEnvironmentPhase
Build with /nix/store/ybwg61a4krmvk127pz7fssk9vdv40lyz-ghcjs-8.6.0.1.
setupCompilerEnvironmentPhase
Build with /nix/store/ybwg61a4krmvk127pz7fssk9vdv40lyz-ghcjs-8.6.0.1.
unpacking sources
unpacking source archive /nix/store/1f6l44n15c8b25gszanl3pmw43b9q64j-appar-0.1.8.tar.gz
source root is appar-0.1.8
setting SOURCE_DATE_EPOCH to timestamp 1557192460 of file appar-0.1.8/Text/Appar/String.hs
patching sources
unpacking sources
unpacking source archive /nix/store/wws4j0djw9piyh6jrgg5j7si7dwwzijz-byteorder-1.0.4.tar.gz
compileBuildDriverPhase
setupCompileFlags: -package-db=/build/setup-package.conf.d -j4 -threaded
source root is byteorder-1.0.4
setting SOURCE_DATE_EPOCH to timestamp 1366772517 of file byteorder-1.0.4/System/ByteOrder.hs
patching sources
compileBuildDriverPhase
setupCompileFlags: -package-db=/build/setup-package.conf.d -j4 -threaded
unpacking sources
unpacking source archive /nix/store/hp2shcdrxaakw49d5555vhdq9pxfg90r-network-2.8.0.1.tar.gz
source root is network-2.8.0.1
setting SOURCE_DATE_EPOCH to timestamp 1000000000 of file network-2.8.0.1/tests/Spec.hs
patching sources
applying patch /nix/store/yjk6rhygfyzsjdw78x3jhxyy9m5ay3ay-ghcjs-network.patch
patching file Network/Socket.hsc
Hunk #1 succeeded at 486 (offset 7 lines).
compileBuildDriverPhase
setupCompileFlags: -package-db=/build/setup-package.conf.d -j4 -threaded
[1 of 1] Compiling Main ( Setup.hs, /build/Main.o )
[1 of 1] Compiling Main ( Setup.hs, /build/Main.o )
[1 of 1] Compiling Main ( Setup.hs, /build/Main.o )
Linking Setup ...
Linking Setup ...
Linking Setup ...
updateAutotoolsGnuConfigScriptsPhase
updateAutotoolsGnuConfigScriptsPhase
configuring
configureFlags: --verbose --prefix=/nix/store/z5y4q4j1cdnpwqhrfp4hjh0bs3rzjmm5-byteorder-1.0.4-js-unknown-ghcjs --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --docdir=/nix/store/92xyyl3jr2v0q1lwf4bf2y4mczqd3qkx-byteorder-1.0.4-js-unknown-ghcjs-doc/share/doc/byteorder-1.0.4 --package-db=/build/package.conf.d --ghc-option=-j4 --disable-split-objs --disable-library-profiling --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --disable-tests --disable-benchmarks --enable-library-vanilla --disable-library-for-ghci --ghc-option=-split-sections --disable-library-stripping --disable-executable-stripping --ghcjs --configure-option=--host=js-unknown-ghcjs --with-ghc=ghcjs --with-ghc-pkg=ghc-pkg --with-gcc=cc --hsc2hs-option=--cross-compile --ghcjs-options=-fexpose-all-unfoldings
configuring
configureFlags: --verbose --prefix=/nix/store/q2fqmjdhcf34kp4jmxsab2rxj69d328r-appar-0.1.8-js-unknown-ghcjs --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --docdir=/nix/store/cqq3c1j107pm5p4j12749kj0q2413b1w-appar-0.1.8-js-unknown-ghcjs-doc/share/doc/appar-0.1.8 --package-db=/build/package.conf.d --ghc-option=-j4 --disable-split-objs --disable-library-profiling --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --disable-tests --disable-benchmarks --enable-library-vanilla --disable-library-for-ghci --ghc-option=-split-sections --disable-library-stripping --disable-executable-stripping --ghcjs --configure-option=--host=js-unknown-ghcjs --with-ghc=ghcjs --with-ghc-pkg=ghc-pkg --with-gcc=cc --hsc2hs-option=--cross-compile --ghcjs-options=-fexpose-all-unfoldings
updateAutotoolsGnuConfigScriptsPhase
Updating Autotools / GNU config script to a newer upstream version: ./config.sub
Updating Autotools / GNU config script to a newer upstream version: ./config.guess
configuring
configureFlags: --verbose --prefix=/nix/store/iimfglajl8jyp5hv0csk3v0nf725lz2k-network-2.8.0.1-js-unknown-ghcjs --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --docdir=/nix/store/6n6n8m7hkfixqfkd99gg0nbl8bhm16l2-network-2.8.0.1-js-unknown-ghcjs-doc/share/doc/network-2.8.0.1 --package-db=/build/package.conf.d --ghc-option=-j4 --disable-split-objs --disable-library-profiling --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --disable-tests --disable-benchmarks --enable-library-vanilla --disable-library-for-ghci --ghc-option=-split-sections --disable-library-stripping --disable-executable-stripping --ghcjs --configure-option=--host=js-unknown-ghcjs --with-ghc=ghcjs --with-ghc-pkg=ghc-pkg --with-gcc=cc --hsc2hs-option=--cross-compile --ghcjs-options=-fexpose-all-unfoldings
Using Parsec parser
Configuring network-2.8.0.1...
Dependency base >=4.7 && <5: using base-4.12.0.0
Dependency bytestring ==0.10.*: using bytestring-0.10.8.2
Dependency unix >=2: using unix-2.7.2.2
Source component graph: component lib
Configured component graph:
component network-2.8.0.1-BO785m7qU6E9pydvHvhLxt
include base-4.12.0.0-BGkpKxWDclNH5NZN2wRc8Q
include bytestring-0.10.8.2-FBklFuapa1a7kq4yflY7Bt
include unix-2.7.2.2-JxmyTgtpFqj7lvsQuv62w2
Linked component graph:
unit network-2.8.0.1-BO785m7qU6E9pydvHvhLxt
include base-4.12.0.0-BGkpKxWDclNH5NZN2wRc8Q
include bytestring-0.10.8.2-FBklFuapa1a7kq4yflY7Bt
include unix-2.7.2.2-JxmyTgtpFqj7lvsQuv62w2
Network=network-2.8.0.1-BO785m7qU6E9pydvHvhLxt:Network,Network.BSD=network-2.8.0.1-BO785m7qU6E9pydvHvhLxt:Network.BSD,Network.Socket=network-2.8.0.1-BO785m7qU6E9pydvHvhLxt:Network.Socket,Network.Socket.ByteString=network-2.8.0.1-BO785m7qU6E9pydvHvhLxt:Network.Socket.ByteString,Network.Socket.ByteString.Lazy=network-2.8.0.1-BO785m7qU6E9pydvHvhLxt:Network.Socket.ByteString.Lazy,Network.Socket.Internal=network-2.8.0.1-BO785m7qU6E9pydvHvhLxt:Network.Socket.Internal
Ready component graph:
definite network-2.8.0.1-BO785m7qU6E9pydvHvhLxt
depends base-4.12.0.0-BGkpKxWDclNH5NZN2wRc8Q
depends bytestring-0.10.8.2-FBklFuapa1a7kq4yflY7Bt
depends unix-2.7.2.2-JxmyTgtpFqj7lvsQuv62w2
Using Cabal-2.4.0.1 compiled by ghc-8.6
Using compiler: ghcjs-8.6.0.1
Using install prefix:
/nix/store/iimfglajl8jyp5hv0csk3v0nf725lz2k-network-2.8.0.1-js-unknown-ghcjs
Executables installed in:
/nix/store/iimfglajl8jyp5hv0csk3v0nf725lz2k-network-2.8.0.1-js-unknown-ghcjs/bin
Libraries installed in:
/nix/store/iimfglajl8jyp5hv0csk3v0nf725lz2k-network-2.8.0.1-js-unknown-ghcjs/lib/ghcjs-8.6.0.1/x86_64-linux-ghcjs-8.6.0.1-ghc8_6_5/network-2.8.0.1-BO785m7qU6E9pydvHvhLxt
Dynamic Libraries installed in:
/nix/store/iimfglajl8jyp5hv0csk3v0nf725lz2k-network-2.8.0.1-js-unknown-ghcjs/lib/ghcjs-8.6.0.1/x86_64-linux-ghcjs-8.6.0.1-ghc8_6_5
Private executables installed in:
/nix/store/iimfglajl8jyp5hv0csk3v0nf725lz2k-network-2.8.0.1-js-unknown-ghcjs/libexec/x86_64-linux-ghcjs-8.6.0.1-ghc8_6_5/network-2.8.0.1
Data files installed in:
/nix/store/iimfglajl8jyp5hv0csk3v0nf725lz2k-network-2.8.0.1-js-unknown-ghcjs/share/x86_64-linux-ghcjs-8.6.0.1-ghc8_6_5/network-2.8.0.1
Documentation installed in:
/nix/store/6n6n8m7hkfixqfkd99gg0nbl8bhm16l2-network-2.8.0.1-js-unknown-ghcjs-doc/share/doc/network-2.8.0.1
Configuration files installed in:
/nix/store/iimfglajl8jyp5hv0csk3v0nf725lz2k-network-2.8.0.1-js-unknown-ghcjs/etc
No alex found
Using ar found on system at:
/nix/store/q354712mnkw3ky8b5crj7ir7dyv29ylj-binutils-2.31.1/bin/ar
No c2hs found
No cpphs found
No doctest found
Using gcc version 8.3.0 given by user at:
/nix/store/5w1sbkk3kwahwm25dhgnyd4w6kg4znmf-gcc-wrapper-8.3.0/bin/cc
Using ghc version 8.6.0.1 given by user at:
/nix/store/ybwg61a4krmvk127pz7fssk9vdv40lyz-ghcjs-8.6.0.1/bin/ghcjs
Using ghc-pkg version 8.6.4 given by user at:
/nix/store/3zwsp9vc43d0g3bkn7l9w2rpwrm4ly8w-ghc-8.6.4/bin/ghc-pkg
Using ghcjs version 8.6.0.1 found on system at:
/nix/store/ybwg61a4krmvk127pz7fssk9vdv40lyz-ghcjs-8.6.0.1/bin/ghcjs
Using ghcjs-pkg version 8.6.5 found on system at:
/nix/store/ybwg61a4krmvk127pz7fssk9vdv40lyz-ghcjs-8.6.0.1/bin/ghcjs-pkg
No greencard found
Using haddock version 2.20.0 found on system at:
/nix/store/ybwg61a4krmvk127pz7fssk9vdv40lyz-ghcjs-8.6.0.1/bin/haddock-ghcjs
No happy found
Using haskell-suite found on system at: haskell-suite-dummy-location
Using haskell-suite-pkg found on system at: haskell-suite-pkg-dummy-location
No hmake found
Using hpc version 0.67 found on system at:
/nix/store/3zwsp9vc43d0g3bkn7l9w2rpwrm4ly8w-ghc-8.6.4/bin/hpc
Using hsc2hs version 0.68.5 found on system at:
/nix/store/ybwg61a4krmvk127pz7fssk9vdv40lyz-ghcjs-8.6.0.1/bin/hsc2hs-ghcjs
Using hscolour version 1.24 found on system at:
/nix/store/20alg7mn6w9qfh7aiighvkkn2rld6d4s-hscolour-1.24.4/bin/HsColour
No jhc found
Using ld found on system at:
/nix/store/5w1sbkk3kwahwm25dhgnyd4w6kg4znmf-gcc-wrapper-8.3.0/bin/ld
No pkg-config found
Using runghc version 8.6.4 found on system at:
/nix/store/3zwsp9vc43d0g3bkn7l9w2rpwrm4ly8w-ghc-8.6.4/bin/runghc
Using strip version 2.31 found on system at:
/nix/store/q354712mnkw3ky8b5crj7ir7dyv29ylj-binutils-2.31.1/bin/strip
Using tar found on system at:
/nix/store/b6aigimi4gv2a3jxbqpkwwc241n911mr-gnutar-1.32/bin/tar
No uhc found
/nix/store/506nnycf7nk22x7n07mjjjl2g8nifpda-bash-4.4-p23/bin/sh //build/network-2.8.0.1/configure '--with-compiler=ghcjs' '--prefix=/nix/store/iimfglajl8jyp5hv0csk3v0nf725lz2k-network-2.8.0.1-js-unknown-ghcjs' '--libdir=$prefix/lib/$compiler' '--host=js-unknown-ghcjs' 'CC=/nix/store/5w1sbkk3kwahwm25dhgnyd4w6kg4znmf-gcc-wrapper-8.3.0/bin/cc'
Using Parsec parser
Configuring byteorder-1.0.4...
Dependency base ==4.*: using base-4.12.0.0
Source component graph: component lib
Configured component graph:
component byteorder-1.0.4-LrMTqXCLBSaDMraFCRO3rZ
include base-4.12.0.0-BGkpKxWDclNH5NZN2wRc8Q
Linked component graph:
unit byteorder-1.0.4-LrMTqXCLBSaDMraFCRO3rZ
include base-4.12.0.0-BGkpKxWDclNH5NZN2wRc8Q
System.ByteOrder=byteorder-1.0.4-LrMTqXCLBSaDMraFCRO3rZ:System.ByteOrder
Ready component graph:
definite byteorder-1.0.4-LrMTqXCLBSaDMraFCRO3rZ
depends base-4.12.0.0-BGkpKxWDclNH5NZN2wRc8Q
Using Cabal-2.4.0.1 compiled by ghc-8.6
Using compiler: ghcjs-8.6.0.1
Using install prefix:
/nix/store/z5y4q4j1cdnpwqhrfp4hjh0bs3rzjmm5-byteorder-1.0.4-js-unknown-ghcjs
Executables installed in:
/nix/store/z5y4q4j1cdnpwqhrfp4hjh0bs3rzjmm5-byteorder-1.0.4-js-unknown-ghcjs/bin
Libraries installed in:
/nix/store/z5y4q4j1cdnpwqhrfp4hjh0bs3rzjmm5-byteorder-1.0.4-js-unknown-ghcjs/lib/ghcjs-8.6.0.1/x86_64-linux-ghcjs-8.6.0.1-ghc8_6_5/byteorder-1.0.4-LrMTqXCLBSaDMraFCRO3rZ
Dynamic Libraries installed in:
/nix/store/z5y4q4j1cdnpwqhrfp4hjh0bs3rzjmm5-byteorder-1.0.4-js-unknown-ghcjs/lib/ghcjs-8.6.0.1/x86_64-linux-ghcjs-8.6.0.1-ghc8_6_5
Private executables installed in:
/nix/store/z5y4q4j1cdnpwqhrfp4hjh0bs3rzjmm5-byteorder-1.0.4-js-unknown-ghcjs/libexec/x86_64-linux-ghcjs-8.6.0.1-ghc8_6_5/byteorder-1.0.4
Data files installed in:
/nix/store/z5y4q4j1cdnpwqhrfp4hjh0bs3rzjmm5-byteorder-1.0.4-js-unknown-ghcjs/share/x86_64-linux-ghcjs-8.6.0.1-ghc8_6_5/byteorder-1.0.4
Documentation installed in:
/nix/store/92xyyl3jr2v0q1lwf4bf2y4mczqd3qkx-byteorder-1.0.4-js-unknown-ghcjs-doc/share/doc/byteorder-1.0.4
Configuration files installed in:
/nix/store/z5y4q4j1cdnpwqhrfp4hjh0bs3rzjmm5-byteorder-1.0.4-js-unknown-ghcjs/etc
No alex found
Using ar found on system at:
/nix/store/q354712mnkw3ky8b5crj7ir7dyv29ylj-binutils-2.31.1/bin/ar
No c2hs found
No cpphs found
No doctest found
Using gcc version 8.3.0 given by user at:
/nix/store/5w1sbkk3kwahwm25dhgnyd4w6kg4znmf-gcc-wrapper-8.3.0/bin/cc
Using ghc version 8.6.0.1 given by user at:
/nix/store/ybwg61a4krmvk127pz7fssk9vdv40lyz-ghcjs-8.6.0.1/bin/ghcjs
Using ghc-pkg version 8.6.4 given by user at:
/nix/store/3zwsp9vc43d0g3bkn7l9w2rpwrm4ly8w-ghc-8.6.4/bin/ghc-pkg
Using ghcjs version 8.6.0.1 found on system at:
/nix/store/ybwg61a4krmvk127pz7fssk9vdv40lyz-ghcjs-8.6.0.1/bin/ghcjs
Using ghcjs-pkg version 8.6.5 found on system at:
/nix/store/ybwg61a4krmvk127pz7fssk9vdv40lyz-ghcjs-8.6.0.1/bin/ghcjs-pkg
No greencard found
Using haddock version 2.20.0 found on system at:
/nix/store/ybwg61a4krmvk127pz7fssk9vdv40lyz-ghcjs-8.6.0.1/bin/haddock-ghcjs
No happy found
Using haskell-suite found on system at: haskell-suite-dummy-location
Using haskell-suite-pkg found on system at: haskell-suite-pkg-dummy-location
No hmake found
Using hpc version 0.67 found on system at:
/nix/store/3zwsp9vc43d0g3bkn7l9w2rpwrm4ly8w-ghc-8.6.4/bin/hpc
Using hsc2hs version 0.68.5 found on system at:
/nix/store/ybwg61a4krmvk127pz7fssk9vdv40lyz-ghcjs-8.6.0.1/bin/hsc2hs-ghcjs
Using hscolour version 1.24 found on system at:
/nix/store/20alg7mn6w9qfh7aiighvkkn2rld6d4s-hscolour-1.24.4/bin/HsColour
No jhc found
Using ld found on system at:
/nix/store/5w1sbkk3kwahwm25dhgnyd4w6kg4znmf-gcc-wrapper-8.3.0/bin/ld
No pkg-config found
Using runghc version 8.6.4 found on system at:
/nix/store/3zwsp9vc43d0g3bkn7l9w2rpwrm4ly8w-ghc-8.6.4/bin/runghc
Using strip version 2.31 found on system at:
/nix/store/q354712mnkw3ky8b5crj7ir7dyv29ylj-binutils-2.31.1/bin/strip
Using tar found on system at:
/nix/store/b6aigimi4gv2a3jxbqpkwwc241n911mr-gnutar-1.32/bin/tar
No uhc found
building
Using Parsec parser
Configuring appar-0.1.8...
Dependency base ==4.*: using base-4.12.0.0
Dependency bytestring -any: using bytestring-0.10.8.2
Source component graph: component lib
Configured component graph:
component appar-0.1.8-9XkwWwiIRQE8H0THpEDlKs
include base-4.12.0.0-BGkpKxWDclNH5NZN2wRc8Q
include bytestring-0.10.8.2-FBklFuapa1a7kq4yflY7Bt
Linked component graph:
unit appar-0.1.8-9XkwWwiIRQE8H0THpEDlKs
include base-4.12.0.0-BGkpKxWDclNH5NZN2wRc8Q
include bytestring-0.10.8.2-FBklFuapa1a7kq4yflY7Bt
Text.Appar.ByteString=appar-0.1.8-9XkwWwiIRQE8H0THpEDlKs:Text.Appar.ByteString,Text.Appar.LazyByteString=appar-0.1.8-9XkwWwiIRQE8H0THpEDlKs:Text.Appar.LazyByteString,Text.Appar.String=appar-0.1.8-9XkwWwiIRQE8H0THpEDlKs:Text.Appar.String
Ready component graph:
definite appar-0.1.8-9XkwWwiIRQE8H0THpEDlKs
depends base-4.12.0.0-BGkpKxWDclNH5NZN2wRc8Q
depends bytestring-0.10.8.2-FBklFuapa1a7kq4yflY7Bt
Using Cabal-2.4.0.1 compiled by ghc-8.6
Using compiler: ghcjs-8.6.0.1
Using install prefix:
/nix/store/q2fqmjdhcf34kp4jmxsab2rxj69d328r-appar-0.1.8-js-unknown-ghcjs
Executables installed in:
/nix/store/q2fqmjdhcf34kp4jmxsab2rxj69d328r-appar-0.1.8-js-unknown-ghcjs/bin
Libraries installed in:
/nix/store/q2fqmjdhcf34kp4jmxsab2rxj69d328r-appar-0.1.8-js-unknown-ghcjs/lib/ghcjs-8.6.0.1/x86_64-linux-ghcjs-8.6.0.1-ghc8_6_5/appar-0.1.8-9XkwWwiIRQE8H0THpEDlKs
Dynamic Libraries installed in:
/nix/store/q2fqmjdhcf34kp4jmxsab2rxj69d328r-appar-0.1.8-js-unknown-ghcjs/lib/ghcjs-8.6.0.1/x86_64-linux-ghcjs-8.6.0.1-ghc8_6_5
Private executables installed in:
/nix/store/q2fqmjdhcf34kp4jmxsab2rxj69d328r-appar-0.1.8-js-unknown-ghcjs/libexec/x86_64-linux-ghcjs-8.6.0.1-ghc8_6_5/appar-0.1.8
Data files installed in:
/nix/store/q2fqmjdhcf34kp4jmxsab2rxj69d328r-appar-0.1.8-js-unknown-ghcjs/share/x86_64-linux-ghcjs-8.6.0.1-ghc8_6_5/appar-0.1.8
Documentation installed in:
/nix/store/cqq3c1j107pm5p4j12749kj0q2413b1w-appar-0.1.8-js-unknown-ghcjs-doc/share/doc/appar-0.1.8
Configuration files installed in:
/nix/store/q2fqmjdhcf34kp4jmxsab2rxj69d328r-appar-0.1.8-js-unknown-ghcjs/etc
No alex found
Using ar found on system at:
/nix/store/q354712mnkw3ky8b5crj7ir7dyv29ylj-binutils-2.31.1/bin/ar
No c2hs found
No cpphs found
No doctest found
Using gcc version 8.3.0 given by user at:
/nix/store/5w1sbkk3kwahwm25dhgnyd4w6kg4znmf-gcc-wrapper-8.3.0/bin/cc
Using ghc version 8.6.0.1 given by user at:
/nix/store/ybwg61a4krmvk127pz7fssk9vdv40lyz-ghcjs-8.6.0.1/bin/ghcjs
Using ghc-pkg version 8.6.4 given by user at:
/nix/store/3zwsp9vc43d0g3bkn7l9w2rpwrm4ly8w-ghc-8.6.4/bin/ghc-pkg
Using ghcjs version 8.6.0.1 found on system at:
/nix/store/ybwg61a4krmvk127pz7fssk9vdv40lyz-ghcjs-8.6.0.1/bin/ghcjs
Using ghcjs-pkg version 8.6.5 found on system at:
/nix/store/ybwg61a4krmvk127pz7fssk9vdv40lyz-ghcjs-8.6.0.1/bin/ghcjs-pkg
No greencard found
Using haddock version 2.20.0 found on system at:
/nix/store/ybwg61a4krmvk127pz7fssk9vdv40lyz-ghcjs-8.6.0.1/bin/haddock-ghcjs
No happy found
Using haskell-suite found on system at: haskell-suite-dummy-location
Using haskell-suite-pkg found on system at: haskell-suite-pkg-dummy-location
No hmake found
Using hpc version 0.67 found on system at:
/nix/store/3zwsp9vc43d0g3bkn7l9w2rpwrm4ly8w-ghc-8.6.4/bin/hpc
Using hsc2hs version 0.68.5 found on system at:
/nix/store/ybwg61a4krmvk127pz7fssk9vdv40lyz-ghcjs-8.6.0.1/bin/hsc2hs-ghcjs
Using hscolour version 1.24 found on system at:
/nix/store/20alg7mn6w9qfh7aiighvkkn2rld6d4s-hscolour-1.24.4/bin/HsColour
No jhc found
Using ld found on system at:
/nix/store/5w1sbkk3kwahwm25dhgnyd4w6kg4znmf-gcc-wrapper-8.3.0/bin/ld
No pkg-config found
Using runghc version 8.6.4 found on system at:
/nix/store/3zwsp9vc43d0g3bkn7l9w2rpwrm4ly8w-ghc-8.6.4/bin/runghc
Using strip version 2.31 found on system at:
/nix/store/q354712mnkw3ky8b5crj7ir7dyv29ylj-binutils-2.31.1/bin/strip
Using tar found on system at:
/nix/store/b6aigimi4gv2a3jxbqpkwwc241n911mr-gnutar-1.32/bin/tar
No uhc found
building
configure: WARNING: unrecognized options: --with-compiler
Preprocessing library for byteorder-1.0.4..
Building library for byteorder-1.0.4..
Preprocessing library for appar-0.1.8..
Building library for appar-0.1.8..
checking build system type... x86_64-pc-linux-gnu
checking host system type... Invalid configuration `js-unknown-ghcjs': machine `js-unknown' not recognized
configure: error: /nix/store/506nnycf7nk22x7n07mjjjl2g8nifpda-bash-4.4-p23/bin/bash //build/network-2.8.0.1/config.sub js-unknown-ghcjs failed
[1 of 1] Compiling System.ByteOrder ( System/ByteOrder.hs, dist/build/System/ByteOrder.js_o )
builder for '/nix/store/m35nyh0i3dhn6ns11ra4q6hrad0nc8yv-network-2.8.0.1-js-unknown-ghcjs.drv' failed with exit code 1
cannot build derivation '/nix/store/671mpdfxp5nrxpf0r1v5p1mhwpfjbnkm-ghcjs-8.6.0.1-with-packages.drv': 1 dependencies couldn't be built
error: build of '/nix/store/671mpdfxp5nrxpf0r1v5p1mhwpfjbnkm-ghcjs-8.6.0.1-with-packages.drv' failed
In the Stackage Nightly build:
./Data/IP/RouteTable/Internal.hs:102: failure in expression `(empty :: IPRTable IPv4 ()) == fromList []' [94/192286]
expected: True
but got:
^
<interactive>:23:11: error:
Not in scope: type constructor or class ‘IPRTable’
./Data/IP/RouteTable/Internal.hs:139: failure in expression `(insert ("127.0.0.1" :: AddrRange IPv4) () empty) == fromList [("12
7.0.0.1",())]'
expected: True
but got:
^
<interactive>:29:2: error:
Variable not in scope: insert :: AddrRange IPv4 -> () -> t0 -> a0
<interactive>:29:44: error:
• Variable not in scope: empty
• Perhaps you meant ‘mempty’ (imported from Prelude)
<interactive>:29:54: error:
Variable not in scope: fromList :: [(a1, ())] -> a0
./Data/IP/RouteTable/Internal.hs:189: failure in expression `delete "127.0.0.1" (insert "127.0.0.1" () empty) == (empty :: IPRTa
ble IPv4 ())'
expected: True
but got:
^
<interactive>:35:63: error:
Not in scope: type constructor or class ‘IPRTable’
./Data/IP/RouteTable/Internal.hs:215: failure in expression `let rt = fromList $ zip v4 v4'
expected:
but got:
^
<interactive>:43:10: error:
Variable not in scope:
fromList :: [(AddrRange IPv4, AddrRange IPv4)] -> t
./Data/IP/RouteTable/Internal.hs:238: failure in expression `let rt = fromList ([("192.168.0.0/24", 1), ("10.10.0.0/16", 2)] ::
[(AddrRange IPv4, Int)])'
expected:
but got:
^ [52/192286]
<interactive>:51:10: error:
Variable not in scope: fromList :: [(AddrRange IPv4, Int)] -> t
./Data/IP/RouteTable/Internal.hs:274: failure in expression `let rt = fromList ([("192.168.0.0/24", 1), ("10.10.0.0/16", 2), ("1
0.0.0.0/8", 3)] :: [(AddrRange IPv4, Int)])'
expected:
but got:
^
<interactive>:59:10: error:
Variable not in scope: fromList :: [(AddrRange IPv4, Int)] -> t
./Data/IP/RouteTable/Internal.hs:305: failure in expression `let rt = fromList $ zip v4 $ repeat ()'
expected:
but got:
^
<interactive>:67:10: error:
Variable not in scope: fromList :: [(AddrRange IPv4, ())] -> t
Examples: 73 Tried: 60 Errors: 0 Failures: 7
At the moment, IPRTable is quite a hungry beast. For example, a table of almost 700k entries without any data occupies at least several hundreds megabytes. This small test [1] peaks at 318 megabytes [2]. The networks list I used is here [3]. For comparison, the same code using Data.Map.Strict requires half that amount [4].
Is there a way to improve this? Another question is whether this is just an IPRTable problem, or are there any other improvements to make?
For example, the 'mask' field could be dropped from AddrRange since it is redundant. Without it and with mlen's type switched to Word8, memory use dropped to 295 megabytes, which is a bit better but clearly not enough.
1: https://gist.github.com/greydot/b61836d8a7991da1bad37ed4ac4b0584
2: > /usr/bin/time -v ./t networks 2>&1 | grep "Maximum res"
Maximum resident set size (kbytes): 318756
3: https://gist.githubusercontent.com/greydot/8ad4b7c947d00060cd385402f36bf881/raw/ac645499a4a139ba0926a791cc0a8da52352bf3b/networks
4: > /usr/bin/time -v ./t networks 2>&1 | grep "Maximum res"
Maximum resident set size (kbytes): 179364
The .cabal
file claims that iproute-1.6.0
is compatible with base-4.[345], and yet the compilation fails:
Building iproute-1.6.0...
Preprocessing library iproute-1.6.0...
Building library...
creating dist/dist-sandbox-a3344949/build
[1 of 8] Compiling Data.IP.Addr ( Data/IP/Addr.hs, dist/dist-sandbox-a3344949/build/Data/IP/Addr.o )
[2 of 8] Compiling Data.IP.Mask ( Data/IP/Mask.hs, dist/dist-sandbox-a3344949/build/Data/IP/Mask.o )
[3 of 8] Compiling Data.IP.Range ( Data/IP/Range.hs, dist/dist-sandbox-a3344949/build/Data/IP/Range.o )
[4 of 8] Compiling Data.IP.Op ( Data/IP/Op.hs, dist/dist-sandbox-a3344949/build/Data/IP/Op.o )
[5 of 8] Compiling Data.IP.Internal ( Data/IP/Internal.hs, dist/dist-sandbox-a3344949/build/Data/IP/Internal.o )
[6 of 8] Compiling Data.IP.RouteTable.Internal ( Data/IP/RouteTable/Internal.hs, dist/dist-sandbox-a3344949/build/Data/IP/RouteTable/Internal.o )
Data/IP/RouteTable/Internal.hs:265:12:
Not in scope: foldl'
Perhaps you meant one of these:
`foldl1' (imported from Data.Foldable),
`foldl1' (imported from Prelude),
`foldl' (imported from Data.Foldable)
xcabal: Error: some packages failed to install:
iproute-1.6.0 failed during the building phase. The exception was:
ExitFailure 1
Module Data.IP
is very convenient for working with addresses (rather than low-level Network.SockAddr
), but for most of such use-cases module Data.IP.RouteTable
is redundant. Splitting these two into separate packages would be definitely useful and attract more users to Data.IP
.
I'm happy to contribute, if we reach an agreement on this.
Thank for you library, i'm work on dns library which use IP
type, dns protocol use bytes to represent ip address. In order to encode ip address to binary protocol, i need a function to convert IP
to [Int]
or something similar.
Maybe we can expose the constructors IPv4
and IPv6
, that would solve the problem.
Best regards.
Currently I see
λ> "1" :: IP
*** Exception: Prelude.read: no parse
it's easily discoverable in REPL but what if IP appears to be somewhere deep inside of some program internal structure?
I think something like Safe.readNote "Data.IP.read"
would be better.
As observed in this GitHub Actions job, iproute-1.7.10
fails to compile with GHC 7.10.3 or earlier:
Building library for iproute-1.7.10..
Data/IP/Builder.hs:4:14: Unsupported extension: StrictData
On the other hand, iproute-1.7.9
compiles without issue.
This is likely because #49 introduced StrictData
without increasing the lower version bounds on base
accordingly.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.