GithubHelp home page GithubHelp logo

byteslice's Issues

Utf8 text from Chunks

It would be nice to have a function to convert from Chunks to utf8-text in the form of either new text or ShortText as otherwise one has to pass through bytestring.

Use of rawmemchr breaks macOS

It appears that rawmemchr is a GNU C library extension, so it's not available on macOS. Here's the output of a recent build using nixpkgs with byteslice-0.1.4.0:

setupCompilerEnvironmentPhase
Build with /nix/store/9ci6pl4h6nrpprwz5803rdjw5i411v5i-ghc-8.6.5.
unpacking sources
unpacking source archive /nix/store/jpjz15059giv5hivxj2y6jhvny3pph6c-byteslice-0.1.4.0.tar.gz
source root is byteslice-0.1.4.0
setting SOURCE_DATE_EPOCH to timestamp 1000000000 of file byteslice-0.1.4.0/test/Main.hs
patching sources
compileBuildDriverPhase
setupCompileFlags: -package-db=/private/tmp/nix-build-byteslice-0.1.4.0.drv-0/setup-package.conf.d -j1 -threaded
[1 of 1] Compiling Main             ( Setup.hs, /private/tmp/nix-build-byteslice-0.1.4.0.drv-0/Main.o )
Linking Setup ...
configuring
configureFlags: --verbose --prefix=/nix/store/2kszxpbcbxpb5l9idqi94rp2gs5d6bka-byteslice-0.1.4.0 --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --docdir=/nix/store/d8vdallxvcmxfc2yd2gizvbll3vd0m4w-byteslice-0.1.4.0-doc/share/doc/byteslice-0.1.4.0 --with-gcc=clang --package-db=/private/tmp/nix-build-byteslice-0.1.4.0.drv-0/package.conf.d --ghc-option=-j1 --disable-split-objs --enable-library-profiling --profiling-detail=exported-functions --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --enable-tests --disable-benchmarks --enable-library-vanilla --disable-library-for-ghci --extra-include-dirs=/nix/store/8bikjdrf8gqzf3k94wgj15nfffvbqx8q-libc++-7.1.0/include --extra-lib-dirs=/nix/store/8bikjdrf8gqzf3k94wgj15nfffvbqx8q-libc++-7.1.0/lib --extra-include-dirs=/nix/store/392ccrszna152zkw3qqdpxhkj672mz08-libc++abi-7.1.0/include --extra-lib-dirs=/nix/store/392ccrszna152zkw3qqdpxhkj672mz08-libc++abi-7.1.0/lib --extra-include-dirs=/nix/store/cqgsr8fkma9kxynf1m3g568b0r8mlnbx-compiler-rt-7.1.0-dev/include --extra-lib-dirs=/nix/store/6lxd7iagq1w0vi174g0nqpy6k30fkfpd-compiler-rt-7.1.0/lib --extra-lib-dirs=/nix/store/s8lxmd7rysm0y54s7lhgdcw9li1gh3la-ncurses-6.1-20190112/lib --extra-lib-dirs=/nix/store/3wfh4j31dmf058ql841jssg7jb39kscy-libffi-3.2.1/lib --extra-lib-dirs=/nix/store/891k5km7j7nrp3dk0swk3999ykr5v79d-gmp-6.1.2/lib --extra-include-dirs=/nix/store/2a6nv5dyicw1rwhjjylrzffyfn7xlpmm-libiconv-osx-10.12.6/include --extra-lib-dirs=/nix/store/2a6nv5dyicw1rwhjjylrzffyfn7xlpmm-libiconv-osx-10.12.6/lib --extra-framework-dirs=/nix/store/yacqh6zpwgi0jy3mk41jfz26ms19cn36-swift-corefoundation/Library/Frameworks
Using Parsec parser
Configuring byteslice-0.1.4.0...
Dependency base >=4.11.1 && <5: using base-4.12.0.0
Dependency primitive ==0.7.*: using primitive-0.7.0.0
Dependency primitive-addr ==0.1.*: using primitive-addr-0.1.0.2
Dependency run-st ==0.1.*: using run-st-0.1.0.0
Dependency base >=4.11.1 && <5: using base-4.12.0.0
Dependency byteslice -any: using byteslice-0.1.4.0
Dependency bytestring -any: using bytestring-0.10.8.2
Dependency primitive -any: using primitive-0.7.0.0
Dependency tasty -any: using tasty-1.2.3
Dependency tasty-hunit -any: using tasty-hunit-0.10.0.2
Dependency tasty-quickcheck -any: using tasty-quickcheck-0.10.1
Source component graph:
    component lib
    component test:test dependency lib
