小编agr*_*fix的帖子

Chrome:可以添加本地JavaScript SourceMap吗?

是否可以添加本地SourceMap?我有一个我无法修改的网站,包含压缩(闭包)JavaScript.我有一个属于该文件的本地JavaScript-SourceMap.有没有办法告诉GoogleChrome(或任何其他浏览器)在页面加载之前/之后添加SourceMap?

javascript browser google-chrome google-closure-compiler

24
推荐指数
1
解决办法
6171
查看次数

持久性:CRUD TypeClass

我想写简化了使用写CRUD后端一个类型类持久性,埃宋斯科蒂

这是我的想法:

runDB x = liftIO $ do info <- mysqlInfo
                      runResourceT $ SQL.withMySQLConn info $ SQL.runSqlConn x

class (J.FromJSON a, J.ToJSON a, SQL.PersistEntity a) => CRUD a where
    getBasePath :: a -> String
    getCrudName :: a -> String

    getFromBody :: a -> ActionM a
    getFromBody _ = do body <- jsonData
                       return body

    mkInsertRoute :: a -> ScottyM ()
    mkInsertRoute el =
        do post (fromString ((getBasePath el) ++ "/" ++ (getCrudName el))) $ do …
Run Code Online (Sandbox Code Playgroud)

haskell crud persistent yesod

9
推荐指数
1
解决办法
594
查看次数

具有不同参数数量的函数的类型类

在我简单的Haskell DSL中,我有以下函数来调用其他函数:

callF :: forall a. (Typeable a)
  => (V a) -> (V a)
callF fp@(V (FunP name)) =
  pack $ FunAppl (prettyV fp) []

callF1 :: forall a b. (Typeable a, Typeable b)
  => (V (V a -> V b)) -> V a -> (V b)
callF1 fp@(V (FunP name)) arg =
  pack $ FunAppl (prettyV fp) [prettyV arg]

callF2 :: forall a b c. (Typeable a, Typeable b, Typeable c)
  => (V (V a -> V b -> …
Run Code Online (Sandbox Code Playgroud)

dsl haskell function typeclass

6
推荐指数
1
解决办法
418
查看次数