-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Is there another package for the Maybe monad that purescript-python supports? In normal purescript, I run spago install maybe to use the Maybe monad. However, if I try to do that with purescript-python, it compiles but segfaults at runtime.
module Main where
import Prelude
import Effect (Effect)
import Effect.Console (log)
import Data.Maybe
x :: Maybe Int
x = Just 2
y :: Maybe Int
y = Nothing
main :: Effect Unit
main = do
log "🍝"
-- Doesn't matter which 3 branches are commented, all segfaults
--log $ show x
--log $ show y
case x of
Just i -> log $ show i
Nothing -> log "nothing"
Steps to reproduce
git clone https://github.com/purescript-python/example-hw
cd example-hw
# See [1]
spago upgrade-set
# See [2]
spago install prelude
spago install maybe
# Edit src/Main.purs as above
spago build && pspy --run
The output
Compiling Main
Warning 1 of 2:
in module Main
at src/Main.purs:8:1 - 8:18 (line 8, column 1 - line 8, column 18)
Module Data.Maybe has unspecified imports, consider using the explicit form:
import Data.Maybe (Maybe(..))
See https://github.com/purescript/documentation/blob/master/errors/ImplicitImport.md for more information,
or to contribute content related to this warning.
Warning 2 of 2:
in module Main
at src/Main.purs:3:1 - 3:15 (line 3, column 1 - line 3, column 15)
Module Prelude has unspecified imports, consider using the explicit form:
import Prelude (Unit, discard, show, ($))
See https://github.com/purescript/documentation/blob/master/errors/ImplicitImport.md for more information,
or to contribute content related to this warning.
[info] Build succeeded.
Codegen Python for Main
Codegen Python for Control.Bind
Codegen Python for Control.Applicative
Codegen Python for Control.Apply
Codegen Python for Control.Category
Codegen Python for Control.Semigroupoid
Codegen Python for Data.Function
Codegen Python for Data.Boolean
Codegen Python for Data.Ord
Codegen Python for Data.Eq
Codegen Python for Data.HeytingAlgebra
Codegen Python for Data.Symbol
Codegen Python for Type.Proxy
Codegen Python for Data.Unit
Codegen Python for Data.Show
Codegen Python for Record.Unsafe
Codegen Python for Data.Void
Codegen Python for Data.Ordering
Codegen Python for Data.Semigroup
Codegen Python for Data.Ring
Codegen Python for Data.Semiring
Codegen Python for Data.Functor
Codegen Python for Data.Maybe
Codegen Python for Control.Alt
Codegen Python for Control.Alternative
Codegen Python for Control.Plus
Codegen Python for Control.Extend
Codegen Python for Control.Monad
Codegen Python for Control.MonadZero
Codegen Python for Data.Bounded
Codegen Python for Data.Functor.Invariant
Codegen Python for Data.Monoid.Additive
Codegen Python for Data.Monoid
Codegen Python for Data.EuclideanRing
Codegen Python for Data.BooleanAlgebra
Codegen Python for Data.CommutativeRing
Codegen Python for Prelude
Codegen Python for Data.DivisionRing
Codegen Python for Data.Field
Codegen Python for Data.NaturalTransformation
Codegen Python for Data.Monoid.Alternate
Codegen Python for Control.Comonad
Codegen Python for Data.Newtype
Codegen Python for Data.Monoid.Conj
Codegen Python for Data.Monoid.Disj
Codegen Python for Data.Monoid.Dual
Codegen Python for Data.Monoid.Endo
Codegen Python for Data.Monoid.Multiplicative
Codegen Python for Data.Semigroup.First
Codegen Python for Data.Semigroup.Last
Codegen Python for Safe.Coerce
Codegen Python for Unsafe.Coerce
Codegen Python for Data.Generic.Rep
Codegen Python for Effect
Codegen Python for Effect.Console
🍝
[1] 3845030 segmentation fault (core dumped) pspy --run
Expected output
Same as purescript (Just 2)
Appendix
Probably just the example repo being outdated
[1] When trying to run spago build at this stage, I get this error:
[error] Oh noes! It looks like the PureScript version installed on your system is not compatible with the package-set you're using.
installed `purs` version: 0.14.5
minimum package-set version: 0.13.6
There are a few ways to solve this:
- install a compatible `purs` version (i.e. in the same 'semver range' as the one in the package set)
- if the `purs` version is 'too new', you can try using `spago upgrade-set` to upgrade to the latest package set
- if you know what you're doing and you want to disable this check, you can override the `version` of the `metadata` package in the packages.dhall, e.g.:
let upstream = <package-set url here>
in upstream
with metadata.version = "v0.14.5"
[2] When trying to run spago build at this stage, I get this error
[error] Some of your project files import modules from packages that are not in the direct dependencies of your project.
To fix this error add the following packages to the list of dependencies in your config:
- prelude
You may add these dependencies by running the following command:
spago install prelude
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels