我想知道在公共git存储库中存储公钥和私钥是否安全?这些密钥受密码保护.
我愿意这样做是为了保存我当前的linux配置.如果这样做不安全,你知道实现目标的方法吗?
问候
haskell中是否有一种方法可以将类型信息/向下转换为多态值?
在示例中,我有一个盒装类型T,它可以包含一个Int或一个Char我想写一个函数来提取这个值而不知道它是哪个类型.
{#- LANGUAGE RankNTypes -#}
data T = I Int | C Char
-- This is not working because GHC cannot bind "a"
-- with specific type Int and Char at the same time.
-- I just want a polymorphic value back ;(
getValue :: T -> (forall a. a)
getValue (I val) = val
getValue (C val) = val
-- This on the other hand works, because the function
-- is local to the pattern matching expression
onValue …Run Code Online (Sandbox Code Playgroud)