graninas/Hydra

Unieveral runSafely method

Offen

#56 geöffnet am 13.06.2020

 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Haskell (14 Forks)github user discovery
enhancementgood first issue

Repository-Metriken

Stars
 (206 Sterne)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

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

Contributor Guide