Skip to content

IO Monad #265

@lawrence-koh

Description

@lawrence-koh

Hi @Dobiasd,

I worked through your Udemy functional programming course and found functional programming and fplus to be highly interesting. Am currently attempting to refactor some code and am just wondering if there is a way to model IO monads using fplus?

I have a function that is currently as such:

//func : [String] -> Result String String
fplus::result< std::string, std::string > func( const std::vector< std::string >& param )

However, I would like to add some logging at the start of the function. This would change the return type since logging is an IO action which may fail, but not too sure how it can be done using fplus.

Be great if I could get your advice :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions