graninas/Hydra

Unieveral runSafely method

Ouverte

#56 ouverte le 13 juin 2020

 (0 commentaire) (0 réaction) (0 personne assignée)Haskell (14 forks)github user discovery
enhancementgood first issue

Métriques du dépôt

Stars
 (206 étoiles)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

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

Guide contributeur