Configured component graph:
    component byteslice-0.1.4.0-B8oKXkIFsWVAIEeoYDOOva
        include base-4.12.0.0
        include primitive-0.7.0.0-FBbjulU1VNABqQupYpKNQ1
        include primitive-addr-0.1.0.2-3GuALBnHAr8LLZWscsoUNm
        include run-st-0.1.0.0-LC2FzI2m2N4J1xAWkN0RAg
    component byteslice-0.1.4.0-GsCSE0DD7S89L4iwtjzQ5H-test
        include base-4.12.0.0
        include byteslice-0.1.4.0-B8oKXkIFsWVAIEeoYDOOva
        include bytestring-0.10.8.2
        include primitive-0.7.0.0-FBbjulU1VNABqQupYpKNQ1
        include tasty-1.2.3-GXjM2qnBr0rCElwqiJDsO2
        include tasty-hunit-0.10.0.2-D3Aj77JLRLeC277AOQ3piV
        include tasty-quickcheck-0.10.1-4wYJ8eXWgRB7jCpZbf7V41
Linked component graph:
    unit byteslice-0.1.4.0-B8oKXkIFsWVAIEeoYDOOva
        include base-4.12.0.0
        include primitive-0.7.0.0-FBbjulU1VNABqQupYpKNQ1
        include primitive-addr-0.1.0.2-3GuALBnHAr8LLZWscsoUNm
        include run-st-0.1.0.0-LC2FzI2m2N4J1xAWkN0RAg
        Data.Bytes=byteslice-0.1.4.0-B8oKXkIFsWVAIEeoYDOOva:Data.Bytes,Data.Bytes.Mutable=byteslice-0.1.4.0-B8oKXkIFsWVAIEeoYDOOva:Data.Bytes.Mutable,Data.Bytes.Types=byteslice-0.1.4.0-B8oKXkIFsWVAIEeoYDOOva:Data.Bytes.Types
    unit byteslice-0.1.4.0-GsCSE0DD7S89L4iwtjzQ5H-test
        include base-4.12.0.0
        include byteslice-0.1.4.0-B8oKXkIFsWVAIEeoYDOOva
        include bytestring-0.10.8.2
        include primitive-0.7.0.0-FBbjulU1VNABqQupYpKNQ1
        include tasty-1.2.3-GXjM2qnBr0rCElwqiJDsO2
        include tasty-hunit-0.10.0.2-D3Aj77JLRLeC277AOQ3piV
        include tasty-quickcheck-0.10.1-4wYJ8eXWgRB7jCpZbf7V41
Ready component graph:
    definite byteslice-0.1.4.0-B8oKXkIFsWVAIEeoYDOOva
        depends base-4.12.0.0
        depends primitive-0.7.0.0-FBbjulU1VNABqQupYpKNQ1
        depends primitive-addr-0.1.0.2-3GuALBnHAr8LLZWscsoUNm
        depends run-st-0.1.0.0-LC2FzI2m2N4J1xAWkN0RAg
    definite byteslice-0.1.4.0-GsCSE0DD7S89L4iwtjzQ5H-test
        depends base-4.12.0.0
        depends byteslice-0.1.4.0-B8oKXkIFsWVAIEeoYDOOva
        depends bytestring-0.10.8.2
        depends primitive-0.7.0.0-FBbjulU1VNABqQupYpKNQ1
        depends tasty-1.2.3-GXjM2qnBr0rCElwqiJDsO2
        depends tasty-hunit-0.10.0.2-D3Aj77JLRLeC277AOQ3piV
        depends tasty-quickcheck-0.10.1-4wYJ8eXWgRB7jCpZbf7V41
