Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unieveral runSafely method #56

Open
graninas opened this issue Jun 13, 2020 · 0 comments
Open

Unieveral runSafely method #56

graninas opened this issue Jun 13, 2020 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@graninas
Copy link
Owner

graninas commented Jun 13, 2020

Currently, the method has the following signature:

runSafely :: LangL a -> LangL (Either Text a)

But actually it should work for AppL scenarios too.

runSafely :: AppL a -> AppL (Either Text a)

This can be done by introducing separate methods for AppL and LangL: EvalSafelyAppL, EvalSafelyLangL, and adding a type class with runSafely method which will be specified for both languages.

class Safely m where
  runSafely :: m a -> m (Either Text a)

instance Safely LangL where
  runSafely = EvalSafelyLangL

instance Safely AppL where
  runSafely = EvalSafelyAppL
@graninas graninas added enhancement New feature or request good first issue Good for newcomers labels Jun 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant