Skip to content

RefC backend IORef in Control.App monad #2424

Open
@vfrinken

Description

@vfrinken

The IORef information is stored in the Value_World struct in the RefC backend. However, using the Control.App monad, this world struct is not passed along

Steps to Reproduce

data MyStateName : Type where

fct_b : Has [PrimIO, State MyStateName Nat] es => App es ()
fct_b  = do
    g <- get MyStateName
    primIO $ putStrLn $ "value is " ++ (show g)
    pure ()


fct_a : Has [PrimIO] es => App es ()
fct_a = new 42 fct_b


main : IO ()
main = run fct_a

Expected Behavior

Output "value is 42"

Observed Behavior

Using the RefC backend, this results in a Segmentation Fault

I am going to create a PR implementing a global IORef storage, not one that is associated with the world struct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions