Giter Club home page Giter Club logo

case-insensitive's People

Contributors

basvandijk avatar bergmark avatar bgamari avatar danburton avatar dougburke avatar hvr avatar hvriedel avatar ikarius avatar kazu-yamamoto avatar luite avatar phadej avatar ryanglscott avatar sol avatar tibbe avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

case-insensitive's Issues

documentation: provide some explanation of "case folding"

I just spent quite a while digging, first through the source, finally ending up at http://hackage.haskell.org/package/text-1.2.4.0/docs/Data-Text.html#v:toCaseFold while trying to figure out what the result of toCaseFold is actually like.

It would probably be useful to others to do one or more of the following.

  • add a sentence in the general parts of the documentation noting that case folding is mostly but not quite lowercasing (perhaps with a link to a more detailed explanation)
  • in the documentation of foldedCase, explicitly state that the result depends on the FoldCase instance (instead of just a "see also")
  • document the behaviour of the individual FoldCase instances

Some non-ascii unicode chars are not case-folded correctly.

import qualified Data.CaseInsensitive as CI
import qualified Data.Char as Char

main :: IO ()
main = do
  print ((Char.toLower <$> ("\5042" :: String)) == "\43906")
  print ((CI.foldCase (CI.mk ("\5042" :: String))) == "\43906")

{-
*Main> :main
True
False
-}

Thanks to QuickCheck! :)

Consider moving "original" to .Unsafe

It's debatable whether it's a true law of Eq (opinions varied in #haskell), but I'd say it certainly is an expectation that if a == b then f a == f b. The original function breaks this for the CI type.

The repo clones awkwardly on case-insensitive filesystems

This is somewhat ironic (was it intentional??) but if I clone this on a case-insensitive filesystem, the Data and data folders overlap. This is usually not the end of the world, but it breaks hashing when we use this package in nix and similar hash-centric systems. Can the folder structure be rearranged a bit?

/cc @ryantrinkle @jwiegley

CI ByteString is slow

Constructing a CI ByteString will ask for pinned memory, but usually the ByteString is short so this behavior not only add overhead but contribute to heap fragment. I think we can do better here, any idea?

Derive SYB's Data

Because the constructor is not exported it's impossible to define instances out of your library.

If you don't want to derive it, at least, please export the constructors.

Doesn't build with ghc-7.2.1-rc1

The base version dependency in case-insensitive.cabal is too restrictive, and doesn't allow building on GHC 7.2.x.

Could you please relax the version constraint? Thanks!

NoImplicitPrelude breaks GHC 6.12.1

I'm trying to build an app to deploy to Debian stable on production, and this is the version of GHC it has. Removing the NoImplicitPrelude extension makes the library work again (it complains about no fromInteger and >>)

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.