Using Cabal-2.4.0.1 compiled by ghc-8.6
Using compiler: ghc-8.6.5
Using install prefix:
/nix/store/2kszxpbcbxpb5l9idqi94rp2gs5d6bka-byteslice-0.1.4.0
Executables installed in:
/nix/store/2kszxpbcbxpb5l9idqi94rp2gs5d6bka-byteslice-0.1.4.0/bin
Libraries installed in:
/nix/store/2kszxpbcbxpb5l9idqi94rp2gs5d6bka-byteslice-0.1.4.0/lib/ghc-8.6.5/x86_64-osx-ghc-8.6.5/byteslice-0.1.4.0-B8oKXkIFsWVAIEeoYDOOva
Dynamic Libraries installed in:
/nix/store/2kszxpbcbxpb5l9idqi94rp2gs5d6bka-byteslice-0.1.4.0/lib/ghc-8.6.5/x86_64-osx-ghc-8.6.5
Private executables installed in:
/nix/store/2kszxpbcbxpb5l9idqi94rp2gs5d6bka-byteslice-0.1.4.0/libexec/x86_64-osx-ghc-8.6.5/byteslice-0.1.4.0
Data files installed in:
/nix/store/2kszxpbcbxpb5l9idqi94rp2gs5d6bka-byteslice-0.1.4.0/share/x86_64-osx-ghc-8.6.5/byteslice-0.1.4.0
Documentation installed in:
/nix/store/d8vdallxvcmxfc2yd2gizvbll3vd0m4w-byteslice-0.1.4.0-doc/share/doc/byteslice-0.1.4.0
Configuration files installed in:
/nix/store/2kszxpbcbxpb5l9idqi94rp2gs5d6bka-byteslice-0.1.4.0/etc
No alex found
Using ar found on system at:
/nix/store/aj65kacim8zjwb63bnxmfcjda0730dm7-cctools-binutils-darwin/bin/ar
No c2hs found
No cpphs found
No doctest found
Using gcc version 4.2.1 given by user at:
/nix/store/x7z7hy6k9dgq1lw02bvd73y9qvqnzfny-clang-wrapper-7.1.0/bin/clang
Using ghc version 8.6.5 found on system at:
/nix/store/9ci6pl4h6nrpprwz5803rdjw5i411v5i-ghc-8.6.5/bin/ghc
Using ghc-pkg version 8.6.5 found on system at:
/nix/store/9ci6pl4h6nrpprwz5803rdjw5i411v5i-ghc-8.6.5/bin/ghc-pkg
No ghcjs found
No ghcjs-pkg found
No greencard found
Using haddock version 2.22.0 found on system at:
/nix/store/9ci6pl4h6nrpprwz5803rdjw5i411v5i-ghc-8.6.5/bin/haddock
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/9ci6pl4h6nrpprwz5803rdjw5i411v5i-ghc-8.6.5/bin/hpc
Using hsc2hs version 0.68.5 found on system at:
/nix/store/9ci6pl4h6nrpprwz5803rdjw5i411v5i-ghc-8.6.5/bin/hsc2hs
Using hscolour version 1.24 found on system at:
/nix/store/6dmh0bq10vljh0myz2abgnnaxwpak404-hscolour-1.24.4/bin/HsColour
No jhc found
Using ld found on system at:
/nix/store/vz3l1d2452785ckl81s9n4qxlikwz7az-cctools-binutils-darwin-wrapper/bin/ld
No pkg-config found
Using runghc version 8.6.5 found on system at:
/nix/store/9ci6pl4h6nrpprwz5803rdjw5i411v5i-ghc-8.6.5/bin/runghc
Using strip found on system at:
/nix/store/aj65kacim8zjwb63bnxmfcjda0730dm7-cctools-binutils-darwin/bin/strip
Using tar found on system at:
/nix/store/2z52b9h1kqnjrzp4x1p6lfr8jql0q40s-gnutar-1.32/bin/tar
No uhc found
building
Preprocessing library for byteslice-0.1.4.0..
Building library for byteslice-0.1.4.0..
[1 of 4] Compiling Data.Bytes.Types ( src/Data/Bytes/Types.hs, dist/build/Data/Bytes/Types.o )
[2 of 4] Compiling Data.Bytes.Mutable ( src/Data/Bytes/Mutable.hs, dist/build/Data/Bytes/Mutable.o )
[3 of 4] Compiling Data.Bytes.Byte  ( src/Data/Bytes/Byte.hs, dist/build/Data/Bytes/Byte.o )
[4 of 4] Compiling Data.Bytes       ( src/Data/Bytes.hs, dist/build/Data/Bytes.o )
[1 of 4] Compiling Data.Bytes.Types ( src/Data/Bytes/Types.hs, dist/build/Data/Bytes/Types.p_o )
ld: warning: /nix/store/2a6nv5dyicw1rwhjjylrzffyfn7xlpmm-libiconv-osx-10.12.6/lib/libiconv.dylib, ignoring unexpected dylib file
[2 of 4] Compiling Data.Bytes.Mutable ( src/Data/Bytes/Mutable.hs, dist/build/Data/Bytes/Mutable.p_o )
ld: warning: /nix/store/2a6nv5dyicw1rwhjjylrzffyfn7xlpmm-libiconv-osx-10.12.6/lib/libiconv.dylib, ignoring unexpected dylib file
[3 of 4] Compiling Data.Bytes.Byte  ( src/Data/Bytes/Byte.hs, dist/build/Data/Bytes/Byte.p_o )
ld: warning: /nix/store/2a6nv5dyicw1rwhjjylrzffyfn7xlpmm-libiconv-osx-10.12.6/lib/libiconv.dylib, ignoring unexpected dylib file
[4 of 4] Compiling Data.Bytes       ( src/Data/Bytes.hs, dist/build/Data/Bytes.p_o )
ld: warning: /nix/store/2a6nv5dyicw1rwhjjylrzffyfn7xlpmm-libiconv-osx-10.12.6/lib/libiconv.dylib, ignoring unexpected dylib file

