graninas/Hydra

Unieveral runSafely method

オープン

#56 opened on 2020/06/13

 (0 件のコメント) (0 件のリアクション) (0 人の担当者)Haskell (14 件のフォーク)github user discovery
enhancementgood first issue

Repository metrics

Stars
 (206 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

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

コントリビューターガイド