Giter Club home page Giter Club logo

ulid's People

Contributors

ad-si avatar adamflott avatar brandonhamilton avatar steven777400 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  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ulid's Issues

Ord instance appears to be broken

λ> accountId0
Id {unId = 00000000000000000000000000}
λ> accountId1
Id {unId = 00000000000000000000000001}
λ> hash accountId0
5618888146721150863
λ> hash accountId1
5618887047209522684
λ> accountId0 == accountId1
False
λ> -- So far so good, but...
λ> accountId0 < accountId1
False
λ> -- and...
λ> accountId0 > accountId1
False

Are you going to upload to Hackage?

Right now I can only use the 0.3.0.0 but that one has this bug about the Random instance

ulid                         > /tmp/stack-4712581ffce97e13/ulid-0.3.0.0/src/Data/ULID.hs:98:5: error:
ulid                         >     ‘randomIO’ is not a (visible) method of class ‘R.Random’
ulid                         >    |
ulid                         > 98 |     randomIO = getULID
ulid                         >    |     ^^^^^^^^

Thanks!!!

ULID's are supposed to be sortable wrt time

As I understand the ULID spec, events within the same milisecond should have mostly the same random component (the prior random + 1 to be exact). This is a rather important selling point of ULID!

0.3.0 : build error with `stack build` 2.3.1

Just had this build failure after importing ulid-0.3.0 :

ulid > Preprocessing executable 'ulid-exe' for ulid-0.3.0.0..
ulid > Building executable 'ulid-exe' for ulid-0.3.0.0..
ulid > [1 of 1] Compiling Main
ulid >
ulid > /tmp/stack-087c00927eb5aedb/ulid-0.3.0.0/app/Main.hs:18:39: error:
ulid > parse error on input ‘-- ^ POSIX Time in milliseconds’
ulid > |
ulid > 18 | ulid2 <- getULIDTime 1469918176.385 -- ^ POSIX Time in milliseconds
ulid > | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ulid >

stack Version 2.3.1, Git revision de2a7b694f07de7e6cf17f8c92338c16286b2878 (8103 commits) x86_64 hpack-0.33.0

Don't use `unsafePerformIO`, and migrate to random-1.2.

I think the ULID type shouldn't be an instance of Random (or Uniform since random-1.2) by taking the trouble to use unsafePerfomIO.

The random function should be pure: if the argument g is the same value, the result of random g should be same. Breaking this rule can cause some troubles. For example, we can't reproduce the same value with the same generator (perhaps deserialized from a database). I haven't actually got troubled with such a case, but I think it'll cause some hard-to-find bug some day.

My suggestion is to drop the support for Random instance of ULID, and define the instance Random ULIDRandom instead. That makes the package safely available.

Speaking of the random package, due to the changes in random-1.2, now this package can't be built with the latest random. So how about fixing the problem and supporting random-1.2 at the same time?

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.