cbits/bs_custom.c:17:28: error:
     warning: implicit declaration of function 'rawmemchr' is invalid in C99 [-Wimplicit-function-declaration]
        pos = (unsigned char*)(rawmemchr((void*)p,w));
                               ^
   |
17 |     pos = (unsigned char*)(rawmemchr((void*)p,w));
   |                            ^

cbits/bs_custom.c:17:11: error:
     warning: cast to 'unsigned char *' from smaller integer type 'int' [-Wint-to-pointer-cast]
        pos = (unsigned char*)(rawmemchr((void*)p,w));
              ^
   |
17 |     pos = (unsigned char*)(rawmemchr((void*)p,w));
   |           ^
2 warnings generated.

cbits/bs_custom.c:17:28: error:
     warning: implicit declaration of function 'rawmemchr' is invalid in C99 [-Wimplicit-function-declaration]
        pos = (unsigned char*)(rawmemchr((void*)p,w));
                               ^
   |
17 |     pos = (unsigned char*)(rawmemchr((void*)p,w));
   |                            ^

cbits/bs_custom.c:17:11: error:
     warning: cast to 'unsigned char *' from smaller integer type 'int' [-Wint-to-pointer-cast]
        pos = (unsigned char*)(rawmemchr((void*)p,w));
              ^
   |
17 |     pos = (unsigned char*)(rawmemchr((void*)p,w));
   |           ^
2 warnings generated.

cbits/bs_custom.c:17:28: error:
     warning: implicit declaration of function 'rawmemchr' is invalid in C99 [-Wimplicit-function-declaration]
        pos = (unsigned char*)(rawmemchr((void*)p,w));
                               ^
   |
17 |     pos = (unsigned char*)(rawmemchr((void*)p,w));
   |                            ^

cbits/bs_custom.c:17:11: error:
     warning: cast to 'unsigned char *' from smaller integer type 'int' [-Wint-to-pointer-cast]
        pos = (unsigned char*)(rawmemchr((void*)p,w));
              ^
   |
17 |     pos = (unsigned char*)(rawmemchr((void*)p,w));
   |           ^
