goldfirere / ghc

Mirror of ghc repository. DO NOT SUBMIT PULL REQUESTS HERE
http://www.haskell.org/ghc/
Other
25 stars 1 forks source link

Panic with dependent composition #71

Open goldfirere opened 8 years ago

goldfirere commented 8 years ago
{-# LANGUAGE DeriveDataTypeable, TypeFamilies, TemplateHaskell, DataKinds,
             PolyKinds, GADTs, RankNTypes, MultiParamTypeClasses,
             FlexibleInstances, UndecidableInstances, UnicodeSyntax,
             FunctionalDependencies, StandaloneDeriving,
             TypeOperators, ScopedTypeVariables, NoMonomorphismRestriction,
             MonadComprehensions, DeriveGeneric, FlexibleContexts,
             GeneralizedNewtypeDeriving, ConstraintKinds,
             LambdaCase, ViewPatterns, AllowAmbiguousTypes,
             DefaultSignatures, RecursiveDo, -- ImpredicativeTypes,
             ImplicitParams, MagicHash, UnboxedTuples, RoleAnnotations,
             ExtendedDefaultRules, PatternSynonyms, EmptyCase,
             BangPatterns, InstanceSigs, DeriveFunctor, Arrows
             , NamedWildCards, PartialTypeSignatures
             , TypeInType, TypeApplications, TypeFamilyDependencies
--             , NoImplicitPrelude
--             , OverloadedLists
  #-}

module Scratch where

import Data.Kind
import Data.Singletons
import Data.Singletons.TH

data instance Sing (x :: Proxy k) where
  SProxy :: Sing 'Proxy

dcomp :: forall (a :: Type)
                (b :: a ~> Type)
                (c :: forall (x :: a). Proxy x ~> b @@ x ~> Type)
                (f :: forall (x :: a) (y :: b @@ x). Proxy x ~> Proxy y ~> c @@ ('Proxy :: Proxy x) @@ y)
                (g :: forall (x :: a). Proxy x ~> b @@ x)
                (x :: a).
         Sing f
      -> Sing g
      -> Sing x
      -> c @@ ('Proxy :: Proxy x) @@ (g @@ ('Proxy :: Proxy x))
dcomp f g x = undefined