Code Monkey home page Code Monkey logo

purescript-catenable-lists's Introduction

PureScript

A small strongly typed programming language with expressive types that compiles to JavaScript, written in and inspired by Haskell.

Hackage Build Status

Language info

Resources

Help!

Community Spaces

The following spaces are governed by the PureScript Community Code of Conduct. The majority of PureScript users use these spaces to discuss and collaborate on PureScript-related topics:

Unaffiliated Spaces

Some PureScript users also collaborate in the below spaces. These do not fall under the code of conduct linked above. They may have no code of conduct or one very different than the one linked above.

purescript-catenable-lists's People

Contributors

acple avatar bodil avatar ethul avatar garyb avatar jordanmartinez avatar kl0tl avatar kritzcreek avatar matthewleon avatar milesfrain avatar natefaubion avatar paluh avatar thomashoneyman avatar

Stargazers

 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  avatar  avatar  avatar

purescript-catenable-lists's Issues

Double-end CatQueue?

Hi Guys
Just wondering if you've considered adding double endedness to CatQueue?
I see the papers mention it as a dequeue, and @MonoidMusician speculated it was absent just for time?

Thanks
Alex

Mixed benchmark

I'd be interested to see a benchmark for, say, N cons operations followed by N uncons operations, or snoc-then-uncons, etc.

Remove deprecated MonadZero instance (v0.15.0 PS)

When we make the next round of breaking changes (e.g. v0.15.0 of PureScript), this is a reminder to remove all MonadZero instances. Relates to #42, which censors user-defined warnings due to the MonadZero instance. The build command should be updated to fail on any warning once we've removed the instance.

Reinstate benchotron usage

For now I've updated the tests and whatnot to use the RCs, but once everything is properly released and we start updating dependants we can put the benchmarks back in too.

Clarification of CatQueue implementation

The code for CatQueue cites Okasaki, 1995:

-- | See [Simple and Efficient Purely Functional Queues and Dequeues](http://www.westpoint.edu/eecs/SiteAssets/SitePages/Faculty%20Publication%20Documents/Okasaki/jfp95queue.pdf) (Okasaki 1995)

This is a bit puzzling, as the actual implementation is not the lazy-list based one proposed in that paper, but rather the more "traditional" implementation that Okasaki attributes to other authors:

The standard trick, reinvented many times (Hood and Melville, 1981; Gries, 1981;
Burton, 1982), is to represent the queue as a pair of lists hL, Ri where L is the front
portion of the queue and R is the rear portion of the queue in reverse order...

Perhaps it is worth amending that comment?

Additional instances

Is there a fundamental reason for the lack of Functor, etc other than need and the will to implement them?

CatQueue instances

  • Eq
  • Ord
  • Semigroup
  • Monoid
  • Foldable
  • Unfoldable
  • Traversable
  • Functor
  • Apply
  • Applicative
  • Bind
  • Monad
  • Alt
  • Plus
  • Alternative
  • MonadZero
  • MonadPlus

CatQueue: prepend

The Semigroup instance and append in #30 are implemented as foldl snoc that appends successive elements from the CatQueue on the right. In most cases, that's probably what you'd want. One could also implement a prepend as a reverse and foldl cons of elements from the left CatQueue.

Failed pattern match in uncons

Error: Failed pattern match: DList
    at Object.uncons (/path/purescript/purescript-free-bench/output/Data.DList/index.js:36:15)
    at /path/purescript/purescript-free-bench/output/Data.CList/index.js:97:46
    at /path/purescript/purescript-free-bench/output/Data.CList/index.js:118:29
    at linkAll (/path/purescript/purescript-free-bench/output/Data.CList/index.js:130:35)
    at /path/purescript/purescript-free-bench/output/Data.CList/index.js:143:24
    at Object.uncons (/path/purescript/purescript-free-bench/output/Data.CList/index.js:146:11)
    at toView (/path/purescript/purescript-free-bench/output/Control.Monad.Free/index.js:67:34)
    at go (/path/purescript/purescript-free-bench/output/Control.Monad.Free/index.js:90:27)
    at /path/purescript/purescript-free-bench/output/Prelude/index.js:175:22
    at go (/path/purescript/purescript-free-bench/output/Control.Monad.Rec.Class/index.js:93:38)

stack safe folds

foldMap and foldl on CatList are not stack-safe. They could be.

separate lib for CatQueue

There seems to be nothing particularly "Catty" about CatQueue. Perhaps, with the additional PRs I've made, it could live in its own lib, and get pulled in here?

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.