2 warnings generated.
/nix/store/aj65kacim8zjwb63bnxmfcjda0730dm7-cctools-binutils-darwin/bin/ranlib: file: dist/build/libHSbyteslice-0.1.4.0-B8oKXkIFsWVAIEeoYDOOva-ghc8.6.5.a(Win32Utils.o) has no symbols
/nix/store/aj65kacim8zjwb63bnxmfcjda0730dm7-cctools-binutils-darwin/bin/ranlib: file: dist/build/libHSbyteslice-0.1.4.0-B8oKXkIFsWVAIEeoYDOOva-ghc8.6.5.a(consUtils.o) has no symbols
/nix/store/aj65kacim8zjwb63bnxmfcjda0730dm7-cctools-binutils-darwin/bin/ranlib: file: dist/build/libHSbyteslice-0.1.4.0-B8oKXkIFsWVAIEeoYDOOva-ghc8.6.5.a(longlong.o) has no symbols
/nix/store/aj65kacim8zjwb63bnxmfcjda0730dm7-cctools-binutils-darwin/bin/ranlib: file: dist/build/libHSbyteslice-0.1.4.0-B8oKXkIFsWVAIEeoYDOOva-ghc8.6.5.a(ProfilerReport.o) has no symbols
/nix/store/aj65kacim8zjwb63bnxmfcjda0730dm7-cctools-binutils-darwin/bin/ranlib: file: dist/build/libHSbyteslice-0.1.4.0-B8oKXkIFsWVAIEeoYDOOva-ghc8.6.5.a(OldARMAtomic.o) has no symbols
/nix/store/aj65kacim8zjwb63bnxmfcjda0730dm7-cctools-binutils-darwin/bin/ranlib: file: dist/build/libHSbyteslice-0.1.4.0-B8oKXkIFsWVAIEeoYDOOva-ghc8.6.5.a(RtsDllMain.o) has no symbols
/nix/store/aj65kacim8zjwb63bnxmfcjda0730dm7-cctools-binutils-darwin/bin/ranlib: file: dist/build/libHSbyteslice-0.1.4.0-B8oKXkIFsWVAIEeoYDOOva-ghc8.6.5.a(Trace.o) has no symbols
/nix/store/aj65kacim8zjwb63bnxmfcjda0730dm7-cctools-binutils-darwin/bin/ranlib: file: dist/build/libHSbyteslice-0.1.4.0-B8oKXkIFsWVAIEeoYDOOva-ghc8.6.5.a(ProfilerReportJson.o) has no symbols
/nix/store/aj65kacim8zjwb63bnxmfcjda0730dm7-cctools-binutils-darwin/bin/ranlib: file: dist/build/libHSbyteslice-0.1.4.0-B8oKXkIFsWVAIEeoYDOOva-ghc8.6.5.a(LdvProfile.o) has no symbols
/nix/store/aj65kacim8zjwb63bnxmfcjda0730dm7-cctools-binutils-darwin/bin/ranlib: file: dist/build/libHSbyteslice-0.1.4.0-B8oKXkIFsWVAIEeoYDOOva-ghc8.6.5.a(RetainerProfile.o) has no symbols
/nix/store/aj65kacim8zjwb63bnxmfcjda0730dm7-cctools-binutils-darwin/bin/ranlib: file: dist/build/libHSbyteslice-0.1.4.0-B8oKXkIFsWVAIEeoYDOOva-ghc8.6.5.a(Disassembler.o) has no symbols
/nix/store/aj65kacim8zjwb63bnxmfcjda0730dm7-cctools-binutils-darwin/bin/ranlib: file: dist/build/libHSbyteslice-0.1.4.0-B8oKXkIFsWVAIEeoYDOOva-ghc8.6.5.a(RetainerSet.o) has no symbols
/nix/store/aj65kacim8zjwb63bnxmfcjda0730dm7-cctools-binutils-darwin/bin/ranlib: file: dist/build/libHSbyteslice-0.1.4.0-B8oKXkIFsWVAIEeoYDOOva-ghc8.6.5.a(Profiling.o) has no symbols
/nix/store/aj65kacim8zjwb63bnxmfcjda0730dm7-cctools-binutils-darwin/bin/ranlib: file: dist/build/libHSbyteslice-0.1.4.0-B8oKXkIFsWVAIEeoYDOOva-ghc8.6.5.a(Scav_thr.o) has no symbols
/nix/store/aj65kacim8zjwb63bnxmfcjda0730dm7-cctools-binutils-darwin/bin/ranlib: file: dist/build/libHSbyteslice-0.1.4.0-B8oKXkIFsWVAIEeoYDOOva-ghc8.6.5.a(Sanity.o) has no symbols
/nix/store/aj65kacim8zjwb63bnxmfcjda0730dm7-cctools-binutils-darwin/bin/ranlib: file: dist/build/libHSbyteslice-0.1.4.0-B8oKXkIFsWVAIEeoYDOOva-ghc8.6.5.a(Evac_thr.o) has no symbols
/nix/store/aj65kacim8zjwb63bnxmfcjda0730dm7-cctools-binutils-darwin/bin/ranlib: file: dist/build/libHSbyteslice-0.1.4.0-B8oKXkIFsWVAIEeoYDOOva-ghc8.6.5.a(EventLog.o) has no symbols
/nix/store/aj65kacim8zjwb63bnxmfcjda0730dm7-cctools-binutils-darwin/bin/ranlib: file: dist/build/libHSbyteslice-0.1.4.0-B8oKXkIFsWVAIEeoYDOOva-ghc8.6.5.a(elf_util.o) has no symbols
/nix/store/aj65kacim8zjwb63bnxmfcjda0730dm7-cctools-binutils-darwin/bin/ranlib: file: dist/build/libHSbyteslice-0.1.4.0-B8oKXkIFsWVAIEeoYDOOva-ghc8.6.5.a(elf_reloc.o) has no symbols
/nix/store/aj65kacim8zjwb63bnxmfcjda0730dm7-cctools-binutils-darwin/bin/ranlib: file: dist/build/libHSbyteslice-0.1.4.0-B8oKXkIFsWVAIEeoYDOOva-ghc8.6.5.a(elf_plt_arm.o) has no symbols
/nix/store/aj65kacim8zjwb63bnxmfcjda0730dm7-cctools-binutils-darwin/bin/ranlib: file: dist/build/libHSbyteslice-0.1.4.0-B8oKXkIFsWVAIEeoYDOOva-ghc8.6.5.a(Elf.o) has no symbols
/nix/store/aj65kacim8zjwb63bnxmfcjda0730dm7-cctools-binutils-darwin/bin/ranlib: file: dist/build/libHSbyteslice-0.1.4.0-B8oKXkIFsWVAIEeoYDOOva-ghc8.6.5.a(elf_got.o) has no symbols
/nix/store/aj65kacim8zjwb63bnxmfcjda0730dm7-cctools-binutils-darwin/bin/ranlib: file: dist/build/libHSbyteslice-0.1.4.0-B8oKXkIFsWVAIEeoYDOOva-ghc8.6.5.a(elf_plt_aarch64.o) has no symbols
/nix/store/aj65kacim8zjwb63bnxmfcjda0730dm7-cctools-binutils-darwin/bin/ranlib: file: dist/build/libHSbyteslice-0.1.4.0-B8oKXkIFsWVAIEeoYDOOva-ghc8.6.5.a(elf_plt.o) has no symbols
/nix/store/aj65kacim8zjwb63bnxmfcjda0730dm7-cctools-binutils-darwin/bin/ranlib: file: dist/build/libHSbyteslice-0.1.4.0-B8oKXkIFsWVAIEeoYDOOva-ghc8.6.5.a(PEi386.o) has no symbols
/nix/store/aj65kacim8zjwb63bnxmfcjda0730dm7-cctools-binutils-darwin/bin/ranlib: file: dist/build/libHSbyteslice-0.1.4.0-B8oKXkIFsWVAIEeoYDOOva-ghc8.6.5.a(elf_reloc_aarch64.o) has no symbols
Preprocessing test suite 'test' for byteslice-0.1.4.0..
Building test suite 'test' for byteslice-0.1.4.0..
[1 of 1] Compiling Main             ( test/Main.hs, dist/build/test/test-tmp/Main.o )
Linking dist/build/test/test ...
Undefined symbols for architecture x86_64:
  "_rawmemchr", referenced from:
      _memchr_ba_many in libHSbyteslice-0.1.4.0-B8oKXkIFsWVAIEeoYDOOva.a(bs_custom.o)
ld: symbol(s) not found for architecture x86_64
clang-7: error: linker command failed with exit code 1 (use -v to see invocation)
`cc' failed in phase `Linker'. (Exit code: 1)
builder for '/nix/store/1jsxdndm2401bqvx3i5c6mxb76vjxb0n-byteslice-0.1.4.0.drv' failed with exit code 1

Decode decimal-encoded numbers

Because of how GHC works, bytesmith always boxes the result of parse. This is normally fine. The result of a parse is typically some kind of boxed data that can live happily on the heap. However, in several different projects, I've ended up needed to define

decodeWord64 :: Bytes -> Maybe Word64
decodeWord64 = Parser.parseBytesMaybe (Latin.decWord64 ())

It's sad to have to allocate for the W# data constructor. I've been avoiding adding Char8/Ascii/Latin module to this library, but I think that Data.Bytes.Latin would be a good place for these:

decWord64 :: Bytes -> Maybe Word64
splitDecWord64 :: Bytes -> Maybe (Word64, Bytes)

The second variant allows extra bytes to be leftover. The first does not.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.