Comments (5)
for
data C = Ctor Int Int
to create Ctor:
def new(t): return {'.t': t}
Ctor(1, new(Ctor))
Ctor.create(1)(2)
Sorry for late reply!
I'm now working for some technique meetup, will add documemtations after Aug 15
from purescript-python.
for enums, like Nothing
,
nothing = Nothing.value
from purescript-python.
Thanks!
I tried this, but it looks like the problem still persists:
-- snippet from Main.purs
addM :: Maybe Int -> Maybe Int -> Maybe Int
addM a b = (+) <$> a <*> b
# testMain.py
import pspy.Main.pure as Main
import pspy.Data.Maybe.pure as Maybe
print(Maybe.Just.create(1))
print(Main.addM(Maybe.Just.create(1))(Maybe.Just.create(2)))
yields
{'value0': 1, '.t': <function ps_Just at 0x7f19302ea710>}
{'.t': <function ps_Nothing at 0x7f1930349b90>}
Thanks in advance for your help!
from purescript-python.
Sorry, purescripto 0.8.9 didn't release. Now pip install -U purescripto
fixes all.
from purescript-python.
In [9]: import purescript_test.Main.pure as Main
...: import purescript_test.Data.Maybe.pure as Maybe
...:
...: print(Maybe.Just.create(1))
...: print(Main.addM(Maybe.Just.create(1))(Maybe.Just.create(2)))
{'value0': 1, '.t': <function ps_Just at 0x7f8ec3bf0c10>}
{'value0': 3, '.t': <function ps_Just at 0x7f8ec3bf0c10>}
from purescript-python.
Related Issues (20)
- avoid generating pretty-printed SExpr
- use passing directory for CI build HOT 6
- CI build error
- register concerned ffi-repos and fix ci HOT 1
- Could have other/original licence HOT 4
- Implementing FFI for external packages HOT 7
- purescript-python up-to-date HOT 1
- Nix-based installer
- unicode string representation HOT 1
- A tracker for the membership of purescript-python organization
- Better debugging when lambdas are called HOT 4
- spago run does codegen HOT 2
- Optimizations to avoid python recursion limit HOT 3
- Troubleshoot: Execution Not Sync to Latest Code HOT 1
- spago passing arguments to 'pspy --run'
- Code is generated on "spago run" (expected that to happen on "spago build") HOT 2
- How to make it support windows platform? HOT 2
- purescript/maybe segfaults at runtime HOT 9
- Trying to run a helloworld program, get "Backend "pspy" exited with error:2" HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from purescript-python.