小编use*_*443的帖子

stack:表示"没有为URL中的包找到extra-dep设置"

我在stack.yaml中包含github的包.当我运行堆栈解算器时,我收到消息:No extra-dep setting found for package at URL:

对于这种情况,我在堆栈文档中找不到文档.警告表示什么?采取什么纠正措施?

flags: {}
extra-package-dbs: []
packages:
- '.'
- location: /home/frank/Workspace8/repo8/uniform/uniform-algebras
  extra-dep: true
- location: /home/frank/Workspace8/repo8/uniform/uniform-time
  extra-dep: true
- location:  
      git: https://github.com/andrewufrank/uniform-strings.git
      commit:  ba8bd37567758c1807bf470b3dda4f471cee0f5f
      extra-dep: true
- location:  
      git: https://github.com/andrewufrank/uniform-error.git
      commit:  46c62fcf8b4d6b7a5a9a3622c724ab573fce295d
      extra-dep: true 
extra-deps:
- data-easy-0.7.0
- pipes-4.3.2
resolver: lts-8.13
Run Code Online (Sandbox Code Playgroud)

haskell-stack

3
推荐指数
1
解决办法
339
查看次数

如何为Generic编写一个实例来派生一个像zero :: a(即常量)的函数?

我想得出的anyclass策略class Zeros.为此我需要一个默认实现和泛型的相应实例:

import GHC.Generics

class   Zeros z where
    zero :: z
    default zero :: (Generic z, Gzero (Rep z)) => z
    zero = gzero (from z)

class Gzero f  where
    gzero :: f a -> a
instance Gzero (Rec0 Int) where
    gzero (Rec0 i a) = a


data B1 = B1 Int
     deriving stock (Show, Read, Eq, Ord, Generic)
deriving instance Zeros B1


instance Zeros Int where zero = 0
Run Code Online (Sandbox Code Playgroud)

我收到错误消息(堆栈LTS 10.8 - GHC 8.2.2):

Not …
Run Code Online (Sandbox Code Playgroud)

haskell

3
推荐指数
1
解决办法
307
查看次数

为什么在扩展之前,id的相对IRI中的基本前缀会缩短?

我有一个JSON-LD文档,其中基本前缀没有像我期望的那样扩展,但首先缩短到它的根,然后@id附加数据:

{
    "@context": {
        "tag": "@type",
        "@base": "http://example.com/base#auth-1/",
        "Line": "lit:Line",
        "load": "book:load",
        "book": "http://gerastree.at/auth-1/",
        "lnum": "lit:lnum",
        "lline": {
            "@language": "deu",
            "@id": "lit:lines"
        },
        "lit": "http://gerastree.at/lit_2014#",
        "lid": "@id"
    },
    "loadid": "loadIDstring",
    "load": [
        {
            "tag": "Line",
            "lnum": 1,
            "lline": "asdf1",
            "lid": "1"
        },
        {
            "tag": "Line",
            "lnum": 2,
            "lline": "asdf2",
            "lid": "2"
        }
    ]
}
Run Code Online (Sandbox Code Playgroud)

然后RIOT(或操场)给出:

 riot --syntax=jsonld --output=turtle lines.jsonld
@prefix lit:  <http://gerastree.at/lit_2014#> .
@prefix book:  <http://gerastree.at/auth-1/> .

_:b0    book:load  <http://example.com/1> ;
        book:load  <http://example.com/2> .

<http://example.com/1>
        <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>  lit:Line ; …
Run Code Online (Sandbox Code Playgroud)

base-url json-ld

3
推荐指数
1
解决办法
100
查看次数

fuseki webinterface不显示数据集

我已经安装了fuseki并启动了服务器

#!/bin/sh    
cd /home/frank/localInstall/jena/apache-jena-fuseki-2.5.0
exec /home/frank/localInstall/jena/apache-jena-fuseki-2.5.0/fuseki-server -v --update --mem /testDB
Run Code Online (Sandbox Code Playgroud)

服务器正在运行,程序可以将数据存储在/ testDB中,但是Web界面不显示数据集,我无法添加数据集.当我尝试查询界面时说Please select a dataset.

我想我之前遇到过这个问题,并通过重新安装fuseki文件夹解决了这个问题.我想了解我做错了什么以及如何避免这个问题.谢谢!

配置文件是自动生成的文件.它是:

# Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0

## Fuseki Server configuration file.

@prefix :        <#> .
@prefix fuseki:  <http://jena.apache.org/fuseki#> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .

[] rdf:type fuseki:Server ;
   # Example::
   # Server-wide query timeout.   
   # 
   # Timeout - server-wide default: milliseconds.
   # Format 1: "1000" -- 1 second timeout
   # Format 2: "10000,60000" -- …
