Skip to content

Commit

Permalink
Fix ReadMe's driver design link
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony Hannan committed Jul 13, 2011
1 parent b3a4ceb commit 5cc5ec4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -5,5 +5,5 @@ This is the Haskell MongoDB driver (client). [MongoDB](http://www.mongodb.org) i
* [Tutorial](http://github.com/TonyGen/mongoDB-haskell/blob/master/doc/tutorial.md)
* [Driver API](http://hackage.haskell.org/package/mongoDB)
* [MapReduce example](http://github.com/TonyGen/mongoDB-haskell/blob/master/doc/map-reduce-example.md)
* [Driver design](http://github.com/TonyGen/mongoDB-haskell/blob/master/doc/design.md)
* [Driver design](http://github.com/TonyGen/mongoDB-haskell/blob/master/doc/Article1.md)
* [MongoDB DBMS](http://www.mongodb.org)
2 changes: 1 addition & 1 deletion doc/Article1.md
Expand Up @@ -11,7 +11,7 @@ A *Value* is one of several basic types, which includes primitive types like Boo

*UString* is a type synonym for CompactString which is a UTF-8 encoded string from the [compact-string package](http://hackage.haskell.org/package/compact-string-fix). I chose this package over the [text package](http://hackage.haskell.org/package/text) because its native format is UTF-8 while text's native format is UTF-16 and thus would spend more time serializing to BSON which requires UTF-8. If and when the text package changes its native format to UTF-8 I will switch to it. In the meantime, you can make *Text* an instance of Val to automatically convert it to/from UString.

UString is an instance of *IsString* so literal strings can be interpreted as UStrings. Use the Language extension [*OverloadedStrings*](http://www.haskell.org/ghc/docs/7.0.4/html/users_guide/type-class-extensions.html#Overloaded+string+literals) to enable this. If you don't use this extension, use the *u* function to convert a String to a UString. Field labels are UStrings.
UString is an instance of *IsString* so literal strings can be interpreted as UStrings. Use the Language extension [*OverloadedStrings*](http://www.haskell.org/ghc/docs/7.0.4/html/users_guide/type-class-extensions.html#Overloaded+string+literals) to enable this. If you don't use this extension, use the *u* function to convert a String to a UString. Field labels are also UStrings.

You may want to define fields ahead of time to help catch typos. For example, you can define `name = ("name" =:) :: UString -> Field` and `score = ("score" =:) :: Int -> Field`, and then construct a document as `[name "Tony", score 42]`. This will ensure your fields have the correct label and type, and is more succinct.

Expand Down

0 comments on commit 5cc5ec4

Please sign in to comment.