Coder Social home page Coder Social logo

data-clist's People

Contributors

erikd avatar felixonmars avatar ivan-m avatar jchia avatar jeremyjh avatar sw17ch avatar utdemir avatar vrom911 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

data-clist's Issues

Eq instance should imply substitutivity

As stated here,

if x == y = True and f is a "public" function whose return type is an instance of Eq, then f x == f y = True

Currently we have, e.g.

>  fromList [1,2,3] == fromList [2,3,1]
True
> toList (fromList [1,2,3]) == toList (fromList [2,3,1])
False

I think that the Eq instance should be just derived and current implementation should be exported as separate function. Besides, using allRotations is surely not the most optimal way of implementing the desired behavior. What if two CLists contain different sets of elements? Current implementation will check all the rotations, while it is possible to return False after finding the first element which is present in one of the given CLists but not in the other.

add Foldable and Traversable instances?

As the title suggests; can we add Foldable and Traversable instances? This would give us many functions (i.e. minimum, maximum, sum, traverse, etc) for free.

support deepseq-1.5 (GHC 9.8)

GHC 9.8 bundles deepseq-1.5, which is excluded by data-clist upper bound:

 [__6] next goal: data-clist (dependency of brick)
[__6] rejecting: data-clist-0.2, data-clist-0.1.2.3, data-clist-0.1.2.2, data-clist-0.1.2.1, data-clist-0.1.2.0, data-clist-0.1.1.0, data-clist-0.1.0.0 (conflict: pretty => deepseq==1.5.0.0/installed-e7ed, data-clist => deepseq>=1.1 && <1.5)
[__6] rejecting: data-clist-0.0.7.4 (conflict: brick => data-clist>=0.1)
[__6] skipping: data-clist-0.0.7.3, data-clist-0.0.7.2, data-clist-0.0.7.1, data-clist-0.0.7, data-clist-0.0.6, data-clist-0.0.5, data-clist-0.0.4, data-clist-0.0.3, data-clist-0.0.2, data-clist-0.0.1 (has the same characteristics that caused the previous version to fail: excluded by constraint '>=0.1' from 'brick')

needs a release for QuickCheck 2.13+

Thanks for this lib. I'm interested in #16 and brick and stackage, but here's a more focussed issue: are there any plans for a new release of data-clist compatible with QuickCheck 2.13, released in march ?

Upperbound on QuickCheck

Can we bump the upperbound on QuickCheck to allow 2.9? That seems to work fine, and is currently blocking me from releasing a new version of one of my own packages. There even seems to be a pr #12 that does this.

Weird Foldable.toList behaviour

The current Foldable instance leads to somewhat weird behaviour in which the elements are produced in a weird order, as evidenced by the following example:

>>> import qualified Data.Foldable as F
>>> import qualified Data.CircularList as C
>>> mapM_ print $ fmap (\cl -> (cl, F.toList cl, C.toList cl)) $ C.allRotations $ C.fromList [0,8,5,4,1]
(fromList [0,8,5,4,1],[0,8,5,1,4],[0,8,5,4,1])
(fromList [8,5,4,1,0],[8,5,0,1,4],[8,5,4,1,0])
(fromList [5,4,1,0,8],[5,8,0,1,4],[5,4,1,0,8])
(fromList [1,0,8,5,4],[1,0,8,5,4],[1,0,8,5,4])
(fromList [4,1,0,8,5],[4,1,0,8,5],[4,1,0,8,5])

I would probably expect Foldable's toList to behave the same way as C.toList

State asymptotic running times

It would be great if you could mention asymptotic running times. I briefly scanned through the code, seems like most should be what you expect, (i.e. O(1) amortized for a single rotate/insert) or O(n) for full traversels. The only exceptions are removeL and removeR, Alternatingly calling removeL and removeR looks like that is going to be expensive (i.e. linear time per operation)?

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.