1 Star 0 Fork 0

dwz/coq-haskell

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
fixcode.pl 971 Bytes
一键复制 编辑 原始数据 按行查看 历史
#!/usr/bin/env perl
while (<>) {
s/import qualified (.*)/import qualified Hask.\1 as \1/;
s/import qualified Hask\.GHC/import qualified GHC/;
s{import qualified Hask\.Prelude as Prelude}{
import Debug.Trace (trace, traceShow)
import qualified Data.List
import qualified Prelude
};
s/unsafeCoerce :: a -> b/--unsafeCoerce :: a -> b/;
s/module (.+?) where/module Hask.\1 where/;
# s/module Hask..+?.Utils where/module Hask.Utils where/;
# Sometimes when generating type synonyms, the extraction mechanism will
# inexplicably flip type arguments. We undo these bugs here.
s/o -> Prelude.Either a \(\(,\) errType i\)/i -> Prelude.Either errType ((,) a o)/;
s/a -> \(,\) i o/i -> (,) a o/;
s/data Coq_simpl_fun/newtype Coq_simpl_fun/;
s/_Hask__//g; s/Hask__//g;
s/\(,\) \(\(Prelude\.succ\) \(\(Prelude\.succ\) \(unsafeCoerce n\)\)\)/(,) ((Prelude.succ) ((Prelude.succ) (unsafeCoerce n :: Prelude.Int)))/;
print;
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ajnew/coq-haskell.git
git@gitee.com:ajnew/coq-haskell.git
ajnew
coq-haskell
coq-haskell
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385