小编Zor*_*jak的帖子

是否有可能将haskell"可操作"或"免费monad"存储到磁盘?

我有一些简单的原始操作,例如:

在的情况下,操作单子:

import Control.Monad.Operational
type Process a = Program ProcessI a
data ProcessI a where
    GetInput :: ProcessI String
    Dump :: String -> ProcessI ()
getInput :: Process String
getInput = singleton GetInput
dump :: String -> Process ()
dump = singleton . Dump
Run Code Online (Sandbox Code Playgroud)

或者在免费 monad的情况下:

import Control.Monad.Free
type Process = Free ProcessF
data ProcessF a
    = GetInput (String -> a)
    | Dump String a
    deriving (Functor)
getInput :: Process String
getInput = liftF $ GetInput id …
Run Code Online (Sandbox Code Playgroud)

haskell operational continuation

10
推荐指数
1
解决办法
240
查看次数

标签 统计

continuation ×1

haskell ×1

operational ×1