graninas/Hydra

Unieveral runSafely method

开放

#56 创建于 2020年6月13日

 (0 条评论) (0 个反应) (0 位负责人)Haskell (14 个派生)github user discovery
enhancementgood first issue

仓库指标

星标
 (206 个星标)
PR 合并指标
 (30 天内没有已合并 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

贡献者指南