Giter Site home page Giter Site logo

c-cube / ocaml-bigstring Goto Github PK

View Code? Open in Web Editor NEW
15.0 5.0 4.0 69 KB

Overlay over bigarrays of chars

Home Page: http://c-cube.github.io/ocaml-bigstring/

License: BSD 2-Clause "Simplified" License

Makefile 0.41% OCaml 85.78% C 13.81%
ocaml bigarray string memory-mapping

ocaml-bigstring's Introduction

Bigstring Build Status

NOTE: I recommend using bigstringaf now. It has fast operations written in C and is better maintained.

A set of utils for dealing with bigarrays of char as if they were proper OCaml strings.

Usage

#require "bigstring";;
#install_printer Bigstring.print;;
module B = Bigstring;;

# let s1 = B.of_string "  abcd ";;
val s1 : B.t = "  abcd "

# let s2 = B.trim s1;;
val s2 : B.t = "abcd"

# B.index ~c:'b' s2 ;;
- : int = 1

# let str = "__";;
val str : string = "__"

# B.blit_of_string str 0 s2 1 2;;
- : unit = ()

# s2;;
- : B.t = "a__d"

Documentation

http://c-cube.github.io/ocaml-bigstring/

License

This code is free, under the BSD license.

ocaml-bigstring's People

Contributors

c-cube avatar vbmithr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ocaml-bigstring's Issues

install .cmx as well

Warning 58: no cmx file was found in path for module Bigstring, and its interface was not compiled with -opaque

Add I/O functions

Hi,
would you mind adding those two functions to bigstring-unix? They need C stubs. Otherwise I would like to publish them as bigstring-io. inhabitedtype/bigstringaf#34
I could prepare a pull-request, of course.
These are the functions I'd like to add:

val read  : Unix.file_descr -> ?off:int -> ?len:int -> t -> int
val write : Unix.file_descr -> ?off:int -> ?len:int -> t -> int

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.