For Haskell questions about involving the `-XDataKinds` extension in GHC. With -XDataKinds, GHC automatically promotes every suitable datatype to be a kind, and its (value) constructors to be type constructors.
Questions tagged [data-kinds]
155 questions
0
votes
1 answer
How do I make a Mod type with a variable as a parameter?
Here's my partially written Haskell code to search for a number of maximum multiplicative order:
{-# LANGUAGE DataKinds #-}
module Cryptography.WringTwistree.Mix3
( mix
, fiboPair
, searchDir
) where
import Data.Bits
import Data.Word
import…

Pierre Abbat
- 485
- 4
- 10
0
votes
2 answers
'IsList' instance for GADT
I have troubles implementing IsList instance for GADT which represents structure of values inside nested arrays. Here is complete code:
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-#…

Shersh
- 9,019
- 3
- 33
- 61
0
votes
0 answers
Type-level graphs via GADTs and DataKinds
I'm trying to encode a type-level graph with some constraints on the construction of edges (via a typeclass) but I'm running into an "Illegal constraint in type" error when I try to alias a constructed graph. What's causing this issue? If it's…

o1lo01ol1o
- 440
- 1
- 5
- 13
0
votes
1 answer
Types/Kinds Confusion in Haskell (Maybe) in Algebraic Data Types
I've been working on building my own Diplomacy simulator in Haskell to get my feet wet.
I believe I've come up with a decent definition for what an order is:
data Order = Hold Unit Territory
| Move Unit Territory Territory
|…

Eliza Brandt
- 338
- 2
- 13
0
votes
1 answer
IdGeneratorStrategy unique for each kind
Is there any way to create a primary key that is only unique inside one specific kind (assuming I am asking the right question here! - apologies if not) I notice there is an "IdentityType.APPLICATION" option but "Application" seems to be the…

johnvdenley
- 739
- 1
- 7
- 16