
26 Nov
2014
26 Nov
'14
4:17 p.m.
Hello, The following code:
{-# LANGUAGE DataKinds #-} {-# LANGUAGE KindSignatures #-}
import Data.ByteString
data CmdKind = GET | SET
class Serialize (cmd :: CmdKind) where serialize :: cmd -> ByteString
Results in the following error:
wojtek@wojtek-desktop:~/src/he/snip$ ghc dk.hs [1 of 1] Compiling Main ( dk.hs, dk.o )
dk.hs:9:17: Expected a type, but ‘cmd’ has kind ‘CmdKind’ In the type ‘cmd -> ByteString’ In the class declaration for ‘Serialize’
Is this so by design, or should I write it in a different way, or is it just not implemented? -- Kind regards, Wojtek N.