You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Documenting how to construct algebraic datatypes from python #35
The first solution is of course fine, but it requires more boilerplate, and I'm assuming it must be possible to use the Just constructor or the Nothing constructor directly somehow.
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>}
Activity
thautwarm commentedon Aug 8, 2020
for
to create Ctor:
Sorry for late reply!
I'm now working for some technique meetup, will add documemtations after Aug 15
thautwarm commentedon Aug 8, 2020
for enums, like
Nothing,mikesol commentedon Aug 10, 2020
Thanks!
I tried this, but it looks like the problem still persists:
yields
{'value0': 1, '.t': <function ps_Just at 0x7f19302ea710>} {'.t': <function ps_Nothing at 0x7f1930349b90>}Thanks in advance for your help!
release for purescript-python/purescript-python#35
thautwarm commentedon Aug 10, 2020
Sorry, purescripto 0.8.9 didn't release. Now
pip install -U purescriptofixes all.thautwarm commentedon Aug 10, 2020