-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Labels
Description
The following genSingletons application fails:
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE StandaloneKindSignatures #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeOperators #-}
module Main where
import GHC.TypeLits
import Data.Kind
import Data.Singletons.TH
import Data.Singletons.TH.Options
type RegLayout :: Nat -> Type
data RegLayout len where
Both :: forall len1 len2. RegLayout len1 -> RegLayout len2 -> RegLayout (len1 + len2)
$(withOptions (defaultOptions {genSingKindInsts=False}) $ genSingletons [ ''RegLayout ])The problem appears to be the application of the (+) type family in the result type of Both. I suppose such family usage is just expecting too much of poor singletons?
singletons-th-3.1singletons-3.0.1