Run Code Online (Sandbox Code Playgroud)

jena fuseki

2
推荐指数
1
解决办法
1039
查看次数

为什么在实例中出现两次参数会在以后使用类中的函数时产生错误?

我有数据结构(这里BT),其中包括一个monad作为类型参数(这里m)(它是一个简化的形式Data.Binding.Simple),它在类(这里Variables3)中使用具有相同monad类型的函数.在使用数据的类的实例中,monad的类型参数(比如m)出现两次(这里Variable3 (T m) m a).这个编译,但是当我使用代码中的函数时,对于某些类型的参数(这里test3),我得到一个错误(could not deduce ... m ..m1),表明编译器将类型变量的两次出现视为不同.

我找到了一个解决方案:用不同的类型参数命名两个匹配项(比如说mm1)并添加等价m ~ m1(使用TypeFamilies扩展名).编译并运行.

这里有一些非常简化的代码,它会产生错误 test3

class (Monad m) => Variable3 v m a where  
 newVar3     :: a -> m (v a)
 readVar3    :: v a -> m a
 writeVar3   :: v a -> a -> m ()

data B a m = B {f1 :: a …
Run Code Online (Sandbox Code Playgroud)

haskell

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

缺少C库:

我编写了一些简单的代码来调用C库中的函数.代码编译(以及类似的部分适用于标准C库)但是当我编译和链接时,ghc找不到C库.我的cabal文件是:

executable ttclient
main-is:    MainFFI4TT.hs
build-depends: base
default-language: Haskell2010
hs-source-dirs: src
other-modules:
Include-dirs: treetaggerSourceC 
Includes: tagger-api.h
extra-libraries: libtreetagger
extra-lib-dirs: /usr/lib 
Run Code Online (Sandbox Code Playgroud)

该文件libtreetagger.so已存在/usr/lib但无法找到.还有什么需要什么?使用stack buildcabal install(8.0.2或8.0.1)是没有区别的.cabal是版本1.24.0.0,系统是linux debian stretch.

我宁愿将库保留在用户目录而不是系统目录中.这可以实现吗?

haskell代码是:

foreign import ccall "tagger-api.h init_treetagger"    
    c_initTreeTagger :: CString -> IO ()   
    -- void init_treetagger(char *param_file_name);

mainFFItest :: IO ()
mainFFItest = do 

    c_initTreeTagger "german-utf8.par"
Run Code Online (Sandbox Code Playgroud)

haskell ffi

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

使用`Path(..)`导入时为什么“'Path'的数据构造函数并不都在范围内”

当前包间接导入构造函数Path(..),该构造函数在更靠近源的导入链的模块中可用于派生,Read但是当我稍后尝试在独立的派生子句中使用它时,我得到

  • Can't make a derived instance of ‘Read (Path Abs Dir)’:
            The data constructors of ‘Path’ are not all in scope
              so you cannot derive an instance for it
        • In the stand-alone deriving instance for ‘Read (Path Abs Dir)’
Run Code Online (Sandbox Code Playgroud)

模块代码没有给出错误和导入Path(..)。导入中缺少什么?

{-# LANGUAGE FlexibleContexts      #-}
{-# LANGUAGE FlexibleInstances     #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings     #-}
{-# LANGUAGE TypeSynonymInstances  #-}
{-# LANGUAGE StandaloneDeriving  #-}

module Uniform.Convenience.StartApp(
    module Uniform.Convenience.StartApp
        )   where


import UniformBase …
Run Code Online (Sandbox Code Playgroud)

haskell

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

Pipes.Safe - 如何使用mapM

我有以下代码与管道没有第二个管道(>-> P.mapM ( fillMD5)).fillMD5是一项行动a -> IO a.

runSafeT $ runEffect $
     every (senseRecursive5  startfpo)
        >-> P.mapM ( fillMD5)
        >-> P.map fp2rdf  
        >-> toNTriple houtfile   
Run Code Online (Sandbox Code Playgroud)

错误是:

Couldn't match type `IO' with `Pipes.Safe.SafeT IO'
Expected type: Pipes.Safe.SafeT IO ()
  Actual type: IO ()
In the second argument of `($)', namely
  `runEffect
Run Code Online (Sandbox Code Playgroud)

我明白的类型mapM

mapM :: Monad m => (a -> m b) -> Pipe a b m r
Run Code Online (Sandbox Code Playgroud)

但我不明白如何将其提升到Safe.SafeT

haskell lifting haskell-pipes

0
推荐指数
1
解决办法
116
查看次数