phantom-types

    3熱度

    1回答

    我有一個卡桑德拉表Department,列name_list extends ListColumn[String]和id extends StringColumn with PartitionKey。 我想獲取ID所請求的名存在於NAME_LIST。 我試過在運營商select(_.id).where(name in name_list)但它不工作。 另一個查詢,我試過select(_.id).w

    2熱度

    2回答

    我有一個Cassandra表Department,列name_list extends SetColumn[String] with PartitionKey和id extends StringColumn with PartitionKey。 我想獲取ID所請求的名存在於NAME_LIST。 我試過下面使用此代碼,但沒有得到任何結果 abstract class Departments exte

    0熱度

    3回答

    假設我有某種類型的,如: newtype Foo a b = Foo { getFoo :: SomeStructure b } 即a是僅用於編譯時檢查的幻像類型。 但是,我不想在任何地方使用幻像類型。這在我的代碼中並不普遍。所以我想做類似的事情: type FooUnrestricted b = Foo Anything b 我應該用什麼來代替Anything?我需要一些語言擴展嗎? 編

    0熱度

    1回答

    Phantom-DSL爲什麼使用ContactPoints和ContactPoint有兩種不同的連接方式? 在使用ContactPoint我可以省略使用主機或可以有主機爲字符串,但我要聲明端口在這裏。 val default: CassandraConnection = ContactPoint(port).keySpace(keyspace) 但在使用ContactPoints連接我必須聲明

    0熱度

    1回答

    我有一個項目來檢測特定水果的成熟度,我將使用Phantom 2的自動駕駛功能來飛行水果樹並捕獲圖像,然後我想進行實時圖像處理。 我在尋找很多,但沒有找到下列問題的答案。 我可以使用phantom 2進行實時圖像處理嗎?我可以將 覆盆子pi連接到幻像嗎?我需要什麼?我可以使用python 2.7 + opencv lib來編寫圖像處理代碼嗎?

    -2熱度

    1回答

    我有一個幻象類型: newtype MyType a = {getSth :: SthType} 我如何比較MyType a1和MyType a2相對於的a1和a2比較的結果,即如果a1 < a2然後MyType a1 < MyType a2?

    3熱度

    3回答

    我在使用幻象類型的困惑: type Words = String type Numbers = Int data NonPhantom = NP1 Words | NP2 Numbers deriving (Show) data Phantom a = P1 Words | P2 Numbers deriving (Show) nonPhantomFunction :: NonPha

    26熱度

    1回答

    我目前正在通過Type-Driven Development with Idris書。 我在第6章中有兩個與示例數據存儲設計有關的問題。數據存儲是一個命令行應用程序,允許用戶設置存儲哪種數據,然後添加新數據。 以下是代碼的相關部分(稍加簡化)。你可以看到在Github上full code: module Main import Data.Vect infixr 4 .+. -- Thi

    2熱度

    1回答

    鑑於哈斯克爾以下幻影類型例如從phadej: {-# LANGUAGE GeneralizedNewtypeDeriving #-} newtype Distance a = Distance Double deriving (Num, Show) data Kilometer data Mile marathonDistance :: Distance Kilometer

    1熱度

    1回答

    我想使用創建的操作員「幻影鍵入」單位: newtype Length (a::UnitLength) b = Length b deriving (Eq) data UnitLength = Meter | KiloMeter | Miles deriving (Eq,Show) class OperAdd a b c where (<+>