Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated README

  • Loading branch information...
commit db33a0c69813404090a21a50e7cc56d142dcc951 1 parent f7ffa47
@djhworld authored
Showing with 17 additions and 10 deletions.
  1. +10 −7 README.md
  2. +7 −3 strex.go
View
17 README.md
@@ -1,6 +1,6 @@
-#strings_ext
+#strex
-This is a small library that implements some of the functions from the ```Data.List``` package in Haskell that are only applicable to strings. The code is *probably* **very inefficient**, but I found it enjoyable as an intellectual excercise to port these useful functions over to Go.
+This is a small library that implements some of the functions from the `Data.List` package in Haskell that are only applicable to strings.
##Install
@@ -8,19 +8,22 @@ This is a small library that implements some of the functions from the ```Data.L
##Rationale
-Because I enjoy programming in Haskell and want some of the standard library features found ```Data.List``` to be in Go
+Because I enjoy programming in Haskell and want some of the standard library features found `Data.List` to be in Go, plus I found it an enjoyable intellectual excercise too.
## But why only for strings? Why not use empty interfaces and make your code "generic" so it works with any datatype?
-Personally, I don't see the use of the empty interface to be best practise when you want to guarantee type safety at runtime. I'm a strong advocate for compile time type checking and I feel it would not be appropriate to use ```interface{}``` as a half-way house to generics.
+Personally, I don't see the use of the empty interface to be best practise when you want to guarantee type safety at runtime. I'm a strong advocate for compile time type checking and I feel it would not be appropriate to use `interface{}` as a half-way house to generics.
-As soon as the Go team implement generics/parametric polymorphism into the language I'll almost certainly drop this library and create a more "generic" solution akin to ```Data.List```. For those looking to go down the ```interface{}``` route now, please see the [Seq](https://github.com/zot/seq/blob/release/seq.go) library by Bill Burdick
+As soon as the Go team implement generics/parametric polymorphism into the language I'll almost certainly drop this library and create a more "generic" solution akin to `Data.List`. For those looking to go down the `interface{}` route now, please see the [Seq](https://github.com/zot/seq/blob/release/seq.go) library by Bill Burdick
##Why no Map?
-See [strings.Map](http://golang.org/pkg/strings/#Map) for the default implementation, although this version is NOT like Haskell's ```map``` in the sense that you can only input and output a string, no other type.
+See [strings.Map](http://golang.org/pkg/strings/#Map) for the default implementation, although this version is NOT like Haskell's `map` in the sense that you can only input and output a string, no other type.
##Documentation
-[http://go.pkgdoc.org/github.com/djhworld/strings_ext](http://go.pkgdoc.org/github.com/djhworld/strings_ext)
+[http://go.pkgdoc.org/github.com/djhworld/strex](http://go.pkgdoc.org/github.com/djhworld/strex)
+# With thanks
+
+To the people on reddit [who helped me with this code.](http://www.reddit.com/r/golang/comments/yfurz/made_a_small_library_critique_welcome/) Originally, I implemented all the functions in a Haskell like style with plenty of recursion and other inefficiencies that don't work so well in a non tail-call optimised language. With the help from the users such as ["rogpeppe"](https://github.com/rogpeppe) I was able to tighten up the package a lot with much faster code.
View
10 strex.go
@@ -1,9 +1,13 @@
/*
Package that adds a few extra features to the strings package.
-These functions are very high level and may not be very efficient. Most of the
-functions take inspiration from the Data.List package found in the Haskell programming
-language
+These functions are very high level and take inspiration from the Data.List package
+found in the Haskell programming language
+
+With thanks to reddit users `rogpeppe`, `DavidScone`, `DisposaBoy` who helped me in making
+this library better and quicker
+
+Daniel Harper (djhworld) 2012
*/
package strex
Please sign in to comment.
Something went wrong with that request. Please try again.