Giter Site home page Giter Site logo

Comments (5)

thautwarm avatar thautwarm commented on May 28, 2024

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.

thautwarm avatar thautwarm commented on May 28, 2024

for enums, like Nothing,

nothing = Nothing.value

from purescript-python.

mikesol avatar mikesol commented on May 28, 2024

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.

thautwarm avatar thautwarm commented on May 28, 2024

Sorry, purescripto 0.8.9 didn't release. Now pip install -U purescripto fixes all.

from purescript-python.

thautwarm avatar thautwarm commented on May 28, 2024
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)

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.