Giter VIP home page Giter VIP logo

yampa's Issues

Haddock documentation for FRP.Yampa.Integration.count

Many functions lack documentation.

One such function is count, which produces a signal carrying an Event with the number of times the input signal was holding an Event.

It would be great if that could be documented ;)

reactimate's type requirements seem contrived

reactimate seems to have some redundancy in its type requirements, more specifically, the two Bool inputs required for the input and output actions.

Is there a good reason to not introduce some wrapped functions which simplify this? For instance, I wrote a small module, which I've uploaded in this gist (please forgive my naming), which I find I use rather than reactimate directly.

(With regards to issue #15, sReactimate generalises to all monads with no changes, and yampaMain should be is fairly straightforward to adjust for MonadIO actions.)

Document Yampa in the wild

Please, comment below and list Yampa projects, and also whether they are maintained (you can tag the maintainer by using their github handle, for example, mine is @ivanperez-keera).

Create helloworld combining HTML generation and Yampa

Idea: create a Yampa program that generates an HTML file that changes (for instance, a text box that always shows the current mouse coordinate).

Prior knowledge of blaze-html or some other library to generate HTML would be useful.

Add count to Yampa's main export list

Somewhere during the module restructuring, I left the function count out. This should probably be exported by FRP.Yampa (it actually broke some projects, apparently).

It's currently with the Integration stuff.

Create SDL2 demo

It would be nice to add an SDL2 demo so that people know where to start :)

Review/Eliminate Forceable

Yampa defines a Forceable type class that implements one-level-deep NF evaluation. Default implementations are given for tuples and lists.

Instances are also given for Event and other types but, afaict, the main class function force is not used anywhere.

Maybe it should be removed? There's other, more interesting forms of forcing (namely, deepseq).

Should FRP.Yampa re-export all modules

The module FRP.Yampa re-exports individual functions and types. Maybe it should just re-export all modules.

It would be important to check that the API does not change. I don't know if there is an automatic or systematic way of doing this. Maybe browse with ghci, sort the output, and diff?

Infinite Loop When using (d)pSwitchB

I'm having issues using pSwitchB. I've made a simple program below that demonstrates the issue. When the switch occurs (input value is 3), this goes into an infinite loop, presumably because each time the switch occurs, a new one is immediately triggered. I though using dpSwitchB would solve this problem, but it only delays the issue till the next sample. Am I using (d)pSwitchB incorrectly?

module Main where

import FRP.Yampa

eventAt3 :: SF Integer (Event ())
eventAt3 = arr $ \t -> if t == 3
                        then Event ()
                        else NoEvent

swit :: [SF Integer (Event ())] -> SF Integer [Event ()]
swit actors = pSwitchB
        actors
        (arr (\(_, es) -> () <$ catEvents es))
        (\colSfs _ -> swit colSfs)

main :: IO ()
main = print $ embed (swit [eventAt3]) (0, [(1,Just 1),(1,Just 1),(1,Just 2),(1,Just 3),(1,Just 4)])

Compile a list of Yampa diagrams

A while back, @lambdor kindly put on his website a list of Yampa diagrams, with sources: http://lambdor.net/?author=1

Over time and after writing several articles, these kinds of diagrams have become pretty useful. However, in order to use them, we need to also be able to credit them properly.

I think it would be great to have a list/table with the images, a link to the svg, and a caption/bibtex entry that credits @lambdor properly.

Henrik Nilsson and Antony Courtney also have some diagrams in dia (what I have been using, mostly), which could also be added.

DatatypeContexts is deprecated

I find that DatatypeContexts appear several times in this project.
(i.e. Point2/3, Vector2/3 and MergeableRecord)

According to this proposal: https://ghc.haskell.org/trac/haskell-prime/wiki/NoDatatypeContexts
DatatypeContexts is deprecated.
It was widely considered a misfeature, and has been removed from the Haskell language.
Although cabal-install makes Yampa buildable even in the latest GHC(by turning the flag on automatically).

