agda / agda-frp-js Goto Github PK
View Code? Open in Web Editor NEWECMAScript back end for Functional Reactive Programming in Agda
License: MIT License
ECMAScript back end for Functional Reactive Programming in Agda
License: MIT License
@asajeffrey
I might be missing something obvious, but it seems like one either needs to be able to construct the dom outside of behaviors (rather than postulating Beh DOM's directly), or have a "join" operator:
This gist contrasts building a string behavior from a list with trying to accomplish the same thing by rendering the list as a dom of li-tags. You get into trouble because what you are folding over is already a dom, so mapping it will wrap it again. Solutions could be the ability to create non-behavior dom values, or a "join" operator to flatten the wrapping.
Would either one of these be ok, or is there something vital you are trying to protect by not allowing non-behavior dom values (e.g. maybe there is a conflict with the way you are connecting to dom events)?
https://gist.github.com/2b949aeecdb936220810
I don't know if you've actively looked at this project in a while, but at the moment the calculator demo fails to compile.
~/agda-frp-js/demo/agda/FRP/JS/Demo/Calculator/View.agda:28,21-47
Cannot instantiate the metavariable _130 to solution .w since it
contains the variable .w which is not in scope of the metavariable
or irrelevant in the metavariable but relevant in the solution
when checking that the expression display (model evt) ++ dom has
type Beh (DOM .w) .t
make: *** [dist/jAgda.FRP.JS.Demo.Calculator.js] Error 1
I'm running make all
using an installation of Agda 2.3.2.2 (on OSX 10.6.8, but I don't think that would matter).
Running make all
:
[shana@lenalee:/tmp]$ nix-build ~/programming/nixpkgs/ -A agdaFrpJs -o /tmp/agda-frp-js
these derivations will be built:
/nix/store/p8ym2x8bals2wa3bj8iswzvz3kdf6kf8-agda-frp-js-aadb8dd38551e0ecad8e4e3cd2f8264fe58fa35c.drv
building path(s) `/nix/store/d18kgl7g1przdisk2bxszy9cnsw1sw8w-agda-frp-js-aadb8dd38551e0ecad8e4e3cd2f8264fe58fa35c'
building /nix/store/d18kgl7g1przdisk2bxszy9cnsw1sw8w-agda-frp-js-aadb8dd38551e0ecad8e4e3cd2f8264fe58fa35c
unpacking sources
unpacking source archive /nix/store/h24nayllk3wgjdiv3iajf72q29x578vz-git-export
source root is git-export
patching sources
configuring
building
building dist/
mkdir dist
building dist/require.js
cp src/js/require.js dist/require.js
building dist/agda.frp.js
cp src/js/agda.frp.js dist/agda.frp.js
building dist/agda.frp.main.js
cp src/js/agda.frp.main.js dist/agda.frp.main.js
building dist/agda.frp.signal.js
cp src/js/agda.frp.signal.js dist/agda.frp.signal.js
building dist/agda.frp.time.js
cp src/js/agda.frp.time.js dist/agda.frp.time.js
building dist/agda.frp.taskqueue.js
cp src/js/agda.frp.taskqueue.js dist/agda.frp.taskqueue.js
building dist/agda.mixin.js
cp src/js/agda.mixin.js dist/agda.mixin.js
building dist/agda.box.js
cp src/js/agda.box.js dist/agda.box.js
building dist/agda.array.js
cp src/js/agda.array.js dist/agda.array.js
building dist/agda.keys.js
cp src/js/agda.keys.js dist/agda.keys.js
building dist/agda.object.js
cp src/js/agda.object.js dist/agda.object.js
building dist/jAgda.FRP.JS.Demo.Hello.js
agda -i src/agda -i demo/agda --js --compile-dir dist demo/agda/FRP/JS/Demo/Hello.agda
Checking FRP.JS.Demo.Hello (/tmp/nix-build-agda-frp-js-aadb8dd38551e0ecad8e4e3cd2f8264fe58fa35c.drv-0/git-export/demo/agda/FRP/JS/Demo/Hello.agda).
Checking FRP.JS.Behaviour (/tmp/nix-build-agda-frp-js-aadb8dd38551e0ecad8e4e3cd2f8264fe58fa35c.drv-0/git-export/src/agda/FRP/JS/Behaviour.agda).
Checking FRP.JS.Bool (/tmp/nix-build-agda-frp-js-aadb8dd38551e0ecad8e4e3cd2f8264fe58fa35c.drv-0/git-export/src/agda/FRP/JS/Bool.agda).
Checking FRP.JS.Primitive (/tmp/nix-build-agda-frp-js-aadb8dd38551e0ecad8e4e3cd2f8264fe58fa35c.drv-0/git-export/src/agda/FRP/JS/Primitive.agda).
Checking FRP.JS.Level (/tmp/nix-build-agda-frp-js-aadb8dd38551e0ecad8e4e3cd2f8264fe58fa35c.drv-0/git-export/src/agda/FRP/JS/Level.agda).
/tmp/nix-build-agda-frp-js-aadb8dd38551e0ecad8e4e3cd2f8264fe58fa35c.drv-0/git-export/src/agda/FRP/JS/Level.agda:15,1-32
Duplicate binding for built-in thing LEVEL, previous binding to
.Agda.Primitive.Level
when checking the pragma BUILTIN LEVEL Level
make: *** [dist/jAgda.FRP.JS.Demo.Hello.js] Error 1
builder for `/nix/store/p8ym2x8bals2wa3bj8iswzvz3kdf6kf8-agda-frp-js-aadb8dd38551e0ecad8e4e3cd2f8264fe58fa35c.drv' failed with exit code 2
error: build of `/nix/store/p8ym2x8bals2wa3bj8iswzvz3kdf6kf8-agda-frp-js-aadb8dd38551e0ecad8e4e3cd2f8264fe58fa35c.drv' failed
Checked http://ect.bell-labs.com/who/ajeffrey/agda-frp-js/clock.html in
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.22) Gecko/20110905 Ubuntu/10.10 (maverick) Firefox/3.6.22
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.