Code Monkey home page Code Monkey logo

minimallist's People

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

Watchers

 avatar  avatar  avatar  avatar

Forkers

respatialized

minimallist's Issues

Roadmap

Hello @green-coder how are you? Very nice library this one. Congrats! I am contributing with spec-tools for a while now and I like this subject. Are you planning to work alone in this project or there are plans to onboard new people?

I would like to contribute with some code in spare time if possible. A road map of future enhancements and ideas would be very welcome to understand where are you heading!

Cheers!

Add support for a scalar range node type

This would allow the count-model to be more readable, which will make generating collections of the right size easier.

Proposed format:

{:type :range
 :min 1    ; inclusive, optional
 :max 3    ; inclusive, optional
 :inf -5.0 ; exclusive, optional
 :sup 5.0  ; exclusive, optional
 }

:min and :inf cannot appear at the same time in the node,
:max and :sup cannot appear at the same time in the node.

:map-of should be about map entries, not about separate keys and values

In some cases, there is a correlation between what a key and its associated value should be.

An example of that is the format of Clojure's destructuring in bindings.

;; This is a legal destructuring form.
(let [{first-name :first-name
       last-name :last-name
       :keys [foo bar]
       :as foobar} {:first-name "green"
                    :last-name "coder"
                    :foo 'foo
                    :bar 'bar}]
  [first-name last-name foo bar foobar])

Changing :map-of to handle map entries will still allow the users to do whatever was possible with separate models for keys and values, and will additionally permit to handle cases like the one in the example above.

The change to :map-of is going to be a breaking change.

Write a documentation

It should cover:

  • How to write a model using the helper namespace,
  • How to create and use generators,
  • How to validate a data w.r.t. a model.

Implement the `explain` function

The explain function should indicate the reason why a data would not match a model.

As Minimallist is less and less experimental, used by Vrac on large models, this function really start to become important.

Required entries don't show up in generated maps

I previously reported this issue in the #minimallist channel on the Clojurians slack.

I'm facing an issue when I'm trying to generate map data with some required keys and some optional keys. Here's what reproduces the issue for me:

(require '[minimallist.helper :as h])
(require '[clojure.test.check.generators :as gen])(-> (h/map)
      (h/with-optional-entries [:str (-> (h/fn string?)
                                         (h/with-test-check-gen gen/string-ascii))])
      (h/with-entries [:int (-> (h/fn int?)
                                (h/with-test-check-gen gen/nat))])
      mg/gen
      (gen/sample 20))

A few samples show plenty of results that have the :str key without the :int key. What I expect (at least sometimes) to see is the reverse: maps that have the :int key but not the :str key. But I don't:

(-> (h/map)
      (h/with-optional-entries [:str (-> (h/fn string?)
                                         (h/with-test-check-gen gen/string-ascii))])
      (h/with-entries [:int (-> (h/fn int?)
                                (h/with-test-check-gen gen/nat))])
      mg/gen
      (gen/sample 2000)
      (#(filter (fn [m] (and (contains? m :int)
                             (not (contains? m :str)))) %)))

This always returns an empty list, regardless of sample size.

Bug in model reference resolution - shadowed model in context

In the following model, the reference to 'bar is resolved to the wrong model.

(h/let ['foo (h/ref 'bar)
        'bar (h/fn int?)]
       (h/let ['bar (h/fn string?)]
              (h/ref 'foo))

The right way to fix it is to recover the full context of when resolving references.

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.