Instead, we should use ExistentialQuantification(or GADTs) to add constraints on constructors.
For typeclass deriving, we could enable the StandaloneDeriving for convenience.

Well, actually I'm not sure if DatatypeContexts was necessary in this case.
I'll apologize if I misunderstood the usage here.

Yampa does not build on GHC 7.10

(via Neil Sculthorpe):

Yampa won't install because of the lack of an Applicative instance for Task. (A consequence of the Applicative/Monad proposal.) This is using the latest Hackage version.

[16 of 16] Compiling FRP.Yampa.Task ( src/FRP/Yampa/Task.hs,
dist/build/FRP/Yampa/Task.o )

src/FRP/Yampa/Task.hs:95:10:
No instance for (Applicative (Task a b))
arising from the superclasses of an instance declaration
In the instance declaration for ‘Monad (Task a b)’
Failed to install Yampa-0.9.6

Review/Eliminate MergeableRecord

MergeableRecord is not used by any other module. It's an implementation of update operations on records by using type classes. Given the existing work on extensible records & lenses, plus the fact that it's not used, I think it would be best to remove it.

Note: It's exported, so it makes Yampa not backwards compatible.

Is it possible to replace the current vector-about modules with the outside one?

I am wondering if it is a better choice for using linear rather than the current vector-about modules.

As can be seen, in the yampa, there are a variety of modules dealing with vectors or vector space. It is obvious that the modules (AffineSpace, VectorSpace, Vector2, Geometry) are not neccesary, for main yampa functions do not closely rely on it.

I have found that the only usage of this and that vector modules is in the Intergration module. If choosing linear as the replacement, the only thing to do is changing the constraints (VectorSpace a s) to the (Additive f, Num a).

Acturely, the similar discussion (http://mailman.cs.yale.edu/pipermail/yampa-users/2012-May/) happened 3 years ago. The main concern for the introduce of a third party vector library is the increase of dependency. Not only in yampa, but in other project the same argument (haskell-game/sdl2#3) existed.

Code is poorly documented

There's a lot of info about Yampa around (papers, haskell's wiki, blogs) but this is not centralised. Since the code is not documented (not using haddock), it's quite daunting to understand the semantics of each function and how to use them.

Add a hello world example of gloss + Yampa

It would be great to have some trivial examples of good Yampa that can help people get started.

There's a project called Yampa 2048 that uses gloss. Factorizing the code logic out might give a reasonable hello gloss.

Add top-level documentation

Documentation should be added to the main page. There's tons of it, plus games. This project doesn't even have a README.

Add a hello world example of diagrams + Yampa

It would be great to have some trivial examples of good Yampa that can help people get started.

The ideal diagrams project would be either a Yampa program that outputs an animation (maybe in SVG?), or one that draws the animation using cairo/gtk.

Unable to build examples bundled with Yampa-0.10.6.1

This is with GHC 8.2.1, if that's significant:

$ cabal get Yampa-0.10.6.1
Unpacking to Yampa-0.10.6.1/
$ cd Yampa-0.10.6.1/
$ cabal configure -fexamples
Resolving dependencies...
Configuring Yampa-0.10.6.1...
$ cabal build
Preprocessing library for Yampa-0.10.6.1..
Building library for Yampa-0.10.6.1..
<build output elided>
Preprocessing executable 'yampa-examples-sdl-bouncingbox' for Yampa-0.10.6.1..
Building executable 'yampa-examples-sdl-bouncingbox' for Yampa-0.10.6.1..
[1 of 1] Compiling Main             ( examples/yampa-game/MainBouncingBox.hs, dist/build/yampa-examples-sdl-bouncingbox/yampa-examples-sdl-bouncingbox-tmp/Main.o )

examples/yampa-game/MainBouncingBox.hs:8:1: error:
    Could not find module ‘YampaSDL’
    Use -v to see a list of the files searched for.
  |
8 | import YampaSDL
  | ^^^^^^^^^^^^^^^

Add description to flags in cabal file

The flags in the cabal file accept a description field that explains what they do.

These could be added and would be shown on the package's hackage page.

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.