我有一個Cassandra表Department,列name_list extends SetColumn[String] with PartitionKey和id extends StringColumn with PartitionKey。 我想獲取ID所請求的名存在於NAME_LIST。 我試過下面使用此代碼,但沒有得到任何結果 abstract class Departments exte
假設我有某種類型的,如: newtype Foo a b = Foo { getFoo :: SomeStructure b }
即a是僅用於編譯時檢查的幻像類型。 但是,我不想在任何地方使用幻像類型。這在我的代碼中並不普遍。所以我想做類似的事情: type FooUnrestricted b = Foo Anything b
我應該用什麼來代替Anything?我需要一些語言擴展嗎? 編
我在使用幻象類型的困惑: 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
鑑於哈斯克爾以下幻影類型例如從phadej: {-# LANGUAGE GeneralizedNewtypeDeriving #-}
newtype Distance a = Distance Double
deriving (Num, Show)
data Kilometer
data Mile
marathonDistance :: Distance Kilometer
我想使用創建的操作員「幻影鍵入」單位: newtype Length (a::UnitLength) b = Length b deriving (Eq)
data UnitLength = Meter
| KiloMeter
| Miles
deriving (Eq,Show)
class OperAdd a b c where
(<+>